From a41fc3d75af89ab616e17ec42a116fcf201e5040 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 22 Jan 2023 17:06:17 +0100 Subject: [PATCH] Cannot add received items to invoice if there are empty prev. items. Fixed. --- purchasing/supplier_invoice.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/purchasing/supplier_invoice.php b/purchasing/supplier_invoice.php index d3cef151..fd86743b 100644 --- a/purchasing/supplier_invoice.php +++ b/purchasing/supplier_invoice.php @@ -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))) -- 2.30.2