Fix: Avoid errors when batch stock is negative

This commit is contained in:
fmarcet 2016-02-05 12:59:32 +01:00
parent 01f2180822
commit ede4453164

View File

@ -882,7 +882,7 @@ if ($action == 'create')
if ($defaultqty<=0) { if ($defaultqty<=0) {
$defaultqty=0; $defaultqty=0;
} else { } else {
$defaultqty -= min($defaultqty,$substock); $defaultqty -= ($substock > 0 ? min($defaultqty,$substock) : 0);
} }
$subj++; $subj++;
} }