From 777d8641515b51aaae34717ef447bed6a020530f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Mar 2024 10:01:05 +0100 Subject: [PATCH] Clean code --- htdocs/compta/prelevement/class/rejetprelevement.class.php | 3 --- htdocs/compta/tva/card.php | 1 + htdocs/compta/tva/class/paymentvat.class.php | 2 -- htdocs/webservices/server_payment.php | 7 +------ 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index c66dda3df0a..453920c5faa 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -178,9 +178,6 @@ class RejetPrelevement // Make a negative payment // Amount must be an array (id of invoice -> amount) $pai->amounts = array(); - - //var_dump($this->type);exit; - $pai->amounts[$facs[$i][0]] = price2num($amountrejected * -1); // The payment must be negative because it is a refund $pai->datepaye = $date_rejet; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index d3f0886eae9..696965f0d30 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -227,6 +227,7 @@ if (empty($reshook)) { $paiement->paiementtype = GETPOST("type_payment", 'alphanohtml'); $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); $paiement->note = GETPOST("note", 'restricthtml'); + $paiement->note_private = GETPOST("note", 'restricthtml'); if (!$error) { $paymentid = $paiement->create($user, (int) GETPOST('closepaidtva')); diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index f45cc80e909..dce5f09a3a6 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -161,8 +161,6 @@ class PaymentVAT extends CommonObject */ public function create($user, $closepaidvat = 0) { - global $conf, $langs; - $error = 0; $now = dol_now(); diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php index 1136b457b83..c01e11c79ef 100644 --- a/htdocs/webservices/server_payment.php +++ b/htdocs/webservices/server_payment.php @@ -189,17 +189,12 @@ function createPayment($authentication, $payment) $soc->fetch($payment['thirdparty_id']); $new_payment = new Paiement($db); - $new_payment->amount = (float) $payment['amount']; $new_payment->num_payment = $payment['num_payment']; $new_payment->fk_account = intval($payment['bank_account']); $new_payment->paiementid = !empty($payment['payment_mode_id']) ? intval($payment['payment_mode_id']) : $soc->mode_reglement_id; $new_payment->datepaye = $now; $new_payment->author = $payment['thirdparty_id']; - $new_payment->amounts = array(); - - if (intval($payment['invoice_id']) > 0) { - $new_payment->amounts[$payment['invoice_id']] = $new_payment->amount; - } + $new_payment->amounts = array($payment['invoice_id'] => (float) $payment['amount']); $db->begin(); $result = $new_payment->create($fuser, true);