From 2fdf26731b6281f6a9f7440c1b7c9e97cbeaee2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Oct 2023 21:35:00 +0200 Subject: [PATCH] Fix php8 error --- htdocs/expedition/card.php | 10 +++++++--- htdocs/product/class/productbatch.class.php | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 960a04f982a..531cabac8a0 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1414,7 +1414,9 @@ if ($action == 'create') { } $subj++; print ''; - if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print ''.dol_print_date($dbatch->stock_entry_date, 'day').''; //StockEntrydate + if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) { + print ''.dol_print_date($dbatch->context['stock_entry_date'], 'day').''; //StockEntrydate + } print ''; } } else { @@ -1426,7 +1428,7 @@ if ($action == 'create') { print ''; print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->label); print ''; - if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print ''; //StockEntrydate + if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ''; //StockEntrydate print ''; } } @@ -1639,7 +1641,9 @@ if ($action == 'create') { //dol_syslog('deliverableQty = '.$deliverableQty.' batchStock = '.$batchStock); $subj++; print ''; - if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print ''.dol_print_date($dbatch->stock_entry_date, 'day').''; + if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) { + print ''.dol_print_date($dbatch->context['stock_entry_date'], 'day').''; + } print ''; } } diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 6a5fa9a30f7..997e22d3bc1 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -500,7 +500,8 @@ class Productbatch extends CommonObject $tmp->batch = $obj->batch; $tmp->qty = $obj->qty; $tmp->import_key = $obj->import_key; - $tmp->stock_entry_date = $obj->date_entree; + + $tmp->context['stock_date_entry'] = $obj->date_entree; // Some properties of the lot $tmp->lotid = $obj->lotid; // ID in table of the details of properties of each lots @@ -514,7 +515,7 @@ class Productbatch extends CommonObject return $ret; } else { - $error = "Error ".$dbs->lasterror(); + //$error = "Error ".$dbs->lasterror(); return -1; } }