From 0b69ed1612f1e0459d6e7e96004374d190f9f37e Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 26 Sep 2025 21:01:45 +0200 Subject: [PATCH 1/4] fix: display of chkbxlst in edit with filter (#35480) --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7e513eb2bc1..40ad9008968 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7953,9 +7953,9 @@ abstract class CommonObject if (strpos($InfoFieldList[4], 'extra') !== false) { $sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra'; $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); - $sqlwhere .= " AND " . $InfoFieldList[4]; + $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); } else { - $sqlwhere .= " WHERE " . $InfoFieldList[4]; + $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); } } else { $sqlwhere .= ' WHERE 1=1'; From c2e6aa399906499c565e0714a6f2f9f900f350db Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Sat, 27 Sep 2025 04:11:31 +0200 Subject: [PATCH 2/4] Fix to cover arrays (#35499) --- htdocs/core/ajax/ajaxdirpreview.php | 7 ++++++- htdocs/ecm/index_auto.php | 14 +++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 6662ebf14b1..17035e35ece 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -6,6 +6,7 @@ * Copyright (C) 2010 Pierre Morin * Copyright (C) 2013 Marcos GarcĂ­a * Copyright (C) 2024 MDW + * Copyright (C) 2025 Joachim Kueter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -224,7 +225,11 @@ if ($type == 'directory') { $parameters = array('modulepart' => $module); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { - $automodules[] = $hookmanager->resArray['module']; + if (is_array($hookmanager->resArray['module'])) { + $automodules = array_merge($automodules, $hookmanager->resArray['module']); + } else { + $automodules[] = $hookmanager->resArray['module']; + } } // TODO change for multicompany sharing diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index a46470e9d7a..c745c14bb08 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -2,7 +2,9 @@ /* Copyright (C) 2008-2014 Laurent Destailleur * Copyright (C) 2008-2010 Regis Houssin * Copyright (C) 2016 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Joachim Kueter + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -405,8 +407,14 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $parameters = array(); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { - $sectionauto[] = $hookmanager->resArray; - $rowspan += count($hookmanager->resArray); + $res = $hookmanager->resArray[0]; + if (is_array($hookmanager->resArray[0])) { + $sectionauto = array_merge($sectionauto, $hookmanager->resArray); + $rowspan += count($hookmanager->resArray); + } else { + $sectionauto[] = $hookmanager->resArray; + $rowspan++; + } } } From 13be852eacd907d33feb5b9f8fe28eba8f26d565 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Sat, 27 Sep 2025 04:12:07 +0200 Subject: [PATCH 3/4] Fix #35354 (#35502) * Changed param from int * Use float --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 98b441d9d63..830e0e2142c 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -218,7 +218,7 @@ if (empty($reshook)) { } } - $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTINT($key)); + $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTFLOAT($key)); } } From 16c9d4005f4a4917b96629da436b957304b3c383 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Sat, 27 Sep 2025 12:10:15 +0200 Subject: [PATCH 4/4] Fix #35208 - Multicurrency fix for discount in invoice (Sponge) (#35506) * Multicurrency fix for discount * removed empty line --- .../core/modules/facture/doc/pdf_sponge.modules.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 28ccd2c8f5c..72c982cb7b9 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1648,6 +1648,12 @@ class pdf_sponge extends ModelePDFFactures if ($line->total_ht < 0) { $total_line_remise += -$line->total_ht; } + $usemc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1); + $total_line_remise_print = $total_line_remise; + if ($usemc) { + $ratio = (!empty($object->total_ht) ? (float) $object->multicurrency_total_ht / (float) $object->total_ht : 0); + if (!empty($ratio)) $total_line_remise_print = price2num($total_line_remise * $ratio, 'MT'); + } } if ($total_line_remise > 0) { if (getDolGlobalString('MAIN_SHOW_AMOUNT_DISCOUNT')) { @@ -1655,8 +1661,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1); - + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise_print, 0, $outputlangs), 0, 'R', 1); $index++; } // Show total NET before discount @@ -1665,8 +1670,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1); - + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise_print + $total_ht, 0, $outputlangs), 0, 'R', 1); $index++; } }