From 2bc158a2bb2140f3c2057ee241e3c6cac974f031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Fri, 3 Mar 2023 16:08:17 +0100 Subject: [PATCH 1/2] FIX: Resolve error message due to missing arguments --- htdocs/fourn/facture/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index fe952a31893..8fe4d59aeca 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -884,8 +884,12 @@ if (empty($reshook)) { $totalcreditnotes = $facture_source->getSumCreditNotesUsed(); $totaldeposits = $facture_source->getSumDepositsUsed(); $remain_to_pay = abs($facture_source->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits); + $desc = $langs->trans('invoiceAvoirLineWithPaymentRestAmount'); + $retAddLine = $object->addline($desc, $remain_to_pay, 0, 0, 0, 1, 0, 0, '', '', 0, '', 'TTC'); - $object->addline($langs->trans('invoiceAvoirLineWithPaymentRestAmount'), $remain_to_pay, 0, 0, 0, 1, 0, 0, '', '', 'TTC'); + if ($retAddLine < 0) { + $error++; + } } } } From 3b0b731eee9161e4c99c6b80be236712547f8f0a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 4 Mar 2023 13:50:14 +0100 Subject: [PATCH 2/2] fix: mathod call with default value --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5efbdeae8e1..4f78ae6c5b0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4054,7 +4054,7 @@ class Form public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) { // phpcs:enable - print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent = -1); + print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent); }