From 0e083bab20865a6d34f5dc2e688c8291cba522fc Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 22 Nov 2022 17:28:54 +0100 Subject: [PATCH 1/3] Fix(scrutinizer) https://scrutinizer-ci.com/g/Dolibarr/dolibarr/issues/develop/files/htdocs/don/class/paymentdonation.class.php?selectedLabels%5B0%5D=9&selectedSeverities%5B0%5D=10&orderField=lastFound&order=desc&honorSelectedPaths=0 --- htdocs/don/class/paymentdonation.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index e4928ac9363..a9ddcf62638 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -130,7 +130,7 @@ class PaymentDonation extends CommonObject $now = dol_now(); // Validate parameters - if (!$this->datepaid) { + if (!$this->datep) { $this->error = 'ErrorBadValueForParameterCreatePaymentDonation'; return -1; } @@ -587,7 +587,7 @@ class PaymentDonation extends CommonObject // Insert payment into llx_bank $bank_line_id = $acc->addline( - $this->datepaid, + $this->datep, $this->paymenttype, // Payment mode id or code ("CHQ or VIR for example") $label, $amount, From 721c7ed9298943472fd7ef37946e46fb071653e2 Mon Sep 17 00:00:00 2001 From: FLIO Date: Wed, 30 Nov 2022 22:43:07 +0100 Subject: [PATCH 2/3] Fix(Scrutinizer) --- htdocs/don/class/paymentdonation.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index a9ddcf62638..61c9086e10e 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -189,7 +189,7 @@ class PaymentDonation extends CommonObject $sql .= " fk_typepayment, num_payment, note, ext_payment_id, ext_payment_site,"; $sql .= " fk_user_creat, fk_bank)"; $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',"; - $sql .= " '".$this->db->idate($this->datepaid)."',"; + $sql .= " '".$this->db->idate($this->datep)."',"; $sql .= " ".price2num($totalamount).","; $sql .= " ".((int) $this->paymenttype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', "; $sql .= " ".($this->ext_payment_id ? "'".$this->db->escape($this->ext_payment_id)."'" : "null").", ".($this->ext_payment_site ? "'".$this->db->escape($this->ext_payment_site)."'" : "null").","; @@ -584,7 +584,6 @@ class PaymentDonation extends CommonObject if ($mode == 'payment_donation') { $amount = $total; } - // Insert payment into llx_bank $bank_line_id = $acc->addline( $this->datep, From 5ae8735f7e0e7e211b11729d5bc7d5808c7dc45e Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 31 Jan 2023 23:11:15 +0100 Subject: [PATCH 3/3] fix (scrutinizer) In payment don replacement of the variable that receives the value --- htdocs/don/payment/payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 6a2cc78f128..08084898f80 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -95,7 +95,7 @@ if ($action == 'add_payment') { // Create a line of payments $payment = new PaymentDonation($db); $payment->chid = $chid; - $payment->datepaid = $datepaid; + $payment->datep = $datepaid; $payment->amounts = $amounts; // Tableau de montant $payment->paymenttype = GETPOST("paymenttype", 'int'); $payment->num_payment = GETPOST("num_payment", 'alphanohtml');