Credit note can be posted without customer selected when search customer List is...
[fa-stable.git] / sales / customer_delivery.php
index 1e29859ea49905f170704b7f19967f9c62c0a4e7..c634a94e75109bf06a1fee1d597c014e29cb1db0 100644 (file)
@@ -253,7 +253,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, $min, $max)) {