From 3085b48dc91601cb3cebcb138bd5574ed4be85d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2024 22:13:45 +0100 Subject: [PATCH 01/45] FIX Debug v21 --- htdocs/compta/resultat/clientfourn.php | 4 ++-- htdocs/compta/tva/quadri_detail.php | 8 ++++---- htdocs/core/lib/tax.lib.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index c300817bfa46c..efbde5c60dd69 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -258,9 +258,9 @@ print ''; if ($modecompta == 'BOOKKEEPING') { - print_liste_field_titre("PredefinedGroups", $_SERVER["PHP_SELF"], 'f.thirdparty_code,f.rowid', '', $param, '', $sortfield, $sortorder, 'width200 '); + print_liste_field_titre("PredefinedGroups", $_SERVER["PHP_SELF"], 'f.thirdparty_code,f.rowid', '', $param, '', $sortfield, $sortorder, ''); } else { - print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'width200 '); + print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, ''); } print_liste_field_titre(''); if ($modecompta == 'BOOKKEEPING') { diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 441c6bee6cd2a..ffc0adcd26567 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -51,6 +51,7 @@ $invoice_type = GETPOSTISSET('invoice_type') ? GETPOST('invoice_type', 'alpha') : ''; $vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'alphanohtml') : -1; +// Set $date_start_xxx and $date_end_xxx... include DOL_DOCUMENT_ROOT . '/compta/tva/initdatesforvat.inc.php'; $min = price2num(GETPOST("min", "alpha")); @@ -299,7 +300,7 @@ foreach ($x_paye[$my_paye_rate]['facid'] as $id => $dummy) { // ExpenseReport - if ($x_paye[$my_paye_rate]['ptype'][$id] == 'ExpenseReportPayment') { + if ($x_paye[$my_paye_rate]['ptype'][$id] === 'ExpenseReportPayment') { $expensereport->id = $x_paye[$my_paye_rate]['facid'][$id]; $expensereport->ref = $x_paye[$my_paye_rate]['facnum'][$id]; $expensereport->type = $x_paye[$my_paye_rate]['type'][$id]; @@ -417,7 +418,7 @@ print ""; print ''; print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; - print ' - "; print ''; print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; - print ' - '; // Ref diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 9632a893acd06..62c375ed81b15 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -1154,8 +1154,8 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql = "SELECT d.rowid, d.product_type as dtype, e.rowid as facid, d.$f_rate as rate, d.vat_src_code as vat_src_code, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,"; $sql .= " d.total_localtax1 as total_localtax1, d.total_localtax2 as total_localtax2, "; $sql .= " e.date_debut as date_start, e.date_fin as date_end, e.fk_user_author,"; - $sql .= " e.ref as facnum, e.total_ttc as ftotal_ttc, e.date_create, d.fk_c_type_fees as type,"; - $sql .= " p.fk_bank as payment_id, p.amount as payment_amount, p.rowid as pid, e.ref as pref"; + $sql .= " e.ref as facnum, e.ref as pref, e.total_ttc as ftotal_ttc, e.date_create, d.fk_c_type_fees as type,"; + $sql .= " p.fk_bank as payment_id, p.amount as payment_amount, p.rowid as pid"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport_det as d ON d.fk_expensereport = e.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_expensereport as p ON p.fk_expensereport = e.rowid"; @@ -1178,7 +1178,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " AND (d.product_type = -1"; $sql .= " OR e.date_debut is NOT null OR e.date_fin IS NOT NULL)"; // enhance detection of service if (getDolGlobalString('MAIN_NOT_INCLUDE_ZERO_VAT_IN_REPORTS')) { - $sql .= " AND (d.".$f_rate." <> 0 OR d.total_tva <> 0)"; + $sql .= " AND (d.".$db->sanitize($f_rate)." <> 0 OR d.total_tva <> 0)"; } $sql .= " ORDER BY e.rowid"; From ef41ebb864d36e56d39d9f45d5ad7bedbc660e12 Mon Sep 17 00:00:00 2001 From: daGrumpf <64209003+daGrumpf-bxp@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:07:23 +0100 Subject: [PATCH 02/45] PR#28448 broke qty float on xpedition same correction as #31794 (#32055) --- htdocs/expedition/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d16c964d4cb87..6f5c3ed47770c 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -357,7 +357,7 @@ } } else { //shipment line for product with no batch management and no multiple stock location - if (GETPOSTINT($qty) > 0) { + if (GETPOSTFLOAT($qty) > 0) { $totalqty += price2num(GETPOST($qty, 'alpha'), 'MS'); $subtotalqty = price2num(GETPOST($qty, 'alpha'), 'MS'); } @@ -401,7 +401,7 @@ } } } else { - if (GETPOSTINT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) { + if (GETPOSTFLOAT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) { $ent = "entl".$i; $idl = "idl".$i; $entrepot_id = is_numeric(GETPOSTINT($ent)) ? GETPOSTINT($ent) : GETPOSTINT('entrepot_id'); @@ -412,7 +412,7 @@ $entrepot_id = 0; } - $ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTINT($qty), 'MS'), $array_options[$i]); + $ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTFLOAT($qty), 'MS'), $array_options[$i]); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -671,7 +671,7 @@ $batch = "batchl".$detail_batch->fk_expeditiondet."_".$detail_batch->fk_origin_stock; $qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id; $batch_id = GETPOSTINT($batch); - $batch_qty = GETPOSTINT($qty); + $batch_qty = GETPOSTFLOAT($qty); if (!empty($batch_id)) { if ($lotStock->fetch($batch_id) > 0 && $line->fetch($detail_batch->fk_expeditiondet) > 0) { // $line is ExpeditionLine if ($lines[$i]->entrepot_id != 0) { @@ -708,7 +708,7 @@ $batch = "batchl".$line_id."_0"; $qty = "qtyl".$line_id."_0"; $batch_id = GETPOSTINT($batch); - $batch_qty = GETPOSTINT($qty); + $batch_qty = GETPOSTFLOAT($qty); $lineIdToAddLot = 0; if ($batch_qty > 0 && !empty($batch_id)) { if ($lotStock->fetch($batch_id) > 0) { From a2aa730c9a09028f4fdb97a36a9f392b084f6604 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2024 19:05:45 +0100 Subject: [PATCH 03/45] Debug v21 --- htdocs/compta/facture/prelevement.php | 1 + htdocs/core/class/html.form.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 25eb5c6f53271..0bcfe471ea530 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -786,6 +786,7 @@ $title = $langs->trans("NewPaymentByBankTransfer"); } + print ''; print '
'; print ''; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 218c5822d66bf..f5014e51c4dfe 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5214,7 +5214,7 @@ public function select_comptes($selected = '', $htmlname = 'accountid', $status } /** - * Return a HTML select list of bank accounts customer + * Return a HTML select list of bank accounts customer * * @param int|'' $selected Id account preselected * @param string $htmlname Name of select zone @@ -5238,7 +5238,7 @@ public function selectRib($selected = '', $htmlname = 'ribcompanyid', $filtre = $sql = "SELECT rowid, label, bank, status, iban_prefix, bic"; $sql .= " FROM " . $this->db->prefix() . "societe_rib"; - $sql.= " WHERE 1=1"; + $sql.= " WHERE type = 'ban'"; if ($filtre) { // TODO Support USF $sql .= " AND " . $filtre; } From 1a7b8faef4732a1ef7b32389e7dbeed34b0a6c58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2024 19:09:44 +0100 Subject: [PATCH 04/45] Typo --- htdocs/compta/facture/prelevement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 0bcfe471ea530..503c21af370f0 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -786,7 +786,7 @@ $title = $langs->trans("NewPaymentByBankTransfer"); } - print ''; + print ''; print ''; print ''; print ''; From ed2353b33753456e350b86667eb6cf2eb2d62ca3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Nov 2024 19:13:35 +0100 Subject: [PATCH 05/45] Fix typo --- 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 f5014e51c4dfe..4d6ad716352fe 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5164,7 +5164,7 @@ public function select_comptes($selected = '', $htmlname = 'accountid', $status if ($status == 0) { $out .= '