Merge pull request #21722 from Easya-Solutions/new-expedition-card-eat-sell-by-show

NEW show SellBy/EatBy dates for each batch product in shipment card
This commit is contained in:
Laurent Destailleur 2022-08-22 15:14:48 +02:00 committed by GitHub
commit 06b9b684af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1315,10 +1315,10 @@ if ($action == 'create') {
$detail = '';
$detail .= $langs->trans("Batch").': '.$dbatch->batch;
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (empty($conf->global->PRODUCT_DISABLE_SELLBY) && !empty($dbatch->sellby)) {
$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (empty($conf->global->PRODUCT_DISABLE_EATBY) && !empty($dbatch->eatby)) {
$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
}
$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
@ -1526,6 +1526,12 @@ if ($action == 'create') {
} else {
print 'TableLotIncompleteRunRepairWithParamStandardEqualConfirmed';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY) && !empty($dbatch->sellby)) {
print ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY) && !empty($dbatch->eatby)) {
print ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
}
print ' ('.$dbatch->qty.')';
$quantityToBeDelivered -= $deliverableQty;
if ($quantityToBeDelivered < 0) {