From 5a53c19ad570d3743f5a0ec66f1f2c34dcbb0a64 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Wed, 15 Oct 2025 11:30:47 +0200 Subject: [PATCH 01/35] fix css badge pill definition (#35764) --- htdocs/theme/eldy/badges.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 2d5783d3ecf..aefc0f7d2d6 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -39,12 +39,19 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { } } -.badge-pill, .tabs .badge { +.tabs .badge { padding-right: .5em; padding-left: .5em; border-radius: 0.25rem; } +.badge-pill{ + /* Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding). */ + padding-right: .8em; + padding-left: 0.8em; + border-radius: 0.5rem; +} + .badge-dot { padding: 0; border-radius: 50%; From c6dd95e6d280da44d05e591b4e4d26e3f0ee0257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 17 Oct 2025 00:45:34 +0200 Subject: [PATCH 02/35] fix upload in doc_generic_reception_odt.modules.php (#35794) --- .../modules/reception/doc/doc_generic_reception_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 667716cc5bf..08c8a57f016 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -102,7 +102,7 @@ class doc_generic_reception_odt extends ModelePdfReception $form = new Form($this->db); $texte = $this->description.".
\n"; - $texte .= '
'; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; From c4207d7b4560809cf7e54f4bdb5b9ae077247001 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 02:00:52 +0200 Subject: [PATCH 03/35] FIX #35782 --- htdocs/core/boxes/box_last_modified_ticket.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index 7016d62449c..4c425102210 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -83,9 +83,9 @@ class box_last_modified_ticket extends ModeleBoxes $sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label"; $sql .= ", s.nom as company_name, s.email as socemail, s.client, s.fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code AND type.entity = t.entity"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code AND category.entity = t.entity"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code AND severity.entity = t.entity"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=t.fk_soc"; $sql .= " WHERE t.entity IN (".getEntity('ticket').')'; From a504be02581b3df6e55e7fbaf248d1761922e7e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 02:03:37 +0200 Subject: [PATCH 04/35] FIX #35780 --- htdocs/ticket/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index b3e5b8cb332..cb868ecb4c7 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -337,9 +337,9 @@ if ($user->hasRight('ticket', 'read')) { $sql .= " category.code as category_code, category.label as category_label,"; $sql .= " severity.code as severity_code, severity.label as severity_label"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code AND type.entity = t.entity"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code AND category.entity = t.entity"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code AND severity.entity = t.entity"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } From e801a7602cbc466224556ca4f7de6c702b55326e Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Fri, 17 Oct 2025 02:28:38 +0200 Subject: [PATCH 05/35] FIX day of ticket on takePOS. Backport 6abdb6e. (#35745) --- htdocs/takepos/invoice.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 29601c95dcf..17470c59b45 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -490,8 +490,14 @@ if (empty($reshook)) { if (($action == "addline" || $action == "freezone") && $placeid == 0) { $invoice->socid = getDolGlobalString($constforcompanyid); + $dolnowtzuserrel = dol_now('tzuserrel'); // If user is 02 january 22:00, we want to store '02 january' + $monthuser = dol_print_date($dolnowtzuserrel, '%m', 'gmt'); + $dayuser = dol_print_date($dolnowtzuserrel, '%d', 'gmt'); + $yearuser = dol_print_date($dolnowtzuserrel, '%Y', 'gmt'); + $dateinvoice = dol_mktime(0, 0, 0, (int) $monthuser, (int) $dayuser, (int) $yearuser, 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $invoice->date = dol_get_first_hour(dol_now('tzuserrel')); // Invoice::create() needs a date with no hours + $invoice->date = $dateinvoice; // Invoice::create() needs a date with no hours $invoice->module_source = 'takepos'; $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; From 0fb8688b7ccc5d8f85174deeee3a31b1e3b1950c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 15:10:33 +0200 Subject: [PATCH 06/35] FIX clone of cron tasks --- htdocs/cron/class/cronjob.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index cabe14be219..84cd76766e9 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -937,6 +937,7 @@ class Cronjob extends CommonObject $object->datelastrun = null; $object->lastresult = ''; $object->datelastresult = null; + $object->datenextrun = dol_now(); $object->lastoutput = ''; $object->nbrun = 0; From 0d1b1703ccefc12cd4198e4264f73e98c899e9c5 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:15:39 +0200 Subject: [PATCH 07/35] FIX: missing prospect/customer category translation (#35814) --- htdocs/langs/en_US/companies.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 15e6d8e0280..ac22e6133ee 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -256,6 +256,7 @@ VATIntraSyntaxIsValid=Syntax is valid VATPaymentFrequency=VAT payment frequency ProspectCustomer=Prospect / Customer Prospect=Prospect +ProspectsOrCustomers=Prospects or customers CustomerCard=Customer Card Customer=Customer CustomerRelativeDiscount=Relative customer discount From da32ca92282764ab6f6035709380bd39d5e935bd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 17 Oct 2025 18:11:29 +0200 Subject: [PATCH 08/35] FIX wrong entity alias (#35821) --- htdocs/comm/propal/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b52e64f0637..e15f131b167 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -586,7 +586,7 @@ $sql .= " typent.code as typent_code,"; $sql .= " ava.rowid as availability,"; $sql .= " country.code as country_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; -$sql .= ' p.rowid, p.entity as propal_entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.import_key, p.fk_user_author, p.datep as dp, p.fin_validite as dfv, p.date_livraison as ddelivery,'; +$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.import_key, p.fk_user_author, p.datep as dp, p.fin_validite as dfv, p.date_livraison as ddelivery,'; $sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,'; $sql .= ' p.datec as date_creation, p.tms as date_modification, p.date_cloture as date_cloture,'; $sql .= ' p.date_signature as dsignature,'; @@ -1890,7 +1890,7 @@ while ($i < $imaxinloop) { // Other picto tool print ''; $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->propal->multidir_output[$obj->propal_entity].'/'.dol_sanitizeFileName($obj->ref); + $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($object->element, $filename, $filedir); print ''; From 3fb0dddd655998c2066ae6b36cc17f94883da1c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 18:39:42 +0200 Subject: [PATCH 09/35] Fix default status of column --- htdocs/product/price_suppliers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/price_suppliers.php b/htdocs/product/price_suppliers.php index 6c5884dd55f..21cd640169c 100644 --- a/htdocs/product/price_suppliers.php +++ b/htdocs/product/price_suppliers.php @@ -973,10 +973,10 @@ if ($id > 0 || $ref) { 'pfp.fk_barcode_type' => array('label' => $langs->trans("BarcodeType"), 'enabled' => (string) (int) isModEnabled('barcode'), 'checked' => '0', 'position' => 15), 'pfp.barcode' => array('label' => $langs->trans("BarcodeValue"), 'enabled' => (string) (int) isModEnabled('barcode'), 'checked' => '0', 'position' => 16), 'pfp.packaging' => array('label' => $langs->trans("PackagingForThisProduct"), 'enabled' => (string) getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked' => '0', 'position' => 17), - 'pfp.status' => array('label' => $langs->trans("Status"), 'enabled' => '1', 'checked' => '0', 'position' => 40), - 'pfp.tms' => array('label' => $langs->trans("DateModification"), 'enabled' => '1', 'checked' => '1', 'position' => 50), 'pfp.price' => array('label' => $langs->trans("PriceQtyMinHT"), 'enabled' => '1', 'checked' => '1', 'position' => 60), 'pfp.multicurrency_price' => array('label' => $langs->trans("PriceQtyMinHTCurrency"), 'enabled' => (string) (int) isModEnabled('multicurrency'), 'checked' => '1', 'position' => 70), + 'pfp.tms' => array('label' => $langs->trans("DateModification"), 'enabled' => '1', 'checked' => '-1', 'position' => 50), + 'pfp.status' => array('label' => $langs->trans("Status"), 'enabled' => '1', 'checked' => '0', 'position' => 40), ); // fetch optionals attributes and labels From 6691441468a154ae169ece57c8820d4d6c8369be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 18:43:53 +0200 Subject: [PATCH 10/35] Fix position --- htdocs/product/price_suppliers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/price_suppliers.php b/htdocs/product/price_suppliers.php index 21cd640169c..7725ebc4bd6 100644 --- a/htdocs/product/price_suppliers.php +++ b/htdocs/product/price_suppliers.php @@ -975,8 +975,8 @@ if ($id > 0 || $ref) { 'pfp.packaging' => array('label' => $langs->trans("PackagingForThisProduct"), 'enabled' => (string) getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked' => '0', 'position' => 17), 'pfp.price' => array('label' => $langs->trans("PriceQtyMinHT"), 'enabled' => '1', 'checked' => '1', 'position' => 60), 'pfp.multicurrency_price' => array('label' => $langs->trans("PriceQtyMinHTCurrency"), 'enabled' => (string) (int) isModEnabled('multicurrency'), 'checked' => '1', 'position' => 70), - 'pfp.tms' => array('label' => $langs->trans("DateModification"), 'enabled' => '1', 'checked' => '-1', 'position' => 50), - 'pfp.status' => array('label' => $langs->trans("Status"), 'enabled' => '1', 'checked' => '0', 'position' => 40), + 'pfp.tms' => array('label' => $langs->trans("DateModification"), 'enabled' => '1', 'checked' => '-1', 'position' => 80), + 'pfp.status' => array('label' => $langs->trans("Status"), 'enabled' => '1', 'checked' => '0', 'position' => 200), ); // fetch optionals attributes and labels From f711fe9900f6ff178c1c34e496dd67d15aad037e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 18:59:32 +0200 Subject: [PATCH 11/35] FIX Must show unit price when price is not for quantity 1 --- 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 ff9243ccafb..e69a0eb0bdc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4168,7 +4168,7 @@ class Form $outvallabel .= ' ' . $langs->transnoentities("Units"); } - if ($objp->quantity > 1) { + if ($objp->quantity != 1) { $optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding $outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding } From 74d38106b9a0b3bb01cdce321e2880a6b41a7011 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 19:28:02 +0200 Subject: [PATCH 12/35] Column must be shown by default if option PRODUCT_USE_SUPPLIER_PACKAGING on --- htdocs/product/price_suppliers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/price_suppliers.php b/htdocs/product/price_suppliers.php index 7725ebc4bd6..43b0805e5e7 100644 --- a/htdocs/product/price_suppliers.php +++ b/htdocs/product/price_suppliers.php @@ -972,7 +972,7 @@ if ($id > 0 || $ref) { 'pfp.supplier_reputation' => array('label' => $langs->trans("ReputationForThisProduct"), 'checked' => '-1', 'position' => 14), 'pfp.fk_barcode_type' => array('label' => $langs->trans("BarcodeType"), 'enabled' => (string) (int) isModEnabled('barcode'), 'checked' => '0', 'position' => 15), 'pfp.barcode' => array('label' => $langs->trans("BarcodeValue"), 'enabled' => (string) (int) isModEnabled('barcode'), 'checked' => '0', 'position' => 16), - 'pfp.packaging' => array('label' => $langs->trans("PackagingForThisProduct"), 'enabled' => (string) getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked' => '0', 'position' => 17), + 'pfp.packaging' => array('label' => $langs->trans("PackagingForThisProduct"), 'enabled' => (string) getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked' => (getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING') ? '1' : '0'), 'position' => 17), 'pfp.price' => array('label' => $langs->trans("PriceQtyMinHT"), 'enabled' => '1', 'checked' => '1', 'position' => 60), 'pfp.multicurrency_price' => array('label' => $langs->trans("PriceQtyMinHTCurrency"), 'enabled' => (string) (int) isModEnabled('multicurrency'), 'checked' => '1', 'position' => 70), 'pfp.tms' => array('label' => $langs->trans("DateModification"), 'enabled' => '1', 'checked' => '-1', 'position' => 80), From 17e78c99a2744f04fc0c3be8009a74d2e4304b3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 23:50:31 +0200 Subject: [PATCH 13/35] Fix responsive --- htdocs/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 80bb6689003..6dcdbcf1c07 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1819,7 +1819,7 @@ if (!empty($arrayfields['country.code_iso']['checked'])) { } // Company type if (!empty($arrayfields['typent.code']['checked'])) { - print ''; + print ''; print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); print ''; } @@ -2560,7 +2560,7 @@ while ($i < $imaxinloop) { // Country if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; + print ''; $tmparray = getCountry($obj->fk_pays, 'all'); print $tmparray['label']; print ''; From ea2543e9e431568d80dcd68db517b387cd5bbb97 Mon Sep 17 00:00:00 2001 From: Guido Schratzer Date: Sat, 18 Oct 2025 12:54:09 +0300 Subject: [PATCH 14/35] FIX #35766: Update buying price INT Float (#35769) * FIX #35766: Update buying price INT Float loose Decimals . * Fix: keep fk_product_fournisseur_price as int; treat buying price as float (no truncation) [#35766] * Updated per feedback: keep fk_product_fournisseur_price as ?int (rowid) and as float. Adjusted FactureRec::updateline PHPDoc to ?int and float|'' (model still normalizes via price2num). Tested on a recurring line: decimals preserved, FK stored as int, CI green. Minor adjustments before v22 backport * Delete .hooktest * Delete dev/tools/pre-commit/README.md * Delete test/phpunit/phpunit.xml --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/card-rec.php | 2 +- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 40380d6152f..3b4182dc013 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1042,7 +1042,7 @@ if (empty($reshook)) { $date_start_fill, $date_end_fill, (int) $fournprice, - (int) $buyingprice, + (float) $buyingprice, (int) $fk_parent_line ); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 61a923cdb4e..e8ea7929df0 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1308,7 +1308,7 @@ class FactureRec extends CommonInvoice $sql .= ", total_ttc='".price2num($total_ttc)."'"; $sql .= ", date_start_fill=".((int) $date_start_fill); $sql .= ", date_end_fill=".((int) $date_end_fill); - $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : 'null'); + $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? (int) $fk_fournprice : 'null'); $sql .= ", buy_price_ht=".($pa_ht ? price2num($pa_ht) : 0); $sql .= ", info_bits=".((int) $info_bits); $sql .= ", rang=".((int) $rang); From 1b4afcea4b203ef2a0322486ee3153ffde9a4ab0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2025 11:53:37 +0200 Subject: [PATCH 15/35] Ignore file to avoid commiting it --- test/phpunit/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/phpunit/.gitignore b/test/phpunit/.gitignore index 647a82afb84..41e800ce46f 100644 --- a/test/phpunit/.gitignore +++ b/test/phpunit/.gitignore @@ -1 +1,2 @@ /DemoTest.php +/phpunit.xml From 3a8bab63cda320af7de12a8466f510714f648fcc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 18:35:16 +0200 Subject: [PATCH 16/35] Trans --- htdocs/langs/en_US/products.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index e376eb3b320..2c5888a886d 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -346,10 +346,10 @@ PossibleValues=Possible values GoOnMenuToCreateVairants=Go on menu %s - %s to prepare attribute variants (like colors, size, ...) UseProductFournDesc=Add a feature to define the product description defined by the vendors (for each vendor reference) in addition to the description for customers ProductSupplierDescription=Vendor description for the product -UseProductSupplierPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a vendor documents, recalculate quantities and purchase prices according to the higher multiple set on the purchase prices of a product) +UseProductSupplierPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a vendor documents, the quantity is adjusted to match the nearest higher multiple of the "packaging" value of the product) PackagingForThisProduct=Packaging of quantities PackagingForThisProductDesc=You will automatically purchase a multiple of this quantity. -UseProductCustomerPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a customer documents, recalculate quantities and sale prices according to the higher multiple set on the sale prices of a product) +UseProductCustomerPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a customer documents, the quantity is adjusted to match the nearest higher multiple of the "packaging" value of the product) PackagingForThisProductSell=Packaging of quantities (sale) PackagingForThisProductSellDesc=You will automatically sell a multiple of this quantity. QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging From 18c29d0e40f4440330cf811c1ee15bbbe120a7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2025 19:12:01 +0200 Subject: [PATCH 17/35] fix tva can be sometimes string instead float (#35835) --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/card.php | 4 ++-- htdocs/commande/class/commande.class.php | 4 ++-- htdocs/contrat/class/contrat.class.php | 6 +++--- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- htdocs/fourn/commande/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- htdocs/supplier_proposal/class/supplier_proposal.class.php | 4 ++-- phpstan.neon.dist | 1 + 10 files changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 398dadcb022..9b66e1f8bf9 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -607,7 +607,7 @@ class Propal extends CommonObject * @param string $desc Description of line * @param float $pu_ht Unit price * @param float $qty Quantity - * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) * @param int $fk_product Product/Service ID predefined diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 94c3ab4c728..a90c37cc6aa 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -782,7 +782,7 @@ if (empty($reshook)) { if ($line->special_code == SUBTOTALS_SPECIAL_CODE) { continue; } - $result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, (float) $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + $result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); } } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('remiseforalllines', 'alpha') !== '' && $usercancreate) { // Define remise_percent @@ -1698,7 +1698,7 @@ if (empty($reshook)) { } } - $result = $object->updateline(GETPOSTINT('lineid'), $description, (float) $pu, (float) $qty, $remise_percent, (float) $vat_rate, $localtax1_rate, $localtax2_rate, $price_base_type, $info_bits, $date_start, $date_end, $type, GETPOSTINT('fk_parent_line'), 0, (int) $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOSTINT('units'), (float) $pu_ht_devise); + $result = $object->updateline(GETPOSTINT('lineid'), $description, (float) $pu, (float) $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $price_base_type, $info_bits, $date_start, $date_end, $type, GETPOSTINT('fk_parent_line'), 0, (int) $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOSTINT('units'), (float) $pu_ht_devise); if ($result >= 0) { if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6f0b7d79b04..721f3d14a74 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1538,7 +1538,7 @@ class Commande extends CommonOrder * @param string $desc Description of line * @param float $pu_ht Unit price (without tax) * @param float $qty Quantite - * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) * @param int $fk_product Id of product @@ -3101,7 +3101,7 @@ class Commande extends CommonOrder * @param float $pu Unit price * @param float $qty Quantity * @param float $remise_percent Percent of discount - * @param float $txtva Taux TVA + * @param float|string $txtva VAT Rate (Can be '8.5', '8.5 (ABC)') * @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax2 Local tax 2 rate * @param string $price_base_type HT or TTC diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 7daea4f4a74..7fc9dd45ed5 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1463,7 +1463,7 @@ class Contrat extends CommonObject * @param string $desc Description of line * @param float $pu_ht Unit price net * @param float $qty Quantity - * @param float $txtva Vat rate + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax2 Local tax 2 rate * @param int $fk_product Id produit @@ -1474,8 +1474,8 @@ class Contrat extends CommonObject * @param float $pu_ttc Prix unitaire TTC * @param int $info_bits Bits of type of lines * @param int $fk_fournprice Fourn price id - * @param float|string $pa_ht Buying price HT (Can be '' to keep AWP unchanged or a float value) - * @param array $array_options extrafields array + * @param float|string $pa_ht Buying price HT (Can be '' to keep AWP unchanged or a float value) + * @param array $array_options extrafields array * @param ?int $fk_unit Code of the unit to use. Null to use the default one * @param int $rang Position * @return int Return integer <0 if KO, >0 if OK diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e270cb5a2bb..50f13ac254e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1989,7 +1989,7 @@ class CommandeFournisseur extends CommonOrder * @param string $desc Description * @param float $pu_ht Unit price (used if $price_base_type is 'HT') * @param float $qty Quantity - * @param float $txtva VAT Rate + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Localtax1 tax * @param float $txlocaltax2 Localtax2 tax * @param int $fk_product Id product diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 9f7c4eb523b..77bd73fa730 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2093,8 +2093,8 @@ class FactureFournisseur extends CommonInvoice * already have the right value (the caller has to manage the multilanguage). * * @param string $desc Description of the line - * @param float $pu Unit price (HT or TTC according to price_base_type, > 0 even for credit note) - * @param float $txtva Force Vat rate to use, -1 for auto. + * @param float $pu Unit price (HT or TTC according to price_base_type, > 0 even for credit note) + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 LocalTax1 Rate * @param float $txlocaltax2 LocalTax2 Rate * @param float $qty Quantity diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 12bcabce402..f6e41fd9535 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -668,7 +668,7 @@ if (empty($reshook)) { $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'CU'); - $result = $object->addline($desc, (float) $pu_ht, (float) $qty, (float) $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, (float) $pu_ttc, $type, 0, 0, $date_start, $date_end, $array_options, $fk_unit, (float) $pu_ht_devise); + $result = $object->addline($desc, (float) $pu_ht, (float) $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, $ref_supplier, $remise_percent, $price_base_type, (float) $pu_ttc, $type, 0, 0, $date_start, $date_end, $array_options, $fk_unit, (float) $pu_ht_devise); } //print "xx".$tva_tx; exit; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 1530689ddf5..b404dc0dbb0 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -872,7 +872,7 @@ if (empty($reshook)) { $desc, (float) $pu_ht, (float) $qty, - (float) $tva_tx, + $tva_tx, // don't cast to float $localtax1_tx, $localtax2_tx, $idprod, diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 80944951b8c..25728d6a3ff 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -419,7 +419,7 @@ class SupplierProposal extends CommonObject * @param string $desc Description de la ligne * @param float $pu_ht Prix unitaire * @param float $qty Quantite - * @param float $txtva Taux de tva + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax2 Local tax 2 rate * @param int $fk_product Product/Service ID predefined @@ -707,7 +707,7 @@ class SupplierProposal extends CommonObject * @param float $pu Unit price (HT or TTC depending on price_base_type) * @param float $qty Quantity * @param float $remise_percent Discount on line - * @param float $txtva VAT rate + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax2 Local tax 2 rate * @param string $desc Description diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 362fcd5f0fd..80a2261dc78 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,7 @@ includes: - dev/build/phpstan/phpstan-baseline.neon parameters: + phpVersion: 80200 # PHP 8.2 tmpDir: ./.github/tmp parallel: # Commented some of the settings, reminding the defaults: From 8e43cea541b3d1b959f6129819508731747afbf1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2025 14:19:58 +0200 Subject: [PATCH 18/35] css --- htdocs/admin/modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index bd4ab9fde89..fd658e57e91 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -776,7 +776,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter .= ''; if ($search_keyword || ($search_nature && $search_nature != '-1') || ($search_version && $search_version != '-1') || ($search_status && $search_status != '-1')) { $moreforfilter .= ' '; - $moreforfilter .= ''; + $moreforfilter .= ''; } $moreforfilter .= ''; $moreforfilter .= ''; From ab6aae51dd8100cf25bd18f56122f04457c5a462 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2025 23:42:20 +0200 Subject: [PATCH 19/35] Allow boolean on yn() --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b3660bfe683..6abd5e1b3e4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8478,7 +8478,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id /** * Return yes or no in current language * - * @param int<0, 1>|'yes'|'true'|'no'|'false' $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false') + * @param boolean|int<0, 1>|'yes'|'true'|'no'|'false' $yesno Value to test (true, 1, 'yes', 'true' or false, 0, 'no', 'false') * @param integer|string $format 1=Yes/No, 0=yes/no, 2=Disabled/enabled checkbox, 3=Disabled/enabled checkbox + Yes/No, 4 or Text=Use picto * @param int $color 0=texte only, 1=Text is formatted with a color font style ('ok' or 'error'), 2=Text is formatted with 'ok' color. * @return string HTML string @@ -8489,7 +8489,7 @@ function yn($yesno, $format = 1, $color = 0) $result = 'unknown'; $classname = ''; - if ($yesno == 1 || (isset($yesno) && (strtolower($yesno) == 'yes' || strtolower($yesno) == 'true'))) { // To set to 'no' before the test because of the '== 0' + if ($yesno === true || (int) $yesno == 1 || (isset($yesno) && (strtolower($yesno) == 'yes' || strtolower($yesno) == 'true'))) { // To set to 'no' before the test because of the '== 0' $result = $langs->trans('yes'); if ($format == 1 || $format == 3) { $result = $langs->trans("Yes"); @@ -8505,7 +8505,7 @@ function yn($yesno, $format = 1, $color = 0) } $classname = 'ok'; - } elseif ($yesno == 0 || strtolower($yesno) == 'no' || strtolower($yesno) == 'false') { + } else { $result = $langs->trans("no"); if ($format == 1 || $format == 3) { $result = $langs->trans("No"); From 294309dbd4823e7b4f98f96c9d9f8a8c502edc1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2025 23:48:37 +0200 Subject: [PATCH 20/35] Fix CI --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 7997bcbbd14..5e388c26c16 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1449,7 +1449,7 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { } else { $menus[$r++] = array('title' => '
'.$langs->trans("PrintTicket").'
', 'action' => 'TakeposPrinting(placeid);'); } - } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { + } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { // @phpstan-ignore-line // Button Print Receipt on special printer $menus[$r++] = array('title' => '
'.$langs->trans("PrintTicket").'
', 'action' => 'DolibarrTakeposPrinting(placeid);'); } else { From 9ee8006f178395284592ba067df6d1cc51d5a2f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2025 23:50:32 +0200 Subject: [PATCH 21/35] Fix CI --- htdocs/takepos/admin/terminal.php | 2 +- htdocs/takepos/invoice.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 245349eb870..b18800d8792 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -458,7 +458,7 @@ if (isModEnabled('receiptprinter')) { print ' ('.$langs->trans("MainPrinterToUseMore").')'; print ''; print ''; - if (!$customprinterallowed) { + if (!$customprinterallowed) { // @phpstan-ignore-line print ''.$langs->trans("NotAvailableForCountryWhenModuleIsOn", $mysoc->country_code, $langs->transnoentitiesnoconv('Module3200Name')).''; } else { print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$terminal), 1); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 403e7cdcd23..ff79d9a72a0 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1331,7 +1331,7 @@ if (empty($reshook)) { } else { $sectionwithinvoicelink .= ' '; } - } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { + } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { // @phpstan-ignore-line // If we set to use a specific receipt printer $sectionwithinvoicelink .= ' '; } else { From 1f655488361cdb644adabd550dc7f1052927cc96 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:53:07 +0200 Subject: [PATCH 22/35] FIX: notifications: correctly report email delivery errors (#35864) --- htdocs/core/class/notify.class.php | 12 ++++++++++++ ...terface_50_modNotification_Notification.class.php | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index a4511447af0..f10ff048d41 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -669,6 +669,12 @@ class Notify 'notification' ); + if (! empty($mailfile->error) || ! empty($mailfile->errors)) { + $this->error = $mailfile->error; + $this->errors = $mailfile->errors; + return -1; + } + if ($mailfile->sendfile()) { if ($obj->type_target == 'touserid') { $sql = "INSERT INTO ".$this->db->prefix()."notify (daten, fk_action, fk_soc, fk_user, type, objet_type, type_target, objet_id, email)"; @@ -933,6 +939,12 @@ class Notify 'notification' ); + if (! empty($mailfile->error) || ! empty($mailfile->errors)) { + $this->error = $mailfile->error; + $this->errors = $mailfile->errors; + return -1; + } + if ($mailfile->sendfile()) { $sql = "INSERT INTO ".$this->db->prefix()."notify (daten, fk_action, fk_soc, fk_contact, type, type_target, objet_type, objet_id, email)"; $sql .= " VALUES ('".$this->db->idate(dol_now())."', ".((int) $notifcodedefid).", ".($object->socid > 0 ? ((int) $object->socid) : 'null').", null, 'email', 'tofixedemail', '".$this->db->escape($object_type)."', ".((int) $object->id).", '".$this->db->escape($conf->global->$param)."')"; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index f25aabee871..745a5637c36 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -77,9 +77,13 @@ class InterfaceNotification extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '".$action."' launched by ".__FILE__.". id=".$object->id); $notify = new Notify($this->db); - $notify->send($action, $object); + $result = $notify->send($action, $object); - return 1; + if ($result < 0) { + $this->errors = array_merge($this->errors, empty($notify->error) ? array() : array($notify->error), empty($notify->errors) ? array() : $notify->errors); + } + + return $result; } From b8f8e2b785b33490a171dad9e53fae17cee0c776 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 20 Oct 2025 23:54:00 +0200 Subject: [PATCH 23/35] FIX missing entity filter (#35857) --- htdocs/societe/societecontact.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 7ac9444a0f1..acacc0b4ade 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -241,7 +241,8 @@ if ($id > 0 || !empty($ref)) { $sql .= " t.libelle as type_label, t.subscription"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; $sql .= ", ".MAIN_DB_PREFIX."adherent_type as t"; - $sql .= " WHERE d.fk_soc = ".((int) $id); + $sql .= " WHERE d.entity IN (".getEntity('member').")"; + $sql .= " AND d.fk_soc = ".((int) $id); $sql .= " AND d.fk_adherent_type = t.rowid"; dol_syslog("get list sql=".$sql); From 655286f3b3380cfb428a6c0bbb996b866bba2617 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2025 23:55:59 +0200 Subject: [PATCH 24/35] Fix CI --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 5e388c26c16..6edb5adef26 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1343,7 +1343,7 @@ if (!getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) { trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice")), null, 'errors'); } From 0cb46797573fbbe567558e5b93dfdb292b3eb57b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Oct 2025 00:05:22 +0200 Subject: [PATCH 25/35] Fix CI --- htdocs/blockedlog/class/blockedlog.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 4b568428fb4..e4d888a2879 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -94,9 +94,9 @@ class BlockedLog public $linktype = ''; /** - * @var string $linkref + * @var string $linktoref */ - public $linkref = ''; + public $linktoref = ''; /** * Object element From 56bcd57fc62ff96c9a4ba5e67157178cbc853ceb Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Tue, 21 Oct 2025 00:36:44 +0200 Subject: [PATCH 26/35] QUAL: polishing up the API's for usergroups (#35854) * note_private=note + cleaning json output when getting a usergroup * better comment text --------- Co-authored-by: Jon Bendtsen --- htdocs/user/class/api_users.class.php | 105 +++++++++++++++++++++++++- htdocs/user/class/usergroup.class.php | 1 + 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 8d8678fe456..0528d43a504 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -763,7 +763,7 @@ class Users extends DolibarrApi throw new RestException(404, 'Group not found'); } - return $this->_cleanObjectDatas($group_static); + return $this->_cleanUserGroup($group_static); } /** @@ -1148,6 +1148,109 @@ class Users extends DolibarrApi return $object; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Clean sensible usergroup object datas + * + * @param Object $object Object to clean + * @return Object Object with cleaned properties + */ + private function _cleanUserGroup($object) + { + // phpcs:enable + $object = parent::_cleanObjectDatas($object); + + unset($object->actiontypecode); + unset($object->all_permissions_are_loaded); + unset($object->array_languages); + unset($object->array_options); + unset($object->barcode_type_coder); + unset($object->barcode_type); + unset($object->canvas); + unset($object->civility_code); + unset($object->civility_id); + unset($object->clicktodial_loaded); + unset($object->cond_reglement_id); + unset($object->cond_reglement_supplier_id); + unset($object->contact_id); + unset($object->contacts_ids_internal); + unset($object->contacts_ids); + unset($object->country_code); + unset($object->country_id); + unset($object->date_cloture); + unset($object->date_creation); + unset($object->date_modification); + unset($object->date_validation); + unset($object->default_values); + unset($object->demand_reason_id); + unset($object->deposit_percent); + unset($object->extraparams); + unset($object->firstname); + unset($object->fk_account); + unset($object->fk_delivery_address); + unset($object->fk_incoterms); + unset($object->fk_multicurrency); + unset($object->fk_project); + unset($object->fk_user_creat); + unset($object->fk_user_modif); + unset($object->globalgroup); + unset($object->import_key); + unset($object->last_main_doc); + unset($object->lastname); + unset($object->lastsearch_values_tmp); + unset($object->lastsearch_values); + unset($object->ldap_sid); + unset($object->libelle_incoterms); + unset($object->lines); + unset($object->linkedObjectsIds); + unset($object->location_incoterms); + unset($object->members); + unset($object->mode_reglement_id); + unset($object->module); + unset($object->multicurrency_code); + unset($object->multicurrency_total_ht); + unset($object->multicurrency_total_localtax1); + unset($object->multicurrency_total_localtax2); + unset($object->multicurrency_total_ttc); + unset($object->multicurrency_total_tva); + unset($object->multicurrency_tx); + unset($object->nb_rights); + unset($object->nb_users); + unset($object->origin_id); + unset($object->origin_type); + unset($object->product); + unset($object->ref_ext); + unset($object->ref); + unset($object->region_id); + unset($object->retained_warranty_fk_cond_reglement); + unset($object->rights); + unset($object->search_sid); + unset($object->shipping_method_id); + unset($object->shipping_method); + unset($object->specimen); + unset($object->state_id); + unset($object->status); + unset($object->statut); + unset($object->total_ht); + unset($object->total_localtax1); + unset($object->total_localtax2); + unset($object->total_ttc); + unset($object->total_tva); + unset($object->totalpaid_multicurrency); + unset($object->totalpaid); + unset($object->transport_mode_id); + unset($object->TRIGGER_PREFIX); + unset($object->user_closing_id); + unset($object->user_creation_id); + unset($object->user_modification_id); + unset($object->user_validation_id); + unset($object->user); + unset($object->usergroup_entity); + unset($object->warehouse_id); + + return $object; + } + /** * Clean sensible user group list datas * diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 11eced74db7..0c18ad04a42 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -178,6 +178,7 @@ class UserGroup extends CommonObject } $this->name = $this->nom; // For compatibility with field name + $this->note_private = $this->note; // For compatibility with old field note if ($result) { if ($load_members) { From 7d01503c462820cee66c7b888d3a528fcd778757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Oct 2025 01:03:55 +0200 Subject: [PATCH 27/35] clean code (#35856) * fix CI * fix * fix --------- Co-authored-by: Laurent Destailleur --- htdocs/adherents/index.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 7b6c8c704a3..1b9358901bd 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -127,13 +127,14 @@ if ($conf->use_javascript_ajax) { } } - $dataseries = array(); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']); // Draft, not yet validated - $dataseries[] = array($langs->transnoentitiesnoconv("WaitingSubscription"), $sumMembers['total']['members_pending']); - $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), $sumMembers['total']['members_uptodate']); - $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), $sumMembers['total']['members_expired']); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']); + $dataseries = [ + [$langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']], // Draft, not yet validated + [$langs->transnoentitiesnoconv("WaitingSubscription"), $sumMembers['total']['members_pending']], + [$langs->transnoentitiesnoconv("UpToDate"), $sumMembers['total']['members_uptodate']], + [$langs->transnoentitiesnoconv("OutOfDate"), $sumMembers['total']['members_expired']], + [$langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']], + [$langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']], + ]; /** * @var string $badgeStatus0 From 894e73e9cffa31a064c81374c323c81026ddcd07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Oct 2025 01:04:53 +0200 Subject: [PATCH 28/35] add new elements properties magic (#35861) * add new elements properties magic * add new elements properties magic --- htdocs/core/lib/functions.lib.php | 14 ++++++++++++++ htdocs/product/document.php | 2 +- htdocs/recruitment/recruitmentcandidature_card.php | 4 ++-- .../recruitmentcandidature_document.php | 2 +- htdocs/user/document.php | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6abd5e1b3e4..5682eda94a7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14644,6 +14644,20 @@ function getElementProperties($elementType) $classname = 'Fournisseur'; $table_element = 'societe'; $subelement = ''; + } elseif ($elementType == 'recruitmentcandidature') { + $module = 'recruitment'; + $classfile = 'recruitmentcandidature'; + $classpath = 'recruitment/class'; + $classname = 'RecruitmentCandidature'; + $subelement = 'recruitmentcandidature'; + $subdir = '/recruitmentcandidature'; + } elseif ($elementType == 'recruitmentjobposition') { + $module = 'recruitment'; + $classfile = 'recruitmentjobposition'; + $classpath = 'recruitment/class'; + $classname = 'RecruitmentJobPosition'; + $subelement = 'recruitmentjobposition'; + $subdir = '/recruitmentjobposition'; } diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 07655f8123b..3b1ee88105f 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -229,7 +229,7 @@ if ($object->id > 0 && $upload_dir !== null) { $titre = $langs->trans("CardProduct".$object->type); $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); - print dol_get_fiche_head($head, 'documents', $titre, -1, $picto); + print dol_get_fiche_head($head, 'documents', $titre, -1, $picto, 0, '', '', 0, '', 1); $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index c98c546e1cd..3b0a50771db 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -310,7 +310,7 @@ if ($action == 'create') { print ''; } - print dol_get_fiche_head(array(), ''); + print dol_get_fiche_head([], ''); print ''."\n"; @@ -370,7 +370,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetch_optionals(); $head = recruitmentCandidaturePrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentCandidature"), -1, $object->picto); + print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentCandidature"), -1, $object->picto, 0, '', '', 0, '', 1); $formconfirm = ''; diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 6cca73b990f..214e860fd9f 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -118,7 +118,7 @@ if ($object->id && $upload_dir !== null) { */ $head = recruitmentCandidaturePrepareHead($object); - print dol_get_fiche_head($head, 'document', $langs->trans("RecruitmentCandidature"), -1, $object->picto); + print dol_get_fiche_head($head, 'document', $langs->trans("RecruitmentCandidature"), -1, $object->picto, 0, '', '', 0, '', 1); // Build file list diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 71fed54897c..57e177c9ee8 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -157,7 +157,7 @@ if ($object->id && $upload_dir !== null) { } $head = user_prepare_head($object); - print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user'); + print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user', 0, '', '', 0, '', 1); $linkback = ''; if ($user->hasRight("user", "user", "read") || $user->admin) { From ffa489ee59cf12d942d39c139ba21df875348171 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 21 Oct 2025 01:06:21 +0200 Subject: [PATCH 29/35] NEW Accountancy - Transaction - Add verification on centralized account (#35824) * NEW Accountancy - Transaction - Add verification on centralized account * Fix phan * Fix phan --------- Co-authored-by: Laurent Destailleur --- htdocs/accountancy/bookkeeping/card.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 142d82f7ee8..8d106a7bd94 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -198,6 +198,11 @@ if (empty($reshook)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors'); $action = ''; } + $subledger_account_str = is_array($subledger_account) ? reset($subledger_account) : (string) $subledger_account; + if (!checkGeneralAccountAllowsAuxiliary($db, $accountingaccount_number, $subledger_account_str)) { + $error++; + setEventMessages($langs->trans("ErrorAccountNotCentralized"). ". " . $langs->trans("RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"), null, 'errors'); + } if (!$error) { if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) { From 88db5b4bd7c4aaa05b3927074186c4438aa44a36 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Tue, 21 Oct 2025 01:33:38 +0200 Subject: [PATCH 30/35] fix task file path for download (#35793) * fix task file path for download * better fix thanks to regis for multicompany support --- htdocs/projet/tasks/task.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 7e3070dd41f..d4bb8a275ad 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -694,13 +694,13 @@ if ($id > 0 || !empty($ref)) { /* * Generated documents */ - $filename = ''; - $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); + $subdir = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); + $filedir = $conf->project->multidir_output[$object->entity]."/".$subdir; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = ($user->rights->projet->lire); $delallowed = ($user->hasRight('projet', 'creer')); - print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf); + print $formfile->showdocuments('project_task', $subdir, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', '', '', $object); print '
'; From 8b47aadb1c8e16f568e0f5246076df3e2252a013 Mon Sep 17 00:00:00 2001 From: William Mead Date: Tue, 21 Oct 2025 02:04:51 +0200 Subject: [PATCH 31/35] Added warehouse api data pagination (#35866) Co-authored-by: Laurent Destailleur --- .../stock/class/api_warehouses.class.php | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index 1cd4f21f0bd..5b58f7e9fe4 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2025 MDW + * Copyright (C) 2025 William Mead * * 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 @@ -84,20 +85,24 @@ class Warehouses extends DolibarrApi * * Get a list of warehouses * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit for list - * @param int $page Page number - * @param int $category Use this param to filter list by category - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'WH-%') and (t.date_creation:<:'20160101')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names - * @return array Array of warehouse objects + * @since 4.0.0 Initial implementation + * @since 23.0.0 Data pagination + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param int $category Use this param to filter list by category + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'WH-%') and (t.date_creation:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @return array Array of warehouse objects * @phan-return Entrepot[] * @phpstan-return Entrepot[] * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '', $pagination_data = false) { $obj_ret = array(); @@ -125,6 +130,9 @@ class Warehouses extends DolibarrApi } } + //this query will return total warehouses with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -152,6 +160,23 @@ class Warehouses extends DolibarrApi throw new RestException(503, 'Error when retrieve warehouse list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } From cd3b74f092b755d1bd3ed9c2027123560e9d1325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Oct 2025 02:05:51 +0200 Subject: [PATCH 32/35] NEW add api for members statistics (#35851) * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * NEW add api for members statistics * fix * fix * fix --------- Co-authored-by: Laurent Destailleur --- .gitignore | 1 + .../adherents/class/adherentstats.class.php | 20 ++-- htdocs/adherents/class/api_members.class.php | 92 +++++++++++++++++++ htdocs/admin/system/filecheck.php | 2 +- htdocs/core/lib/functions2.lib.php | 4 +- .../core/modules/modMyModule.class.php | 2 +- htdocs/product/class/product.class.php | 3 +- htdocs/takepos/index.php | 4 +- 8 files changed, 111 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 434764e4f06..a582d0807a3 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ dev/build/node_modules/ node_modules/ vendor/ +php-vendor tmp/ #yarn diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 1afde9322b3..e3ac6a47b5b 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -68,11 +68,11 @@ class AdherentStats extends Stats /** - * Constructor + * Constructor * - * @param DoliDB $db Database handler - * @param int $socid Id third party - * @param int $userid Id user for filter + * @param DoliDB $db Database handler + * @param int $socid Id third party + * @param int $userid Id user for filter */ public function __construct($db, $socid = 0, $userid = 0) { @@ -97,11 +97,11 @@ class AdherentStats extends Stats /** - * Return the number of proposition by month for a given year + * Return the number of members by month for a given year * - * @param int $year Year - * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array,array{0:int<1,12>,1:int}> Array of nb each month + * @param int $year Year + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array,array{0:int<1,12>,1:int}> Array of nb each month */ public function getNbByMonth($year, $format = 0) { @@ -136,7 +136,7 @@ class AdherentStats extends Stats * * @param int $year Year * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month - * @return array,array{0:int<1,12>,1:int|float}> Array of values by month + * @return array,array{0:int<1,12>,1:int|float}> Array of values by month */ public function getAmountByMonth($year, $format = 0) { @@ -375,7 +375,7 @@ class AdherentStats extends Stats 'datem' => $this->db->jdate($objp->datem), 'status' => (int) $objp->status, 'date_end_subscription' => $this->db->jdate($objp->date_end_subscription), - 'photo' => $objp->photo, + 'photo' => isset($objp->photo) ? (string) $objp->photo : null, 'email' => $objp->email, 'gender' => $objp->gender, 'morphy' => $objp->morphy, diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 40a3b69a472..4f7224cc5ee 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; +require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherentstats.class.php'; /** @@ -44,6 +45,11 @@ class Members extends DolibarrApi 'typeid' ); + /** + * @var AdherentStats + */ + public $memberstats; + /** * Constructor */ @@ -51,6 +57,7 @@ class Members extends DolibarrApi { global $db; $this->db = $db; + $this->memberstats = new AdherentStats($this->db, DolibarrApiAccess::$user->socid, DolibarrApiAccess::$user->id); } /** @@ -982,6 +989,91 @@ class Members extends DolibarrApi ); } + /** + * Return an array with the number of members by month for a given year + * + * @param int $year Year + * @param int $format 0=Label of abscissa is a translated text + * 1=Label of abscissa is month number + * 2=Label of abscissa is first letter of month + * @return array Array of statistics for last modified members + * @phan-return array,array{0:int<1,12>,1:int}> Array of nb each month + * @phpstan-return array,array{0:int<1,12>,1:int}> Array of nb each month + * + * @url GET stats/nbbymonth + * @throws RestException 403 Access denied + */ + public function getNbByMonth($year, $format = 0) + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { + throw new RestException(403); + } + + return $this->memberstats->getNbByMonth($year, $format); + } + + /** + * Return an array with the number of subscriptions by year + * + * @return array Array of statistics for last modified members + * @phan-return array Array of nb each year + * @phpstan-return array Array of nb each year + * + * @url GET stats/nbbyyear + * @throws RestException 403 Access denied + */ + public function getNbByYear() + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { + throw new RestException(403); + } + + return $this->memberstats->getNbByYear(); + } + + /** + * Return the number of subscriptions by month for a given year + * + * @param int $year Year + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array of statistics for last modified members + * @phan-return array,array{0:int<1,12>,1:int|float}> Array of values by month + * @phpstan-return array,array{0:int<1,12>,1:int|float}> Array of values by month + * + * @url GET stats/amountbymonth + * @throws RestException 403 Access denied + */ + public function getAmountByMonth($year, $format = 0) + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { + throw new RestException(403); + } + + return $this->memberstats->getAmountByMonth($year, $format); + } + + /** + * Last Modified Members + * + * Get an array of statistics for last modified members + * + * @param int $max Max numbers of members + * @return array Array of statistics for last modified members + * @phan-return array + * @phpstan-return array + * + * @url GET stats/lastmodifiedmembers + * @throws RestException 403 Access denied + */ + public function getLastModifiedMembers($max) + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { + throw new RestException(403); + } + + return $this->memberstats->getLastModifiedMembers($max); + } + /** * Validate fields before creating an object * diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index cfbf8d0f98c..0d4b1c08751 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -252,7 +252,7 @@ if (empty($error) && !empty($xml)) { $out .= '
'."\n"; $out .= ''."\n"; $out .= ''."\n"; - $out .= ''."\n"; + $out .= ''."\n"; $out .= "\n"; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 5e5ff698d6c..8aa1965e5ad 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2653,7 +2653,7 @@ function getModuleDirForApiClass($moduleobject) $moduledirforclass = 'contrat'; } elseif (in_array($moduleobject, array('admin', 'login', 'setup', 'access', 'status', 'tools', 'documents', 'objectlinks'))) { $moduledirforclass = 'api'; - } elseif ($moduleobject == 'contact' || $moduleobject == 'contacts' || $moduleobject == 'customer' || $moduleobject == 'thirdparty' || $moduleobject == 'thirdparties') { + } elseif (in_array($moduleobject, ['contact', 'contacts', 'customer', 'thirdparty', 'thirdparties'])) { $moduledirforclass = 'societe'; } elseif ($moduleobject == 'propale' || $moduleobject == 'proposals') { $moduledirforclass = 'comm/propal'; @@ -2661,7 +2661,7 @@ function getModuleDirForApiClass($moduleobject) $moduledirforclass = 'comm/action'; } elseif ($moduleobject == 'mailing') { $moduledirforclass = 'comm/mailing'; - } elseif ($moduleobject == 'adherent' || $moduleobject == 'members' || $moduleobject == 'memberstypes' || $moduleobject == 'subscriptions') { + } elseif (in_array($moduleobject, ['adherent', 'members', 'memberstypes', 'subscriptions'])) { $moduledirforclass = 'adherents'; } elseif ($moduleobject == 'don' || $moduleobject == 'donations') { $moduledirforclass = 'don'; diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index aa0d59ce6df..c5f27da8e80 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -156,7 +156,7 @@ class modMyModule extends DolibarrModules $this->langfiles = array("mymodule@mymodule"); // Prerequisites - $this->phpmin = array(7, 1); // Minimum version of PHP required by module + $this->phpmin = array(7, 2); // Minimum version of PHP required by module // $this->phpmax = array(8, 0); // Maximum version of PHP required by module $this->need_dolibarr_version = array(19, -3); // Minimum version of Dolibarr required by module // $this->max_dolibarr_version = array(19, -3); // Maximum version of Dolibarr required by module diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2352365218b..9ae3c7e28da 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2435,7 +2435,8 @@ class Product extends CommonObject $price_min = $this->multiprices_min[$thirdparty_buyer->price_level]; $price_min_ttc = $this->multiprices_min_ttc[$thirdparty_buyer->price_level]; $price_base_type = $this->multiprices_base_type[$thirdparty_buyer->price_level]; - if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility + if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { + // using this option is a bug. kept for backward compatibility if (isset($this->multiprices_tva_tx[$thirdparty_buyer->price_level])) { $tva_tx = $this->multiprices_tva_tx[$thirdparty_buyer->price_level]; } diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 6edb5adef26..faf1efec99b 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Thibault FOUCART * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -1354,7 +1354,7 @@ if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) { $sql .= " AND active = 1"; $sql .= " ORDER BY libelle"; - $resql = $db->query($sql); + $resql = $db->query($sql); $paiementsModes = array(); if ($resql) { while ($obj = $db->fetch_object($resql)) { From cdd4dde166168e8c868f3fa717b98c8e6048e5a7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 21 Oct 2025 02:08:19 +0200 Subject: [PATCH 33/35] NEW Accountancy - Various payment - Add script to greyed out subledger_account if general ledger is not centralized (#35842) * NEW Accountancy - Add data-centralized in select_account() * NEW Accountancy - Add script to greyed out subledger_account if general ledger is not centralized * Fix phan --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/bank/various_payment/card.php | 13 +++++++++++++ htdocs/core/class/html.formaccounting.class.php | 17 ++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 1ce62ce4c9e..7d7c58d756d 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -431,6 +431,19 @@ if ($action == 'create') { $(\'#fieldchqemetteur\').val(\'\'); } } + function toggleSubledger() { + var isCentral = $("#accountancy_code option:selected").data("centralized"); + console.log("the selected general ledger account is centralised?", isCentral); + if (isCentral) { + $("#subledger_account").prop("disabled", false); + } else { + $("#subledger_account").prop("disabled", true); + } + } + toggleSubledger(); + + $("#accountancy_code").on("change", toggleSubledger); + $("#accountancy_code").on("select2:select", toggleSubledger); '; print ' });'."\n"; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 93900c30ae0..3bfe4918ea3 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2014 Olivier Geffroy - * Copyright (C) 2015 Ari Elbaz (elarifr) - * Copyright (C) 2016 Marcos García - * Copyright (C) 2016-2024 Alexandre Spangaro +/* Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2015 Ari Elbaz (elarifr) + * Copyright (C) 2016 Marcos García + * Copyright (C) 2016-2025 Alexandre Spangaro * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; class FormAccounting extends Form { /** - * @var array> + * @var array|array>> */ private $options_cache = array(); @@ -457,7 +457,10 @@ class FormAccounting extends Form $selected = $select_value_out; } - $options[$select_value_out] = $label; + $options[$select_value_out] = array( + 'label' => $label, + 'data-centralized' => $obj->centralized ? 1 : 0 + ); } } From ad67faa01d31678f334ea012f376e121bb95f0c8 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Tue, 21 Oct 2025 02:13:10 +0200 Subject: [PATCH 34/35] New all project contact in task creation (#35862) Co-authored-by: Lucas Marcouiller Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.form.class.php | 14 +++++++++++++- htdocs/langs/en_US/main.lang | 1 + htdocs/projet/tasks.php | 20 +++++++++++++++++--- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9b34e0ca967..5a169c17fd5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2211,7 +2211,7 @@ class Form global $action; // If no preselected user defined, we take current user - if ((is_numeric($selected) && ($selected < -3 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) { + if ((is_numeric($selected) && ($selected < -4 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) { $selected = $user->id; } @@ -2388,6 +2388,18 @@ class Form 'picto' => '' ); } + if ($showalso == 4) { + $out .= '' . "\n"; + + $outarray[-4] = '-- ' . $langs->trans("AllProjectContacts") . ' --'; + $outarray2[-4] = array( + 'id' => -4, + 'label' => '-- ' . $langs->trans("AllProjectContacts") . ' --', + 'labelhtml' => '-- ' . $langs->trans("AllProjectContacts") . ' --', + 'color' => '', + 'picto' => '' + ); + } $userstatic = new User($this->db); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fa1d4d0dada..e9f5c6c670e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1395,3 +1395,4 @@ NeedHelpCenter=Need support? Efficiency=Efficiency AccordingToYourSetupTheFileWillBeConcatenated=According to your setup, the file %s (uploaded in module setup) will be concatenated to any generated PDF TransactionID=Transaction ID +AllProjectContacts=All project contacts \ No newline at end of file diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 43e849bfbfe..954082decd6 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -391,7 +391,21 @@ if ($action == 'createtask' && $user->hasRight('projet', 'creer')) { $taskid = $task->create($user); if ($taskid > 0) { - $result = $task->add_contact(GETPOSTINT("userid"), 'TASKEXECUTIVE', 'internal'); + $userid = GETPOSTINT("userid"); + if ($userid == -4) { + if (empty($object->id)) { + $object->fetch($projectid); + } + $contactlist = array(); + foreach (array('internal', 'external') as $source) { + $contactlist = array_merge($contactlist, $object->liste_contact(-1, $source)); + } + foreach ($contactlist as $key => $contact) { + $result = $task->add_contact(((int) $contact["id"]), ($contact["code"] == "PROJECTLEADER" ? 'TASKEXECUTIVE' : "TASKCONTRIBUTOR"), $contact["source"]); + } + } else { + $result = $task->add_contact(GETPOSTINT("userid"), 'TASKEXECUTIVE', 'internal'); + } } else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("projects"); @@ -819,12 +833,12 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- print ''; From 02f949c4b7bdb97b521a54c0722af49d77cf7266 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 21 Oct 2025 02:13:38 +0200 Subject: [PATCH 35/35] NEW Accountancy - Manuel input - Add script to greyed out subledger_account if general ledger is not centralized (#35855) Co-authored-by: Laurent Destailleur --- htdocs/accountancy/bookkeeping/card.php | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 8d106a7bd94..f2c11adb4db 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -525,6 +525,29 @@ if ($action == 'delete') { print $formconfirm; } +// Update fields properties in realtime +if (!empty($conf->use_javascript_ajax)) { + print "\n" . '' . "\n"; +} + if ($action == 'create') { print load_fiche_titre($title); @@ -1000,7 +1023,7 @@ if ($action == 'create') { print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; } // Add also input for subledger label - print '
subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; + print '
subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; print ''; print '
'; print ''; @@ -1027,7 +1050,7 @@ if ($action == 'create') { } else { print ''; } - print '
'; + print '
'; print ''; print ''; print '';
'.$langs->trans("ModuleMustBeEnabled", $langs->transnoentitiesnoconv("BlockedLog")).''.yn(1).''.yn(isModEnabled('blockedlog')).''.yn(isModEnabled('blockedlog') ? 1 : 0).'
'.$langs->trans("AffectedTo").''; print img_picto('', 'user', 'class="pictofixedwidth"'); if (is_array($contactsofproject) && count($contactsofproject)) { - print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx'); + print $form->select_dolusers('-4', 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '(statut:=:1)', 4, '', 'maxwidth500 widthcentpercentminusx'); } else { if ((isset($projectid) && $projectid > 0) || $object->id > 0) { print ''.$langs->trans("NoUserAssignedToTheProject").''; } else { - print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx'); + print $form->select_dolusers('-4', 'userid', 0, null, 0, '', '', '0', 0, 0, '(statut:=:1)', 4, '', 'maxwidth500 widthcentpercentminusx'); } } print '
label_operation).'">debit)).'">