FIX: check for expedition batch lines

check if expedition batch lines are available before foreach
This commit is contained in:
Francis Appels 2014-12-19 11:57:47 +01:00
parent c571013fc9
commit 747b2af06b

View File

@ -604,9 +604,11 @@ class Expedition extends CommonObject
if (! empty($conf->productbatch->enabled)) {
$details=ExpeditionLigneBatch::FetchAll($this->db,$obj->rowid);
foreach ($details as $dbatch) {
$result=$mouvS->livraison_batch($dbatch->fk_origin_stock,$dbatch->dluo_qty);
if ($result < 0) { $error++; $this->errors[]=$mouvS->$error; break 2; }
if (! empty($details)) {
foreach ($details as $dbatch) {
$result=$mouvS->livraison_batch($dbatch->fk_origin_stock,$dbatch->dluo_qty);
if ($result < 0) { $error++; $this->errors[]=$mouvS->$error; break 2; }
}
}
}
}