php 8 error. class.mail.inc. line 149. #5 parameter cannot be null.
[fa-stable.git] / sales / customer_invoice.php
index 3bf5a6bbb7e147e5f0e1d3ccc5723995fe4d2f61..35cdc5baca42e319cd4e6e849c165f9e8b310885 100644 (file)
@@ -204,7 +204,8 @@ function check_quantities()
                                $max = $itm->quantity;
                        } else {
                                $min = 0;
-                               $max = $itm->quantity - $itm->qty_done;
+                               // Fixing floating point problem in PHP.
+                               $max = round2($itm->quantity - $itm->qty_done, get_unit_dec($itm->stock_id));
                        }
                        if (check_num('Line'.$line_no, $min, $max)) {
                                $_SESSION['Items']->line_items[$line_no]->qty_dispatched =