mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into 21.0
This commit is contained in:
@@ -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)."'";
|
||||
|
||||
@@ -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')) {
|
||||
|
||||
@@ -1318,6 +1318,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname && $user->hasRi
|
||||
}
|
||||
|
||||
// type
|
||||
$picto = '';
|
||||
if (isset($obj->Picto)) {
|
||||
$picto = $obj->Picto;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2019 Cedric Ancelin <icedo.anc@gmail.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 William Mead <william@m34d.com>
|
||||
*
|
||||
* 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') {
|
||||
|
||||
@@ -192,10 +192,11 @@ print '</div>';
|
||||
|
||||
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
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 William Mead <william@m34d.com>
|
||||
*
|
||||
* 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);
|
||||
|
||||
Reference in New Issue
Block a user