From 265acd7133b197441dd4ec4431438bc300ea568c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2026 00:58:01 +0100 Subject: [PATCH 1/8] Fix CI --- htdocs/compta/facture/card.php | 1 + htdocs/product/stock/product.php | 3 ++- htdocs/takepos/index.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 881a4c94b5a..68256fbd04a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5090,6 +5090,7 @@ if ($action == 'create') { if ($objectidnext && $statusreplacement == 0) { print '
'.$langs->trans("ErrorCantCancelIfReplacementInvoiceNotValidated").'
'; } else { + $close = array(); // Code $close[1]['code'] = 'badcustomer'; $close[2]['code'] = 'abandon'; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 1bb392bc33a..fbfe0dc4f82 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -572,8 +572,9 @@ if (isModEnabled('project')) { $formproject = new FormProjets($db); } - $variants = false; +$iskit = 0; + if ($id > 0 || $ref) { $object = new Product($db); $result = $object->fetch($id, $ref); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 4385bb1e557..5ad61000971 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1456,6 +1456,8 @@ if (getDolGlobalString('TAKEPOS_DIRECT_PAYMENT')) { $menus[$r++] = array('title' => '
'.$langs->trans("DirectPayment").' ('.$langs->trans("Cash").')
', 'action' => 'DirectPayment();'); } +$customprinterallowed = false; + // BAR RESTAURANT specific menu if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { // Button to print receipt before payment From 19a29402de38dade745ba3e96a1408520f690ea8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 1 Feb 2026 01:27:33 +0100 Subject: [PATCH 2/8] Warning on export/import - Add isset() protection in Export::load_arrays() & Import::load_arrays() (#37043) * Warning on export - Add isset() protection in Export::load_arrays() * Warning on import - Add isset() protection in Import::load_arrays() --------- Co-authored-by: Laurent Destailleur --- htdocs/exports/class/export.class.php | 15 ++++++++------- htdocs/imports/class/import.class.php | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 4e5d0c28c54..ff446ca3433 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -1,10 +1,11 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012 Charles-Fr BENKE - * Copyright (C) 2016 Raphaël Doursenaud +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Charles-Fr BENKE + * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2024 MDW - * Copyright (C) 2025 Frédéric France + * Copyright (C) 2025 Frédéric France + * Copyright (C) 2026 Alexandre Spangaro * * 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 @@ -282,11 +283,11 @@ class Export // Export Dataset Label $this->array_export_label[$i] = $module->getExportDatasetLabel($r); // Table of fields to export - $this->array_export_fields[$i] = $module->export_fields_array[$r]; + $this->array_export_fields[$i] = (isset($module->export_fields_array[$r]) ? $module->export_fields_array[$r] : []); // Table of fields to be filtered (key=field, value1=data type) Verifies that the module has filters $this->array_export_TypeFields[$i] = (isset($module->export_TypeFields_array[$r]) ? $module->export_TypeFields_array[$r] : ''); // Table of entities to export (key=field, value=entity) - $this->array_export_entities[$i] = $module->export_entities_array[$r]; + $this->array_export_entities[$i] = (isset($module->export_entities_array[$r]) ? $module->export_entities_array[$r] : ''); // Table of entities requiring to abandon DISTINCT (key=entity, valeur=field id child records) $this->array_export_dependencies[$i] = (!empty($module->export_dependencies_array[$r]) ? $module->export_dependencies_array[$r] : ''); // Table of special field operations diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 1035008c745..d9ae4219110 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -1,9 +1,10 @@ - * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2020 Ahmad Jamaly Rabib - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024-2025 MDW +/* Copyright (C) 2011 Laurent Destailleur + * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2020 Ahmad Jamaly Rabib + * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2024-2025 MDW + * Copyright (C) 2026 Alexandre Spangaro * * 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 @@ -270,11 +271,11 @@ class Import // Array of tables creator field to import (key=alias, value=creator field name) $this->array_import_tables_creator[$i] = (isset($module->import_tables_creator_array[$r]) ? $module->import_tables_creator_array[$r] : ''); // Array of fields to import (key=field, value=label) - $this->array_import_fields[$i] = $module->import_fields_array[$r]; + $this->array_import_fields[$i] = (isset($module->import_fields_array[$r]) ? $module->import_fields_array[$r] : []); // Array of hidden fields to import (key=field, value=label) $this->array_import_fieldshidden[$i] = (isset($module->import_fieldshidden_array[$r]) ? $module->import_fieldshidden_array[$r] : ''); // Array of entities to export (key=field, value=entity) - $this->array_import_entities[$i] = $module->import_entities_array[$r]; + $this->array_import_entities[$i] = (isset($module->import_entities_array[$r]) ? $module->import_entities_array[$r] : ''); // Array of aliases to export (key=field, value=alias) $this->array_import_regex[$i] = (isset($module->import_regex_array[$r]) ? $module->import_regex_array[$r] : ''); // Array of columns allowed as UPDATE options From 280fb84147e4b9a24c7e2b877455834164a2867d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2026 01:52:58 +0100 Subject: [PATCH 3/8] Clean comment --- htdocs/core/class/commonobject.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 634ef54ffde..bcc5376b9cb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8443,13 +8443,9 @@ abstract class CommonObject // $param_list_array[0] can be the name of object (Example 'User' the field is linked to). Not as taking the information from the record in ->fields found from $objectfield. - // $valparent is a string 'dataobject@module:keyoffieldinfieldsarray' to find the record field to link to. - // $valparent = $this->element.($this->module ? '@'.$this->module : '').':'.$key.$keysuffix; - // $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller. - //$objectfield = $valparent; - $objectfield = $val; // Is better than using old method $valparent + $objectfield = $val; // @phan-suppress-next-line PhanTypeMismatchArgumentNullable $out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield); From 51b66f0c17133b9838707957ce522f5c7cacc529 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 1 Feb 2026 02:01:16 +0100 Subject: [PATCH 4/8] Warning on account model (#37042) * Error on account model * Simplify rowid assignment in accountmodel.php --------- Co-authored-by: Laurent Destailleur --- htdocs/accountancy/admin/accountmodel.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index a3fc3777c8a..1cf07697fdd 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2024 Alexandre Spangaro + * Copyright (C) 2011-2026 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2024 MDW @@ -588,8 +588,7 @@ if ($resql) { 'page' => $page, 'sortfield' => $sortfield, 'sortorder' => $sortorder, - 'rowid' => (!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')), - 'code' => $obj->code, + 'rowid' => (!empty($obj->rowid) ? $obj->rowid : '') ]); // Active From b74382c7e2caf718c422473d1d75c91ddad3cd35 Mon Sep 17 00:00:00 2001 From: Jyhere Date: Sun, 1 Feb 2026 02:08:03 +0100 Subject: [PATCH 5/8] FIX: Add htmlname and selectedrate to parameters array for hook (#36998) Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.form.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f59fcbc7616..01a35b59b0a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7411,6 +7411,8 @@ class Form $hookmanager->initHooks(array('commonobject')); $info_bits == 1 ? $is_npr = 1 : $is_npr = 0; $parameters = array( + 'htmlname' => $htmlname, + 'selectedrate' => $selectedrate 'seller' => $societe_vendeuse, 'buyer' => $societe_acheteuse, 'idprod' => $idprod, From 3a67d56a4fb17e9dd43fab1fa30fccce1bab9e2c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2026 02:30:28 +0100 Subject: [PATCH 6/8] Fix CI --- 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 01a35b59b0a..a5ed2ffc9f6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7412,7 +7412,7 @@ class Form $info_bits == 1 ? $is_npr = 1 : $is_npr = 0; $parameters = array( 'htmlname' => $htmlname, - 'selectedrate' => $selectedrate + 'selectedrate' => $selectedrate, 'seller' => $societe_vendeuse, 'buyer' => $societe_acheteuse, 'idprod' => $idprod, From 4faef8f7916054cb838c1be17773b2b63221e65d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 1 Feb 2026 18:09:24 +0100 Subject: [PATCH 7/8] NEW Accountancy - Select between accrual accounting and cash accounting (#37050) --- htdocs/accountancy/admin/index.php | 41 +++++++++++++----------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 402308189dd..68b92a922ea 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2025 Alexandre Spangaro + * Copyright (C) 2013-2026 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -481,33 +481,28 @@ print '
'; // Case of the parameter ACCOUNTING_MODE +print '
'; +print ''; +print ''; -if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) { - print ''; - print ''; - print ''; +print ''; - print '
'; +print ''; +print ''; +print "\n"; +print ''; +print '\n"; +print ''; +print '\n"; - print ''; - print ''; - print "\n"; - print ''; - print '\n"; - print ''; - print '\n"; +print "
'.$langs->trans('OptionMode').'
('.$langs->trans('Default').')'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).''; +print "
'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc')).""; +print "
'.$langs->trans('OptionMode').'
('.$langs->trans('Default').')'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).''; - print "
'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc')).""; - print "
\n"; - print "\n"; - - print '
'; - print '
'; - - - print '

