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)."'"; 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')) { 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; } 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); 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'); 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') { 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 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);