From 96a820476cc0478d8416a3bea6be1a75e404a028 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 13 Aug 2021 10:45:43 +0200 Subject: [PATCH 1/3] Fix supplier invoice clone : missing data on lines (#18055) --- htdocs/fourn/class/fournisseur.facture.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8b02edcbbe0..d91f5227f21 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -500,7 +500,8 @@ class FactureFournisseur extends CommonInvoice $this->lines[$i]->date_end, $this->lines[$i]->array_options, $this->lines[$i]->fk_unit, - $this->lines[$i]->multicurrency_subprice + $this->lines[$i]->multicurrency_subprice, + $this->lines[$i]->ref_supplier ); } else { $this->error = $this->db->lasterror(); @@ -538,8 +539,16 @@ class FactureFournisseur extends CommonInvoice $line->fk_product, 'HT', (!empty($line->info_bits) ? $line->info_bits : ''), - $line->product_type - ); + $line->product_type, + $line->remise_percent, + 0, + $line->date_start, + $line->date_end, + $line->array_options, + $line->fk_unit, + $line->multicurrency_subprice, + $line->ref_supplier + ); } else { $this->error = $this->db->lasterror(); $this->db->rollback(); From 8c093cfb318f26214cea7adfdca87a8e006d2c07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 14:44:26 +0200 Subject: [PATCH 2/3] Link to doc --- htdocs/blockedlog/admin/blockedlog.php | 5 ++++- htdocs/blockedlog/admin/blockedlog_list.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index f90385b4209..423c40d9e20 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -79,7 +79,10 @@ $form = new Form($db); $block_static = new BlockedLog($db); $block_static->loadTrackedEvents(); -llxHeader('', $langs->trans("BlockedLogSetup")); +$title = $langs->trans("BlockedLogSetup"); +$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable"; + +llxHeader('', $title, $help_url); $linkback = ''; if ($withtab) { diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 265c12dd49c..385101c7468 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -275,8 +275,9 @@ if (GETPOST('withtab', 'alpha')) { } else { $title = $langs->trans("BrowseBlockedLog"); } +$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable"; -llxHeader('', $langs->trans("BrowseBlockedLog")); +llxHeader('', $title, $help_url); $MAXLINES = 10000; From c0a086fad856c17fb8265349a89d9af72c911874 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 17:55:00 +0200 Subject: [PATCH 3/3] Sellby always before Eatby #18361 --- htdocs/fourn/commande/dispatch.php | 42 ++++++++++--------- htdocs/mrp/mo_movements.php | 6 +-- htdocs/product/reassortlot.php | 19 +++++---- htdocs/product/stock/movement_list.php | 6 +-- htdocs/product/stock/product.php | 26 ++++++------ htdocs/product/stock/productlot_card.php | 19 +++++---- .../product/stock/tpl/stockcorrection.tpl.php | 12 +++--- .../product/stock/tpl/stocktransfer.tpl.php | 10 ++--- htdocs/reception/card.php | 17 ++++---- 9 files changed, 82 insertions(+), 75 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index de09bb80ea4..9ce89761d40 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -738,12 +738,12 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("Description").''; if (!empty($conf->productbatch->enabled)) { print ''.$langs->trans("batch_number").''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''.$langs->trans("EatByDate").''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''.$langs->trans("SellByDate").''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''.$langs->trans("EatByDate").''; + } } else { print ''; print ''; @@ -828,12 +828,12 @@ if ($id > 0 || !empty($ref)) { print $linktoprod; print ""; print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } } else { print ''; print $linktoprod; @@ -841,12 +841,12 @@ if ($id > 0 || !empty($ref)) { print ''; print $langs->trans("ProductDoesNotUseBatchSerial"); print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } } } else { print ''; @@ -913,7 +913,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; $dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year')); print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, ''); @@ -929,8 +929,8 @@ if ($id > 0 || !empty($ref)) { } else { $type = 'dispatch'; $colspan = 7; - $colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan; $colspan = (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) ? --$colspan : $colspan; + $colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan; print ''; print ''; // Qty to dispatch print ''; @@ -1142,12 +1142,12 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("DateDeliveryPlanned").''; if (!empty($conf->productbatch->enabled)) { print ''.$langs->trans("batch_number").''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''.$langs->trans("EatByDate").''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''.$langs->trans("SellByDate").''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''.$langs->trans("EatByDate").''; + } } print ''.$langs->trans("QtyDispatched").''; print ''.$langs->trans("Warehouse").''; @@ -1202,16 +1202,20 @@ if ($id > 0 || !empty($ref)) { $lot = new Productlot($db); $lot->fetch(0, $objp->pid, $objp->batch); print ''.$lot->getNomUrl(1).''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''.dol_print_date($lot->eatby, 'day').''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''.dol_print_date($lot->sellby, 'day').''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''.dol_print_date($lot->eatby, 'day').''; + } } else { print ''; - print ''; - print ''; + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ''; + } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } } } diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index b4dbed059bc..600563f6cfd 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -123,12 +123,12 @@ $arrayfields = array( //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), //'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500) ); -if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) { - unset($arrayfields['pl.eatby']); -} if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) { unset($arrayfields['pl.sellby']); } +if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) { + unset($arrayfields['pl.eatby']); +} $objectlist->fields = dol_sort_array($objectlist->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 7949c5441c1..5e025e6de6a 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -284,10 +284,10 @@ if ($resql) print ''; print ' '; print ' '; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ' '; } - if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print ' '; } print ' '; @@ -306,12 +306,12 @@ if ($resql) print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", $param, "", '', $sortfield, $sortorder); //print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'',$sortfield,$sortorder, 'right ); print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", $param, "", '', $sortfield, $sortorder, 'center '); - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center '); - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", $param, "", '', $sortfield, $sortorder, 'center '); } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center '); + } print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", $param, "", '', $sortfield, $sortorder, 'right '); // TODO Add info of running suppliers/customers orders //print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'',$sortfield,$sortorder, 'right '); @@ -408,16 +408,19 @@ if ($resql) } print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''.dol_print_date($db->jdate($objp->sellby), 'day').''; } + + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; + } + print ''; //if ($objp->seuil_stock_alerte && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; print $objp->stock_physique; print ''; + print ''.$langs->trans("Movements").''; print ''.$product_static->LibStatut($objp->statut, 5, 0).''; print ''.$product_static->LibStatut($objp->tobuy, 5, 1).''; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 6ab8a99ac76..47e28939e05 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -121,12 +121,12 @@ $arrayfields = array( //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), //'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500) ); -if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) { - unset($arrayfields['pl.eatby']); -} if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) { unset($arrayfields['pl.sellby']); } +if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) { + unset($arrayfields['pl.eatby']); +} // Security check if (!$user->rights->stock->mouvement->lire) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index d1c1ea99ff7..964a7360aa1 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -830,14 +830,14 @@ if (!$variants) { $colspan = 3; print ''; print ''.$langs->trans("batch_number").''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - $colspan--; - print ''.$langs->trans("EatByDate").''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { $colspan--; print ''.$langs->trans("SellByDate").''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + $colspan--; + print ''.$langs->trans("EatByDate").''; + } print ''; print ''; print ''; @@ -917,16 +917,16 @@ if (!$variants) { print ''; print ''; print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } print ''; print ''; @@ -945,14 +945,14 @@ if (!$variants) { print $product_lot_static->getNomUrl(1); print ''; $colspan = 3; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - $colspan--; - print ''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { $colspan--; print ''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + $colspan--; + print ''; + } print ''; print ''; print ''; diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 26c388c6b34..d8a727af0ec 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -335,6 +335,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label; print ''; + // Sell by + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ''; + print ''; + } + // Eat by if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print ''; } - // Sell by - if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { - print ''; - print ''; - } // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 4f88b448239..30dab6d7fa8 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -115,18 +115,18 @@ if (!empty($conf->productbatch->enabled) && print ''; print ''; print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } print ''; } diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index 20445445e8e..0b82c8bad03 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -108,16 +108,16 @@ if (!empty($conf->productbatch->enabled) && print ''; print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } print ''; } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 8a4d5edc611..24144365256 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -983,12 +983,12 @@ if ($action == 'create') if (!empty($conf->productbatch->enabled)) { print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print ''; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } } print "\n"; } @@ -1077,8 +1077,7 @@ if ($action == 'create') print ''; - if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { + if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $quantityToBeDelivered = 0; } else { $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; @@ -1130,12 +1129,12 @@ if ($action == 'create') if (!empty($product->status_batch)) { print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } - if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print ''; @@ -1827,11 +1826,11 @@ if ($action == 'create') if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)) { print '
'; - print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0); - print ''; print $form->selectDate($pdluo->sellby, 'sellby', '', '', 1, '', 1, 0); print ''; + print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0); + print ''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').''; print '
'.dol_print_date($pdluo->eatby, 'day').''.dol_print_date($pdluo->sellby, 'day').''.dol_print_date($pdluo->eatby, 'day').''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').'
'; + print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); + print ''; + print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); + print '
'; @@ -345,15 +355,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; - print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); - print ''; - print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); - print '
'.$langs->trans("EatByDate").''; - $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear')); - print $form->selectDate($eatbyselected, 'eatby', '', '', 1, ""); - print ''.$langs->trans("SellByDate").''; $sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear')); print $form->selectDate($sellbyselected, 'sellby', '', '', 1, ""); print ''.$langs->trans("EatByDate").''; + $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear')); + print $form->selectDate($eatbyselected, 'eatby', '', '', 1, ""); + print '
'.$langs->trans("EatByDate").''; - print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled - print ''.$langs->trans("SellByDate").''; print $form->selectDate(($d_sellby ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled print ''.$langs->trans("EatByDate").''; + print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled + print '
'.$langs->trans("batch_number").''.$langs->trans("EatByDate").''.$langs->trans("SellByDate").''.$langs->trans("EatByDate").'
'; print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, ""); print ''; print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, ""); print '
'; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print $langs->trans('EatByDate').' : '; print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").'
'; } - if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print $langs->trans('SellByDate').' : '; print $form->selectDate($lines[$i]->sellby, 'dluo'.$line_id, '', '', 1, ""); }