Merge pull request #2161 from fappels/3.7

FIX: check for expedition batch lines
This commit is contained in:
Laurent Destailleur 2014-12-20 13:20:24 +01:00
commit b0ae8cfb9e

View File

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