From 24652ec722606273f18e5dcdd3a3d501a3a89ea4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 2 Aug 2025 00:50:07 +0200 Subject: [PATCH 01/10] FIX: asset: could not select invoice in disposal pop-in (#34725) --- htdocs/asset/card.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index bd3255491fc..643d46f63a0 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -271,9 +271,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $disposal_type_form = $object->showInputField(null, 'fk_disposal_type', $fk_disposal_type, '', '', '', 0); $object->fields['fk_disposal_type']['visible'] = -2; - $object->fields['disposal_invoice_id'] = array('type' => 'integer:Facture:compta/facture/class/facture.class.php::entity IN (__SHARED_ENTITIES__)', 'enabled' => '1', 'notnull' => 1, 'visible' => 1, 'index' => 1, 'validate' => '1',); - $disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', $disposal_invoice_id, '', '', '', 0); - unset($object->fields['disposal_invoice_id']); + $disposal_invoice_form = $form->selectForForms('Facture:compta/facture/class/facture.class.php::(entity:IN:__SHARED_ENTITIES__)', 'disposal_invoice_id', $disposal_invoice_id); // Create an array for form $formquestion = array( From b3a22576382995077f5cbcf5f425828d2e3b4616 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 Aug 2025 21:22:47 +0200 Subject: [PATCH 02/10] Fix : contract line activation error when duration not defined (#34813) * Fix : contract line activation error when duration not defined * Fix of fix * Update card.php --------- Co-authored-by: x Co-authored-by: Laurent Destailleur --- htdocs/contrat/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 6e5e32570f4..1656aed736b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1886,7 +1886,9 @@ if ($action == 'create') { if ($objp->fk_product > 0) { $product = new Product($db); $product->fetch($objp->fk_product); - $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + if (!empty($product->duration_value) && !empty($product->duration_unit)) { + $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + } } } From 9bd8fe4e46a9be925e45e73e9ec24f4b5e1eeb51 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 7 Aug 2025 12:22:42 +0200 Subject: [PATCH 03/10] Update currency --- htdocs/install/mysql/data/llx_c_currencies.sql | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index 0c02c303c78..a7446e0ff17 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -64,7 +64,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CAD' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CVE', '[4217]', 1, 'Cap Verde Escudo'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KYD', '[36]', 1, 'Cayman Islands Dollar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CLP', '[36]', 1, 'Chile Peso'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CNY', '[165]', 1, 'China Yuan Renminbi'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CNY', '[165]', 1, 'China Yuan Renminbi'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'COP', '[36]', 1, 'Colombia Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CRC', '[8353]', 1, 'Costa Rica Colon'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HRK', '[107,110]', 1, 'Croatia Kuna'); @@ -77,8 +77,8 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ECS' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EGP', '[163]', 1, 'Egypt Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SVC', '[36]', 1, 'El Salvador Colon'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EEK', '[107,114]', 1, 'Estonia Kroon'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ETB', NULL, 1, 'Ethiopian Birr'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EUR', '[8364]', 1, 'Euro Member Countries'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ETB', NULL, 1, 'Ethiopian Birr'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EUR', '[8364]', 1, 'Euro Member Countries'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FKP', '[163]', 1, 'Falkland Islands (Malvinas) Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FJD', '[36]', 1, 'Fiji Dollar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GHC', '[162]', 1, 'Ghana Cedis'); @@ -91,7 +91,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HNL' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HKD', '[36]', 1, 'Hong Kong Dollar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HUF', '[70,116]', 1, 'Hungary Forint'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ISK', '[107,114]', 1, 'Iceland Krona'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'INR', '[8377]', 1, 'India Rupee'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'INR', '[8377]', 1, 'India Rupee'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IDR', '[82,112]', 1, 'Indonesia Rupiah'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IRR', '[65020]', 1, 'Iran Rial'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IMP', '[163]', 1, 'Isle of Man Pound'); @@ -112,7 +112,8 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LTL' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MGA', NULL, 1, 'Ariary'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MKD', '[1076,1077,1085]', 1, 'Macedonia Denar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MYR', '[82,77]', 1, 'Malaysia Ringgit'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MRO', NULL, 1, 'Mauritania Ouguiya'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MRO', NULL, 0, 'Mauritania Ouguiya'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MRU', '[77,85]', 1, 'Mauritania Ouguiya'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MUR', '[8360]', 1, 'Mauritius Rupee'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MXN', '[36]', 1, 'Mexico Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MDL', NULL, 1, 'Moldova Leu'); @@ -175,7 +176,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ATS' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BEF', NULL, 0, 'Francs belges'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DEM', NULL, 0, 'Deutsche Mark'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ESP', NULL, 0, 'Pesete'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FIM', NULL, 0, 'Mark finlandais'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FIM', NULL, 0, 'Mark finlandais'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FRF', NULL, 0, 'Francs francais'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GRD', NULL, 0, 'Drachme (grece)'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'IEP', NULL, 0, 'Livres irlandaises'); From da56360404b9772b1e059eedcfbc264b84ea1687 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Thu, 7 Aug 2025 12:25:59 +0200 Subject: [PATCH 04/10] Fix for issue #34891 - wrong Skonto/Escompte calculation (#34892) When foreign currency is involved, the wrong total was used, mixing two currencies when calculating the sum. --- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index e466edf1deb..0b618907ee3 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -3,7 +3,8 @@ * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Joachim Küter * * 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 @@ -804,7 +805,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); $resteapayer = 0; } From eb14f15a5cd9e6b66344063de4ece955f27d4049 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 7 Aug 2025 13:50:47 +0200 Subject: [PATCH 05/10] Fix undef var in CLI context --- dev/tools/codespell/codespell-ignore.txt | 3 +++ htdocs/core/lib/functions.lib.php | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index 1ba3d105f4f..676a1cbe146 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -10,6 +10,9 @@ postgresql # ZAR currency zar +# Need as part of some PHP keys for some array variables +referer + # Name of contributores noe udo diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9e9a2f55541..a99ab7b2bde 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2024 Laurent Destailleur + * Copyright (C) 2004-2025 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Christophe Combelles @@ -6348,12 +6348,12 @@ function dol_print_error($db = null, $error = '', $errors = null) } $out .= "".$langs->trans("UserAgent").": ".(isset($_SERVER["HTTP_USER_AGENT"]) ? dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT) : '')."
\n"; $out .= "
\n"; - $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT)."
\n"; - $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."
\n"; - $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu, ENT_COMPAT) : '')."
\n"; + $out .= "" . $langs->trans("RequestedUrl") . ": " . (isset($_SERVER["REQUEST_URI"]) ? dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT) : '') . "
\n"; + $out .= "" . $langs->trans("Referer") . ": " . (isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '') . "
\n"; + $out .= "" . $langs->trans("MenuManager") . ": " . (isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu, ENT_COMPAT) : '') . "
\n"; $out .= "
\n"; - $syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]); - $syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]); + $syslog .= "url=" . (isset($_SERVER["REQUEST_URI"]) ? dol_escape_htmltag($_SERVER["REQUEST_URI"]) : ''); + $syslog .= ", query_string=" . (isset($_SERVER["QUERY_STRING"]) ? dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''); } else { // Mode CLI $out .= '> '.$langs->transnoentities("ErrorInternalErrorDetected").":\n".$argv[0]."\n"; $syslog .= "pid=".dol_getmypid(); From 5024aee975e2a966e4385d0cf584cc5fe6236b19 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 7 Aug 2025 14:42:20 +0200 Subject: [PATCH 06/10] fix: with MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS and multicompany image are not find on send mail (#34894) --- htdocs/core/class/CMailFile.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e41fa2d0ca5..e1a90982b20 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -269,7 +269,11 @@ class CMailFile // Note because media links are public, this should be useless, except avoid blocking images with email browser. // This convert an embedd file with src="/viewimage.php?modulepart... into a cid link // TODO Exclude viewimage used for the read tracker ? - $findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias'); + $dolibarr_main_data_root_images=$dolibarr_main_data_root; + if ($conf->entity!==1) { + $dolibarr_main_data_root_images.='/'.$conf->entity.'/'; + } + $findimg = $this->findHtmlImages($dolibarr_main_data_root_images.'/medias'); if ($findimg<0) { dol_syslog("CMailFile::CMailfile: Error on findHtmlImages"); $this->error = 'ErrorInAddAttachementsImageBaseOnMedia'; From ec669eef2ae518c875aaf013e966837c41dd93a7 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 7 Aug 2025 16:18:45 +0200 Subject: [PATCH 07/10] Duplicate lines --- .../core/modules/supplier_invoice/doc/pdf_canelle.modules.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 910f626cc89..5f23262a0cf 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -4,8 +4,6 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW * Copyright (C) 2024 Nick Fragoulis * Copyright (C) 2025 Joachim Küter * From 15681e8bd5c84387e336e04d31499bb1564c7851 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 7 Aug 2025 16:18:46 +0200 Subject: [PATCH 08/10] Duplicate lines From 2c073b37c068c5bb1386f2b6cf93b5716efba229 Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Thu, 7 Aug 2025 19:51:24 +0200 Subject: [PATCH 09/10] FIX DA026536: missing
in automatic e-mail (#34895) * FIX DA026536: missing
in automatic e-mail * Update ticket.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/ticket/class/ticket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 420cfb0f656..13a477d0ef9 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2796,7 +2796,7 @@ class Ticket extends CommonObject // Customer company infos $message .= '

'; $message .= "=============================================="; - $message .= !empty($object->thirdparty->name) ? '
'.$langs->trans('Thirdparty')." : ".$object->thirdparty->name : ''; + $message .= !empty($object->thirdparty->name) ? '
'.$langs->trans('ThirdParty')." : ".$object->thirdparty->name : ''; $message .= !empty($object->thirdparty->town) ? '
'.$langs->trans('Town')." : ".$object->thirdparty->town : ''; $message .= !empty($object->thirdparty->phone) ? '
'.$langs->trans('Phone')." : ".$object->thirdparty->phone : ''; @@ -2867,7 +2867,7 @@ class Ticket extends CommonObject // Contact type $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], -1).' ('.strtolower((string) $info_sendto['libelle']).')'; - $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); + $message .= (!empty($recipient) ? '
'.$langs->trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); } } $message .= '
'; @@ -2949,7 +2949,7 @@ class Ticket extends CommonObject } $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], -1).' ('.strtolower((string) $info_sendto['libelle']).')'; - $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); + $message .= (!empty($recipient) ? '
'.$langs->trans('TicketNotificationRecipient').' : '.$recipient.'
' : ''); } } From 0e7770dc71e3907e6f9c97c8e7cf0cb342a8941b Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Thu, 7 Aug 2025 20:01:06 +0200 Subject: [PATCH 10/10] FIX: extrafields of type "int" not displayed on `projet/tasks.php` (#34896) + fix warning "Undefined variable $object" --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index e7fb7e0ac2b..d2272a7702c 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -56,7 +56,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield } $value = $datenotinstring; } elseif (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('int'))) { - $value = (!empty($obj->$tmpkey) || $obj->$tmpkey === '0' ? $obj->$tmpkey : ''); + $value = $obj->$tmpkey ?? (isset($obj->array_options[$tmpkey]) ? $obj->array_options[$tmpkey] : null) ?? ''; } else { // The key may be in $obj->array_options if not in $obj $value = (isset($obj->$tmpkey) ? $obj->$tmpkey : @@ -71,7 +71,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield } } - $valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey, null, $object); + $valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey, null, $object ?? null); $title = dol_string_nohtmltag($valuetoshow); print '