'; -} +print '
'; +print ''; +print '

'; // Show form main options print $formSetup->generateOutput(true); From 440050b7a83bbfd1e7d9800b4c7c65f144ca7247 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Feb 2026 15:53:41 +0100 Subject: [PATCH 8/8] Debug v23 --- htdocs/core/lib/pdf.lib.php | 4 +++- htdocs/core/tpl/formlayoutai.tpl.php | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index cdf64fdfbb7..198e93a7183 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2569,7 +2569,9 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) } elseif (empty($hidedetails) || $hidedetails > 1) { $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht); if (!empty($object->lines[$i]->situation_percent) && $object->lines[$i]->situation_percent > 0) { - $total_ht *= $object->lines[$i]->getSituationRatio(); + if (method_exists($object->lines[$i], 'getSituationRatio')) { + $total_ht *= $object->lines[$i]->getSituationRatio(); + } } $result .= price($sign * $total_ht, 0, $outputlangs); } diff --git a/htdocs/core/tpl/formlayoutai.tpl.php b/htdocs/core/tpl/formlayoutai.tpl.php index 692449b8896..5df3db0d5c5 100644 --- a/htdocs/core/tpl/formlayoutai.tpl.php +++ b/htdocs/core/tpl/formlayoutai.tpl.php @@ -78,7 +78,7 @@ if (!isset($aiprompt)) { // Init to empty string if not defined $aiprompt = ''; } // Add link to add layout -if ($showlinktolayout) { // May be set only if MAIN_EMAIL_USE_LAYOUT is set +if (!empty($showlinktolayout)) { // May be set only if MAIN_EMAIL_USE_LAYOUT is set $out .= ''; $out .= img_picto($showlinktolayoutlabel, 'layout', 'class="paddingrightonly"'); $out .= ''.$showlinktolayoutlabel.'...'; @@ -98,7 +98,7 @@ if ($showlinktolayout) { // May be set only if MAIN_EMAIL_USE_LAYOUT is set '; } // Add link to add AI content -if ($showlinktoai) { +if (!empty($showlinktoai)) { // TODO Diff between showlinktoai and htmlname ? Why not using one key only ? $out .= ''; $out .= img_picto($showlinktoailabel, 'ai', 'class="paddingrightonly"'); @@ -134,7 +134,7 @@ if ($showlinktoai) { '; } -if ($showlinktolayout) { +if (!empty($showlinktolayout)) { if (!empty($formwebsite) && is_object($formwebsite)) { $out .= $formwebsite->getContentPageTemplate($htmlname); } else { @@ -151,7 +151,7 @@ if ($showlinktolayout) { /** @var ?FormAI $formai */ -if ($showlinktoai) { +if (!empty($showlinktoai)) { if (empty($formai) || $formai instanceof FormAI) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formai.class.php'; $formai = new FormAI($db); @@ -165,7 +165,11 @@ if ($showlinktoai) { $formai->setSubstitFromObject($object, $langs); $aiprompt = make_substitutions($aiprompt, $formai->substit); } - $out .= $formai->getSectionForAIEnhancement($showlinktoai, $formmail->withaiprompt, $htmlname, $onlyenhancements, $aiprompt); + $format = ''; + if (is_object($formmail) && !empty($formmail->withaiprompt)) { + $format = $formmail->withaiprompt; + } + $out .= $formai->getSectionForAIEnhancement($showlinktoai, $format, $htmlname, $onlyenhancements, $aiprompt); } else { $out .= ''; }