From 5d22b46c68935cdcaaabb6e3df1d6499925f24aa Mon Sep 17 00:00:00 2001 From: atm-corentin <165782689+atm-corentin@users.noreply.github.com> Date: Tue, 29 Jul 2025 02:59:43 +0200 Subject: [PATCH 1/8] FIX|Fix #Hide mandatory DLC/DLUO options when disabled in product configuration (#34790) * Hide DLC/DLUO mandatory options in product form when disabled by configuration * fix using constant * Update card.php --------- Co-authored-by: Laurent Destailleur --- htdocs/product/card.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 476614ad7da..be85f1fb953 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1330,6 +1330,18 @@ if (isModEnabled('accounting')) { $sellOrEatByMandatoryList = null; if (isModEnabled('productbatch')) { $sellOrEatByMandatoryList = Product::getSellOrEatByMandatoryList(); + + $disableSellBy = getDolGlobalString('PRODUCT_DISABLE_SELLBY'); + $disableEatBy = getDolGlobalString('PRODUCT_DISABLE_EATBY'); + + if ($disableSellBy) { + unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY]); + unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]); + } + if ($disableEatBy) { + unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY]); + unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]); + } } $title = $langs->trans('ProductServiceCard'); From 04672e1d80dd076a39227cb3ed55f2a3afffe425 Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Tue, 29 Jul 2025 21:09:46 +0200 Subject: [PATCH 2/8] fix use delivery date v21 (#34831) --- htdocs/commande/list.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b5d9785da63..442b3090955 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1001,7 +1001,12 @@ if ($search_status != '') { } } if ($search_option == 'late') { - $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'"; + // Use delivery date if set and not disabled, otherwise use order date. + if (!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE')) { + $sql .= " AND ((c.date_livraison IS NOT NULL AND c.date_livraison < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."') OR (c.date_livraison IS NULL AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'))"; + } else { + $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'"; + } } if ($search_datecloture_start) { $sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'"; From 498574fcb403bf3edca1671871153b994dc76f9e Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 31 Jul 2025 16:05:31 +0200 Subject: [PATCH 3/8] Fix picto in modulebuilder --- htdocs/modulebuilder/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 86726bb5543..78991a19b15 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1318,6 +1318,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname && $user->hasRi } // type + $picto = ''; if (isset($obj->Picto)) { $picto = $obj->Picto; } From b34ea62fd9c4b95c1f208a72c9cb109ab26403a2 Mon Sep 17 00:00:00 2001 From: atm-GregM <85485123+atm-GregM@users.noreply.github.com> Date: Thu, 31 Jul 2025 21:23:53 +0200 Subject: [PATCH 4/8] Fix detail qty if serial batch (#34844) --- htdocs/core/lib/pdf.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 9b1f8e41e5b..a34b4933afb 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1848,7 +1848,9 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if ($detail->batch) { $dte[] = $outputlangs->transnoentitiesnoconv('printBatch', $detail->batch); } - $dte[] = $outputlangs->transnoentitiesnoconv('printQty', $detail->qty); + if ($detail->qty) { + $dte[] = $outputlangs->transnoentitiesnoconv('printQty', $detail->qty); + } // Add also info of planned warehouse for lot if ($object->element == 'shipping' && $detail->fk_origin_stock > 0 && getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) { From f8d55e1cf99453191e9a16d047d1e60a77729967 Mon Sep 17 00:00:00 2001 From: William Mead Date: Thu, 31 Jul 2025 21:24:41 +0200 Subject: [PATCH 5/8] Fixed foreach looping on int returned from fetchAllByFkProductParent method (#34837) --- htdocs/variants/class/ProductCombination.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index db82c86747a..2e4be1a5949 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2022 Open-Dsi * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * 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 @@ -479,9 +480,15 @@ class ProductCombination */ public function deleteByFkProductParent($user, $fk_product_parent) { + $combinations = $this->fetchAllByFkProductParent($fk_product_parent); + + if (!is_array($combinations)) { // No combinations found, return success + return 1; + } + $this->db->begin(); - foreach ($this->fetchAllByFkProductParent($fk_product_parent) as $prodcomb) { + foreach ($combinations as $prodcomb) { $prodstatic = new Product($this->db); $res = $prodstatic->fetch($prodcomb->fk_product_child); From 7266ad4352b227a616133a565c266a200b7f6875 Mon Sep 17 00:00:00 2001 From: William Mead Date: Thu, 31 Jul 2025 21:51:29 +0200 Subject: [PATCH 6/8] Fixed undefined property default_vat_code PHP warning (#34836) --- htdocs/product/class/api_products.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 8e1bb74e0d7..06c41e0b82a 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2019 Cedric Ancelin * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 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 @@ -424,8 +425,10 @@ class Products extends DolibarrApi if ($this->product->tva_npr != $oldproduct->tva_npr) { $pricemodified = true; } - if ($this->product->default_vat_code != $oldproduct->default_vat_code) { - $pricemodified = true; + if (!empty($this->product->default_vat_code)) { + if ($this->product->default_vat_code != $oldproduct->default_vat_code) { + $pricemodified = true; + } } if ($this->product->price_base_type == 'TTC') { From b7c94c1f316a8a2399d90301ca41f99c956137da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 31 Jul 2025 21:57:52 +0200 Subject: [PATCH 7/8] fix download and preview (#34833) --- htdocs/societe/document.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 91238bf1b4e..42ab5a876a8 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -192,10 +192,11 @@ print ''; print dol_get_fiche_end(); -$modulepart = 'societe'; +$modulepart = 'company'; $permissiontoadd = $user->hasRight('societe', 'creer'); $permtoedit = $user->hasRight('societe', 'creer'); $param = '&id='.$object->id; +$relativepathwithnofile = $object->id . '/'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; // End of page From 3405028f4e1625c0508268979bd738892ddf3061 Mon Sep 17 00:00:00 2001 From: boudet jean pascal <68547382+atm-jpb@users.noreply.github.com> Date: Thu, 31 Jul 2025 22:00:27 +0200 Subject: [PATCH 8/8] Added the list suffix to the initialization of the hook in mo_movement.php to align with the existing naming conventions used in other Dolibarr lists. (#34835) Co-authored-by: jpb --- htdocs/mrp/mo_movements.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 5120d8a3c98..cebedda57c5 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -97,7 +97,7 @@ if (!$sortorder) { $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('mocard', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('mocard', 'globalcard', 'mocardmovelist' )); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element);