From 6b557fd92f75e4ce8783f2ed647658472e87546a Mon Sep 17 00:00:00 2001 From: fappels Date: Tue, 17 Oct 2017 22:19:45 +0200 Subject: [PATCH 1/3] Fix old batches not displayed in multi warehouse shipping Old batches not available in product_lot table are not shown for shipping from multiple warehouses --- htdocs/expedition/card.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f0aaad677d6..6bd275d94d2 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1212,11 +1212,16 @@ if ($action == 'create') print ''; print ''; - //print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); $productlotObject->fetch(0, $line->fk_product, $dbatch->batch); - print $langs->trans("Batch").': '.$productlotObject->getNomUrl(1); - print ' ('.$dbatch->qty.')'; - //print $langs->trans("DetailBatchFormat", 'ee'.$dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); + if (!empty($productlotObject->batch)) + { + print $langs->trans("Batch").': '.$productlotObject->getNomUrl(1); + print ' ('.$dbatch->qty.')'; + } + else + { + print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); + } $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) { From eaafe83ae4d55799c6744284f1e63e44d088f73a Mon Sep 17 00:00:00 2001 From: fappels Date: Tue, 24 Oct 2017 16:05:41 +0200 Subject: [PATCH 2/3] Only show old batch number and qty --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6bd275d94d2..37aed77bce6 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1220,7 +1220,7 @@ if ($action == 'create') } else { - print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty); + print $dbatch->batch.' ('.$dbatch->qty.')'; } $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) From 78e3c63eade6c0391daccfa7d1d7779f1e07e2d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Oct 2017 02:26:37 +0200 Subject: [PATCH 3/3] Update card.php --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 37aed77bce6..2dabf0dc3c4 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1218,9 +1218,9 @@ if ($action == 'create') print $langs->trans("Batch").': '.$productlotObject->getNomUrl(1); print ' ('.$dbatch->qty.')'; } - else + else // When lot not found in lot table (this can happen with old record) { - print $dbatch->batch.' ('.$dbatch->qty.')'; + print $langs->trans("Batch").': '.$dbatch->batch.' ('.$dbatch->qty.')'; } $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0)