';
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 8da9a94beab..4ccad75628f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -74,18 +74,25 @@ class Form
/** @var array */
public $result;
- /** @var int Number of line returned by method to generate combo select */
+ /** @var int Number of lines returned by method to generate combo select */
public $num;
// Cache arrays
+ /** @var array */
public $cache_types_paiements = array();
+ /** @var array */
public $cache_conditions_paiements = array();
+ /** @var array */
public $cache_transport_mode = array();
/** @var array */
public $cache_availability = array();
+ /** @var array */
public $cache_demand_reason = array();
+ /** @var array */
public $cache_types_fees = array();
+ /** @var array */
public $cache_vatrates = array();
+ /** @var array */
public $cache_invoice_subtype = array();
/** @var array */
public $cache_rule_for_lines_dates = array();
@@ -4755,7 +4762,7 @@ class Form
$label = $langs->trans($obj->code); // So translation key SRC_XXX will work
}
- $tmparray[$obj->rowid]['id'] = $obj->rowid;
+ $tmparray[$obj->rowid]['id'] = (int) $obj->rowid;
$tmparray[$obj->rowid]['code'] = $obj->code;
$tmparray[$obj->rowid]['label'] = $label;
$i++;
@@ -7300,7 +7307,7 @@ class Form
$obj = $this->db->fetch_object($resql);
$tmparray = array();
- $tmparray['rowid'] = $obj->rowid;
+ $tmparray['rowid'] = (int) $obj->rowid;
$tmparray['type_vat'] = ($obj->type_vat <= 0 ? 0 : $obj->type_vat); // Some version have type_vat corrupted with value -1
$tmparray['code'] = $obj->code;
$tmparray['txtva'] = $obj->taux;
@@ -7793,11 +7800,13 @@ class Form
$reduceformat = (!empty($conf->dol_optimize_smallscreen) ? 1 : 0); // Test on original $format param.
if ($reduceformat) {
$format = str_replace('%Y', '%y', $langs->transnoentitiesnoconv("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
+ $formatjslong = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // don't trust the name
$formatjs = str_replace('yyyy', 'yy', $langs->transnoentitiesnoconv("FormatDateShortJavaInput"));
$formatjquery = str_replace('yyyy', 'yy', $langs->trans("FormatDateShortJQueryInput"));
} else {
- $format = $langs->transnoentitiesnoconv("FormatDateShortInput"); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
- $formatjs = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
+ $format = $langs->transnoentitiesnoconv("FormatDateShortInput"); // FormatDateShortInput for dol_print_date is same than FormatDateShortJavaInput for javascript
+ $formatjslong = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // don't trust the name
+ $formatjs = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // FormatDateShortInput for dol_print_date is same than FormatDateShortJavaInput for javascript
$formatjquery = $langs->trans("FormatDateShortJQueryInput");
}
@@ -7810,13 +7819,12 @@ class Form
// Calendrier popup version eldy
if ($usecalendar == "eldy") {
// To have this manager working back, you must retrieve all functions showDP child found into the lib_head.js of v4 for example
- // and use load the js so the call of showDP will works.
-
+ // and load the js that contains them so the call of showDP will works.
/*
// Input area to enter date manually
$retstring .= 'trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
+ $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($formatjslong")) . '\'); "'; // FormatDateShortInput for dol_print_date is same than FormatDateShortJavaInput for javascript
$retstring .= ' autocomplete="off">';
// Icon calendar
@@ -7875,7 +7883,7 @@ class Form
$retstring .= 'automatic_activation) && is_array($objMod->automatic_activation) && isset($objMod->automatic_activation[$country_code])) {
+ if (isset($objMod->automatic_activation[$country_code])) {
activateModule($modName);
setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings');
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 2315a2e013a..b425ea09617 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -139,16 +139,16 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*/
public $rights_class;
- const URL_FOR_BLACKLISTED_MODULES = 'https://ping.dolibarr.org/modules-blacklist.txt';
+ public const URL_FOR_BLACKLISTED_MODULES = 'https://ping.dolibarr.org/modules-blacklist.txt';
- const KEY_ID = 0;
- const KEY_LABEL = 1;
- const KEY_TYPE = 2; // deprecated
- const KEY_DEFAULT = 3;
- const KEY_FIRST_LEVEL = 4;
- const KEY_SECOND_LEVEL = 5;
- const KEY_MODULE = 6;
- const KEY_ENABLED = 7;
+ public const KEY_ID = 0;
+ public const KEY_LABEL = 1;
+ public const KEY_TYPE = 2; // deprecated
+ public const KEY_DEFAULT = 3;
+ public const KEY_FIRST_LEVEL = 4;
+ public const KEY_SECOND_LEVEL = 5;
+ public const KEY_MODULE = 6;
+ public const KEY_ENABLED = 7;
/**
* @var array|int<1,1> Module menu entries (1 means the menu entries are not declared into module descriptor but are hardcoded into menu manager)
@@ -400,6 +400,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*/
public $disabled;
+ /**
+ * @var array Array [''=>'']
+ */
+ public $automatic_activation = array();
+
/**
* @var int Module is enabled globally (Multicompany support)
*/
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php
index 609443fa8f0..7148abfa637 100644
--- a/htdocs/core/modules/dons/html_cerfafr.modules.php
+++ b/htdocs/core/modules/dons/html_cerfafr.modules.php
@@ -5,7 +5,7 @@
* Copyright (C) 2012 Marcos García
* Copyright (C) 2014-2020 Alexandre Spangaro
* Copyright (C) 2015 Benoit Bruchard
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 MDW
* Copyright (C) 2025 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -172,7 +172,7 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__DONATOR_ADDRESS__', $don->address, $form);
$form = str_replace('__DONATOR_ZIP__', $don->zip, $form);
$form = str_replace('__DONATOR_TOWN__', $don->town, $form);
- $form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode, $form);
+ $form = str_replace('__PAYMENTMODE_LIB__ ', (string) $paymentmode, $form);
$form = str_replace('__NOW__', dol_print_date($now, 'day', false, $outputlangs), $form);
$form = str_replace('__DonationRef__', $outputlangs->trans("DonationRef"), $form);
$form = str_replace('__DonationTitle__', $outputlangs->trans("DonationTitle"), $form);
diff --git a/htdocs/core/modules/dons/html_generic.modules.php b/htdocs/core/modules/dons/html_generic.modules.php
index 622c8139cc0..5f7499cb2e5 100644
--- a/htdocs/core/modules/dons/html_generic.modules.php
+++ b/htdocs/core/modules/dons/html_generic.modules.php
@@ -6,7 +6,7 @@
* Copyright (C) 2014-2020 Alexandre Spangaro
* Copyright (C) 2015 Benoit Bruchard
* Copyright (C) 2015 Benjamin Neumann
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 MDW
*
* 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
@@ -97,7 +97,7 @@ class html_generic extends ModeleDon
$formclass->load_cache_types_paiements();
if ($don->mode_reglement_id) {
- $paymentmode = $formclass->cache_types_paiements[$don->mode_reglement_id]['label'];
+ $paymentmode = (string) $formclass->cache_types_paiements[$don->mode_reglement_id]['label'];
} else {
$paymentmode = '';
}
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 80e81be745a..bb9155f66b2 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -1,10 +1,11 @@
- * Copyright (C) 2012 Regis Houssin
- * Copyright (C) 2014 Marcos García
- * Copyright (C) 2016 Charlie Benke
- * Copyright (C) 2018-2025 Frédéric France
+/* Copyright (C) 2010-2012 Laurent Destailleur
+ * Copyright (C) 2012 Regis Houssin
+ * Copyright (C) 2014 Marcos García
+ * Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2018-2025 Frédéric France
* Copyright (C) 2024 MDW
+ * Copyright (C) 2025 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
@@ -344,6 +345,19 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$nbProduct = 0;
$nbService = 0;
foreach ($object->lines as $line) {
+ // Do not take into account lines of the type “deposit.”
+ $is_deposit = false;
+ if (preg_match('/^\((.*)\)$/', $line->desc, $reg)) {
+ if ($reg[1] == 'DEPOSIT') {
+ $is_deposit = true;
+ }
+ }
+
+ // If DEPOSIT, this line is completely ignored for calculations.
+ if ($is_deposit) {
+ continue;
+ }
+
// determine category of operation
if ($categoryOfOperation < 2) {
$lineProductType = $line->product_type;
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index b548cb510bf..29b1eadf415 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -13,7 +13,7 @@
* Copyright (C) 2022 Charlene Benke
* Copyright (C) 2024-2025 MDW
* Copyright (C) 2024-2025 Nick Fragoulis
- * Copyright (C) 2024 Alexandre Spangaro
+ * Copyright (C) 2024-2025 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
@@ -388,6 +388,19 @@ class pdf_crabe extends ModelePDFFactures
$this->atleastonediscount++;
}
+ // Do not take into account lines of the type “deposit.”
+ $is_deposit = false;
+ if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) {
+ if ($reg[1] == 'DEPOSIT') {
+ $is_deposit = true;
+ }
+ }
+
+ // If DEPOSIT, this line is completely ignored for calculations.
+ if ($is_deposit) {
+ continue;
+ }
+
// determine category of operation
if ($categoryOfOperation < 2) {
$lineProductType = $object->lines[$i]->product_type;
diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
index f7090067beb..3a2339b6b07 100644
--- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php
@@ -1,17 +1,17 @@
- * Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2008 Raphael Bertrand
- * Copyright (C) 2010-2014 Juanjo Menent
- * Copyright (C) 2012 Christophe Battarel
- * Copyright (C) 2012 Cédric Salvador
- * Copyright (C) 2012-2014 Raphaël Doursenaud
- * Copyright (C) 2015 Marcos Garcia
- * Copyright (C) 2017 Ferran Marcet
- * Copyright (C) 2018-2025 Frédéric France
- * Copyright (C) 2022 Anthony Berton
- * Copyright (C) 2022-2025 Alexandre Spangaro
- * Copyright (C) 2022-2024 Eric Seigne
+/* Copyright (C) 2004-2014 Laurent Destailleur
+ * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2008 Raphael Bertrand
+ * Copyright (C) 2010-2014 Juanjo Menent
+ * Copyright (C) 2012 Christophe Battarel
+ * Copyright (C) 2012 Cédric Salvador
+ * Copyright (C) 2012-2014 Raphaël Doursenaud
+ * Copyright (C) 2015 Marcos Garcia
+ * Copyright (C) 2017 Ferran Marcet
+ * Copyright (C) 2018-2025 Frédéric France
+ * Copyright (C) 2022 Anthony Berton
+ * Copyright (C) 2022-2025 Alexandre Spangaro
+ * Copyright (C) 2022-2024 Eric Seigne
* Copyright (C) 2024-2025 MDW
* Copyright (C) 2024-2025 Nick Fragoulis
*
@@ -488,6 +488,19 @@ class pdf_octopus extends ModelePDFFactures
$this->atleastonediscount++;
}
+ // Do not take into account lines of the type “deposit.”
+ $is_deposit = false;
+ if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) {
+ if ($reg[1] == 'DEPOSIT') {
+ $is_deposit = true;
+ }
+ }
+
+ // If DEPOSIT, this line is completely ignored for calculations.
+ if ($is_deposit) {
+ continue;
+ }
+
// determine category of operation
if ($categoryOfOperation < 2) {
$lineProductType = $object->lines[$i]->product_type;
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index ea7488c96a0..209ead0c0b6 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -1,17 +1,17 @@
- * Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2008 Raphael Bertrand
- * Copyright (C) 2010-2014 Juanjo Menent
- * Copyright (C) 2012 Christophe Battarel
- * Copyright (C) 2012 Cédric Salvador
- * Copyright (C) 2012-2014 Raphaël Doursenaud
- * Copyright (C) 2015 Marcos García
- * Copyright (C) 2017 Ferran Marcet
- * Copyright (C) 2018-2025 Frédéric France
+/* Copyright (C) 2004-2024 Laurent Destailleur
+ * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2008 Raphael Bertrand
+ * Copyright (C) 2010-2014 Juanjo Menent
+ * Copyright (C) 2012 Christophe Battarel
+ * Copyright (C) 2012 Cédric Salvador
+ * Copyright (C) 2012-2014 Raphaël Doursenaud
+ * Copyright (C) 2015 Marcos García
+ * Copyright (C) 2017 Ferran Marcet
+ * Copyright (C) 2018-2025 Frédéric France
* Copyright (C) 2018-2024 Anthony Berton
- * Copyright (C) 2022-2024 Alexandre Spangaro
- * Copyright (C) 2024-2025 MDW
+ * Copyright (C) 2022-2025 Alexandre Spangaro
+ * Copyright (C) 2024-2025 MDW
* Copyright (C) 2024-2025 Nick Fragoulis
* Copyright (C) 2024 Franck Moreau
*
@@ -419,6 +419,19 @@ class pdf_sponge extends ModelePDFFactures
$this->atleastonediscount++;
}
+ // Do not take into account lines of the type “deposit.”
+ $is_deposit = false;
+ if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) {
+ if ($reg[1] == 'DEPOSIT') {
+ $is_deposit = true;
+ }
+ }
+
+ // If DEPOSIT, this line is completely ignored for calculations.
+ if ($is_deposit) {
+ continue;
+ }
+
// determine category of operation
if ($categoryOfOperation < 2) {
$lineProductType = $object->lines[$i]->product_type;
diff --git a/htdocs/core/tpl/subtotal_edit.tpl.php b/htdocs/core/tpl/subtotal_edit.tpl.php
index ddae4132e4c..47f9cbdd373 100644
--- a/htdocs/core/tpl/subtotal_edit.tpl.php
+++ b/htdocs/core/tpl/subtotal_edit.tpl.php
@@ -141,7 +141,7 @@ if (getDolGlobalString('PRODUCT_USE_UNITS')) {
foreach ($line_options as $key => $value) {
if (in_array($line_type, $value['type'])) {
print '
';
- print '
';
}
diff --git a/htdocs/core/tpl/subtotal_view.tpl.php b/htdocs/core/tpl/subtotal_view.tpl.php
index 4600e760bce..de0138aa2fc 100644
--- a/htdocs/core/tpl/subtotal_view.tpl.php
+++ b/htdocs/core/tpl/subtotal_view.tpl.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2014-2017 Laurent Destailleur
* Copyright (C) 2024 MDW
* Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2025 Charlene Benke
*
* 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
@@ -149,13 +150,13 @@ if ($line->qty > 0) { ?>
// Handling colspan if margin module is enabled
if (!empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande')) && isModEnabled('margin') && empty($user->socid)) {
if ($user->hasRight('margins', 'creer')) {
- print '