From c8e2343d56e86a30f4250ce1d4eecf40385c646c Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Tue, 28 Apr 2026 14:00:45 +0200 Subject: [PATCH 1/7] FIX : use company default RIB when it is defined (#38016) Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/prelevement.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 83632e54288..a8116c7fed2 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -821,20 +821,21 @@ if ($object->id > 0) { print $langs->trans('CustomerIBAN').' '; // if societe rib in model invoice, we preselect it - $selectedRib = ''; + $selectedRibId = 0; if ($object->element == 'invoice' && $object->fk_fac_rec_source) { $facturerec = new FactureRec($db); $facturerec->fetch($object->fk_fac_rec_source); if ($facturerec->fk_societe_rib) { $companyBankAccount = new CompanyBankAccount($db); $res = $companyBankAccount->fetch($facturerec->fk_societe_rib); - $selectedRib = $companyBankAccount->id; + $selectedRibId = $companyBankAccount->id; } } - - $selectedRib = $form->selectRib($selectedRib, 'accountcustomerid', 'fk_soc='.$object->socid, 1, '', 1); - $defaultRibId = $object->thirdparty->getDefaultRib(); + if (empty($selectedRibId)) $selectedRibId = (int) $defaultRibId; + + $selectedRib = $form->selectRib($selectedRibId, 'accountcustomerid', 'fk_soc='.$object->socid, 1, '', 1); + if ($defaultRibId) { $companyBankAccount = new CompanyBankAccount($db); $res = $companyBankAccount->fetch($defaultRibId); From f830b997c6f901b581d4d6e8ef487d699304ea5c Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Fri, 1 May 2026 23:14:46 +0200 Subject: [PATCH 2/7] Fix empty data-rowid on holiday list rows (#38050) --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 5ea2ef1dfe6..e39e0c7d88b 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -909,7 +909,7 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids)) } else { // Show here line of result $j = 0; - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; From c24bb892bc0b262fc1f9208fb7c00f5c24974b5f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 May 2026 23:27:26 +0200 Subject: [PATCH 3/7] FIX #36589 (#38037) --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f48b2803f9..662715f7019 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14251,7 +14251,7 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '', $us //var_dump($element_prop); //var_dump($element_prop['module'].' '.$ismodenabled); if (is_array($element_prop) && (empty($element_prop['module']) || $ismodenabled)) { - if ($useCache === 1 + if ($useCache === 1 && $element_id > 0 && !empty($conf->cache['fetchObjectByElement'][$element_type]) && !empty($conf->cache['fetchObjectByElement'][$element_type][$element_id]) && is_object($conf->cache['fetchObjectByElement'][$element_type][$element_id]) From b9507a980cfa3c7c2185fa3f116f44fef5d21688 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 7 May 2026 11:04:41 +0300 Subject: [PATCH 4/7] Fix: scope file picker click to the just-shown attach-new-file form (#38114) In FormFile::list_of_documents(), when the user clicks the "+ New" button to reveal the upload form (showhideaddbutton), the JS handler triggers jQuery("input[type='file']").click(). This selector matches every on the page, opening the OS file picker once per match. Users with multiple file inputs in the DOM (e.g. another hidden upload form, an editor's media browser, modules with their own attachers) have to dismiss the file dialog several times before being able to drag-drop or browse normally. Fix: scope the selector to the form that was just shown: - jQuery("input[type='file']").click(); + jQuery(".divattachnewfile input[type='file']").first().click(); No regression on pages with a single .divattachnewfile. Reproduces on any *document.php tab where a hidden second is present. --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2bce5a5b04d..1af0195dfea 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1407,7 +1407,7 @@ class FormFile // Show title of list of existing files $morehtmlright = ''; if (!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) { - $tmpurlforbutton = 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery("input[type=\'file\']").click();}void(0);'; + $tmpurlforbutton = 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery(".divattachnewfile input[type=\'file\']").first().click();}void(0);'; // scope file picker click to the just-shown form to avoid triggering native file dialog twice when other input[type=file] exist on the page $morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $tmpurlforbutton, '', $permtoeditline); } From 671f2fc9df47ca92c7ef6b3e9e429b1da355db11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= <85104766+Kazimir42@users.noreply.github.com> Date: Thu, 7 May 2026 10:11:22 +0200 Subject: [PATCH 5/7] FIX : draft invoice paid when add absolute discount == remain to pay (#38104) * Fix set paid invoice on status draft when add absolute discount == remain to pay * fix --- htdocs/compta/facture/card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f3535de1d66..111ae3a6a40 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -676,9 +676,11 @@ if (empty($reshook)) { } if (!$error) { - $newremaintopay = $object->getRemainToPay(0); - if ($newremaintopay == 0) { - $object->setPaid($user); + if ($object->status == Facture::STATUS_VALIDATED) { + $newremaintopay = $object->getRemainToPay(0); + if ($newremaintopay == 0) { + $object->setPaid($user); + } } } } From c0fb6bf32256ca3650d7b3036c38ab96270adb8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2026 13:07:11 +0200 Subject: [PATCH 6/7] Fix typo (fix in different direction than #38094) --- htdocs/core/tpl/objectline_title.tpl.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 2 +- htdocs/core/tpl/subtotal_view.tpl.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 7d059684e29..8f9ecaf251a 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -116,7 +116,7 @@ print ''.$langs->trans('PriceUHT').'multicurrency_code != $conf->currency) { print ''.$langs->trans('PriceUHT'); - print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')'; + print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')'; } // Price TTC diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 2ab037ed6ca..387a86b0166 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -504,7 +504,7 @@ if ($line->special_code == 3) { print $tooltiponpriceend; print ''; if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { - print ''; + print ''; print $tooltiponpricemultiprice; print price($sign * $line->multicurrency_total_ht); print $tooltiponpriceendmultiprice; diff --git a/htdocs/core/tpl/subtotal_view.tpl.php b/htdocs/core/tpl/subtotal_view.tpl.php index cf1fe6fd56e..c8739156d72 100644 --- a/htdocs/core/tpl/subtotal_view.tpl.php +++ b/htdocs/core/tpl/subtotal_view.tpl.php @@ -161,7 +161,7 @@ if ($line->qty > 0) { ?> ?> multicurrency_code != $conf->currency) { ?> - + qty < 0) { // Base colspan if there is no module activated to display line correctly From d7bdd3256b5efa110adb23bbccc3f9c377402387 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2026 13:19:07 +0200 Subject: [PATCH 7/7] Fix typo (fix in different direction than #38094) --- htdocs/core/tpl/objectline_title.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 8f9ecaf251a..b3498241943 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -207,7 +207,7 @@ print ''.$langs->trans('TotalHTShort').''; // Multicurrency if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { print ''.$langs->trans('TotalHTShort'); - print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')'; + print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')'; } if ($outputalsopricetotalwithtax) {