mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-19 23:33:16 +01:00
fix: divided by zero with customer packaging (#35224)
* fix: divided by zero with customer packaging * fix: divided by zero with customer packaging * fix: divided by zero with customer packaging --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -3285,7 +3285,10 @@ class Commande extends CommonOrder
|
||||
if ($qty < $this->line->packaging) {
|
||||
$qty = $this->line->packaging;
|
||||
} else {
|
||||
if (!empty($this->line->packaging) && fmod($qty, $this->line->packaging) > 0) {
|
||||
if (!empty($this->line->packaging)
|
||||
&& is_numeric($this->line->packaging)
|
||||
&& (float) $this->line->packaging > 0
|
||||
&& fmod((float) $qty, (float) $this->line->packaging) > 0) {
|
||||
$coeff = intval($qty / $this->line->packaging) + 1;
|
||||
$qty = $this->line->packaging * $coeff;
|
||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||
|
||||
Reference in New Issue
Block a user