Cannot add received items to invoice if there are empty prev. items. Fixed.
authorJoe <joe.hunt.consulting@gmail.com>
Sun, 22 Jan 2023 16:06:17 +0000 (17:06 +0100)
committerJoe <joe.hunt.consulting@gmail.com>
Sun, 22 Jan 2023 16:06:17 +0000 (17:06 +0100)
purchasing/supplier_invoice.php

index d3cef151f0c9717f509b2785006930d5cec14b40..fd86743b7be4167cefd825e9608ef89b8bb95202 100644 (file)
@@ -283,7 +283,8 @@ function check_item_data($n)
                }
        }
 
-       if ($SysPrefs->check_qty_charged_vs_del_qty == true && ($_POST['qty_recd'.$n] != $_POST['prev_quantity_inv'.$n]))
+       if ($SysPrefs->check_qty_charged_vs_del_qty == true && ($_POST['qty_recd'.$n] != $_POST['prev_quantity_inv'.$n])
+               && !empty($_POST['prev_quantity_inv'.$n]))
        {
                if (input_num('this_quantity_inv'.$n) / ($_POST['qty_recd'.$n] - $_POST['prev_quantity_inv'.$n]) >
                        (1+ ($margin / 100)))