From b090af9ccaf50bc43b545d5f0f7df43a62bc3940 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 12 Jun 2014 15:43:40 +0200 Subject: [PATCH 1/2] FIX[ bug #1444 ] Shipment product batch is not proposed --- htdocs/expedition/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 1fd33b29c53..f203896f7b8 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -863,7 +863,7 @@ if ($action == 'create') if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; } - if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_array($product->stock_warehouse[GETPOST('entrepot_id','int')]))) + if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[GETPOST('entrepot_id','int')]))) { // Quantity to send print ''; From 3c3bc8b769911c1fe820f737aa0cb12ca363309b Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 12 Jun 2014 16:29:03 +0200 Subject: [PATCH 2/2] FIX [ bug #1308 ] Stock movements on a product with batch --- htdocs/expedition/class/expedition.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5cf09642c68..b7a94bc28c4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1128,6 +1128,10 @@ class Expedition extends CommonObject // Eat-by date if (! empty($conf->productbatch->enabled)) { + /* test on conf at begining of file sometimes doesn't include expeditionbatch + * May be conf is not well initialized for dark reason + */ + require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; $line->detail_batch=ExpeditionLigneBatch::FetchAll($this->db,$obj->line_id); } $this->lines[$i] = $line;