From 6b557fd92f75e4ce8783f2ed647658472e87546a Mon Sep 17 00:00:00 2001 From: fappels Date: Tue, 17 Oct 2017 22:19:45 +0200 Subject: [PATCH] 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) {