From 904bc424b453a419a2d406b6f0d159937b7f8e89 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Feb 2024 16:43:46 +0100 Subject: [PATCH 1/4] Fix missing $langs --- htdocs/core/modules/DolibarrModules.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 64fc3022684b7..9a10a65b40e81 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2270,7 +2270,7 @@ public function delete_dirs() public function insert_module_parts() { // phpcs:enable - global $conf; + global $conf, $langs; $error = 0; From 2ca26b5fe9b5f82799ccf522dc91ec843bed1709 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Mon, 12 Feb 2024 16:44:01 +0100 Subject: [PATCH 2/4] qual: phpdoc for classes using $num_payment (and not inheriting it from another class) (#28133) * phpdoc for classes using $num_payment (and not inheriting it from another class) * Update loanschedule.class.php * Update paymentloan.class.php * Update don.class.php * Update paymentdonation.class.php * Update paymentsalary.class.php * Update paymentsocialcontribution.class.php * Update paymentvarious.class.php * Update paiement.class.php * Update paymentvat.class.php * Update tva.class.php * phpcs * phpcs --- htdocs/compta/bank/class/paymentvarious.class.php | 3 ++- htdocs/compta/paiement/class/paiement.class.php | 5 +++-- .../sociales/class/paymentsocialcontribution.class.php | 4 +++- htdocs/compta/tva/class/paymentvat.class.php | 4 +++- htdocs/compta/tva/class/tva.class.php | 5 +++++ htdocs/don/class/don.class.php | 4 ++++ htdocs/don/class/paymentdonation.class.php | 4 ++++ htdocs/expensereport/class/paymentexpensereport.class.php | 4 ++++ htdocs/loan/class/loanschedule.class.php | 3 ++- htdocs/loan/class/paymentloan.class.php | 3 ++- htdocs/salaries/class/paymentsalary.class.php | 3 ++- 11 files changed, 34 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 33e33291bc828..1bda9521470d8 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -87,7 +87,8 @@ class PaymentVarious extends CommonObject public $type_payment; /** - * @var string Payment reference + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 3014a2be7219f..b44d2563c918f 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -147,14 +147,15 @@ class Paiement extends CommonObject public $type_code; /** - * @var string Numero du CHQ, VIR, etc... + * @var string * @deprecated * @see $num_payment */ public $num_paiement; /** - * @var string Numero du CHQ, VIR, etc... + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index b6b42347d2944..3449b18a7155e 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -98,11 +98,13 @@ class PaymentSocialContribution extends CommonObject /** * @var string * @deprecated + * @see $num_payment */ public $num_paiement; /** - * @var string + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index 0190b4d2e223a..6e853036f6e4a 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -73,11 +73,13 @@ class PaymentVAT extends CommonObject /** * @var string * @deprecated + * @see $num_payment */ public $num_paiement; /** - * @var string + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 7a0c249992c10..ca4b48085f00d 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -60,6 +60,11 @@ class Tva extends CommonObject public $datev; public $amount; public $type_payment; + + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ public $num_payment; /** diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index a1e90e39904ab..19cc0ed8deec1 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -139,6 +139,10 @@ class Don extends CommonObject */ public $fk_typepayment; + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ public $num_payment; public $date_valid; diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 9eae77ae97a86..f53a7f97d1f4d 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -67,6 +67,10 @@ class PaymentDonation extends CommonObject public $fk_typepayment; // Payment mode ID public $paymenttype; // Payment mode ID or Code. TODO Use only the code in this field. + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ public $num_payment; /** diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 6ce84881a7378..38a48059c4f1e 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -66,6 +66,10 @@ class PaymentExpenseReport extends CommonObject */ public $fk_typepayment; + /** + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") + */ public $num_payment; /** diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index 8b2fd53256866..ffe1942998e00 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -66,7 +66,8 @@ class LoanSchedule extends CommonObject public $fk_typepayment; /** - * @var int Payment ID + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index f9a5a119411ce..13581bbfa19ae 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -77,7 +77,8 @@ class PaymentLoan extends CommonObject public $fk_typepayment; /** - * @var string Payment ID (ex: 12345-chq1) + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index fd1a6e5acc798..3a2d6bfff7526 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -110,7 +110,8 @@ class PaymentSalary extends CommonObject public $num_paiement; /** - * @var string Payment reference + * @var string Payment reference + * (Cheque or bank transfer reference. Can be "ABC123") */ public $num_payment; From 49ba2132cddac35b8adf28ab101aa2656088e3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 12 Feb 2024 17:59:18 +0100 Subject: [PATCH 3/4] fix phpstan (#28142) --- htdocs/societe/class/companybankaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 55e35cc55dc6e..dc9f6bf30efa4 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -615,7 +615,7 @@ public function initAsSpecimen() $this->code_banque = '123'; $this->code_guichet = '456'; $this->number = 'CUST12345'; - $this->cle_rib = 50; + $this->cle_rib = '50'; $this->bic = 'CC12'; $this->iban = 'FR999999999'; $this->domiciliation = 'Bank address of customer corp'; From 9e250ae19b340557a11931af8dc4c870c6f1d326 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Mon, 12 Feb 2024 18:12:54 +0100 Subject: [PATCH 4/4] qual: phpstan for htdocs/loan/class/loanschedule.class.php (#28119) * qual: phpstan for htdocs/loan/class/loanschedule.class.php htdocs/loan/class/loanschedule.class.php 308 Property LoanSchedule::$num_payment (int) does not accept string. htdocs/loan/class/loanschedule.class.php 317 Property LoanSchedule::$fk_bank (int) does not accept string. * $num_payment is a string, not an int --- htdocs/loan/class/loanschedule.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index ffe1942998e00..135198de4a7ce 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -315,7 +315,7 @@ public function update($user = 0, $notrigger = 0) $this->note_public = trim($this->note_public); } if (isset($this->fk_bank)) { - $this->fk_bank = trim($this->fk_bank); + $this->fk_bank = (int) $this->fk_bank; } if (isset($this->fk_payment_loan)) { $this->fk_payment_loan = (int) $this->fk_payment_loan;