From fcb588f424a22b59342f70c8011035c3e8e50711 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Wed, 26 Mar 2014 17:18:02 +0100 Subject: [PATCH] -Fix error when shipping a batch enabled product without stock -Fix typo --- .../class/expeditionbatch.class.php | 2 +- htdocs/expedition/fiche.php | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index cf57929ca0f23..e361548309d4b 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -17,7 +17,7 @@ */ /** - * \file expedtion/class/productbatch.class.php + * \file expedition/class/productbatch.class.php * \ingroup productbatch * \brief This file implements CRUD method for managing product's shipment * with batch record diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index bfc444faf56ca..7ed44102a4cf9 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -856,7 +856,7 @@ if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; } - if (empty($conf->productbatch->enabled) || ! $product->hasbatch()) { + if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_array($product->stock_warehouse[GETPOST('entrepot_id','int')] ))) { // Quantity to send print ''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) @@ -897,27 +897,27 @@ print "\n"; // Show subproducts of product - if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) - { - $product->get_sousproduits_arbo(); - $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); - if(count($prods_arbo) > 0) - { - foreach($prods_arbo as $key => $value) - { - //print $value[0]; - $img=''; - if ($value['stock'] < $value['stock_alert']) - { - $img=img_warning($langs->trans("StockTooLow")); - } - print "      -> - ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   - ".$value['stock']." ".$img.""; - } - } - } + if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) + { + $product->get_sousproduits_arbo(); + $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); + if(count($prods_arbo) > 0) + { + foreach($prods_arbo as $key => $value) + { + //print $value[0]; + $img=''; + if ($value['stock'] < $value['stock_alert']) + { + $img=img_warning($langs->trans("StockTooLow")); + } + print "      -> + ".$value['fullpath']." + (".$value['nb'].") ".$value['nb_total']."   + ".$value['stock']." ".$img.""; + } + } + } } else { print ''; $subj=0;