Merge pull request #17152 from marc-dll/FIX_12.0_zero_packaging

FIX: supplier order: error 500 when using packaging with product where it is not defined
This commit is contained in:
Laurent Destailleur 2021-04-09 13:51:16 +02:00 committed by GitHub
commit e8bf09862f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2707,7 +2707,7 @@ class CommandeFournisseur extends CommonOrder
}
else
{
if (($qty % $this->line->packaging) > 0)
if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0)
{
$coeff = intval($qty / $this->line->packaging) + 1;
$qty = $this->line->packaging * $coeff;