Changed get_unic_dec to get_qty_dec for eliminating return -1.
authorJoe <joe.hunt.consulting@gmail.com>
Sat, 15 Apr 2023 09:27:08 +0000 (11:27 +0200)
committerJoe <joe.hunt.consulting@gmail.com>
Sat, 15 Apr 2023 09:27:08 +0000 (11:27 +0200)
sales/customer_delivery.php
sales/customer_invoice.php

index e58eb4a719c1cbe2859384a66f909c393f3a9327..c160d6d8725979197778f45b0590ab29f7dba620 100644 (file)
@@ -256,9 +256,7 @@ function check_quantities()
                        } else {
                                $min = 0;
                                // Fixing floating point problem in PHP.
-                               $dec = get_unit_dec($itm->stock_id);
-                               $dec = $dec == -1 ? user_qty_dec() : $dec;
-                               $max = round2($itm->quantity - $itm->qty_done, $dec);
+                               $max = round2($itm->quantity - $itm->qty_done, get_qty_dec($itm->stock_id));
                        }
 
                        if (check_num('Line'.$line, $min, $max)) {
index 35cdc5baca42e319cd4e6e849c165f9e8b310885..e6ded2d3a4e025315f2adc6241c7c53145d0cf6d 100644 (file)
@@ -205,7 +205,7 @@ function check_quantities()
                        } else {
                                $min = 0;
                                // Fixing floating point problem in PHP.
-                               $max = round2($itm->quantity - $itm->qty_done, get_unit_dec($itm->stock_id));
+                               $max = round2($itm->quantity - $itm->qty_done, get_qty_dec($itm->stock_id));
                        }
                        if (check_num('Line'.$line_no, $min, $max)) {
                                $_SESSION['Items']->line_items[$line_no]->qty_dispatched =