X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_credit.php;h=f4982933fa2d347d9c226e0d1fc4a405e930890a;hb=fbfb1ee42fac43d2e149eaad52de19becfc10034;hp=57e8696eda925d5ef974100877afc3213f0a7632;hpb=1431b89949b816de1d9304875bdde655cbdf9cc1;p=fa-stable.git diff --git a/purchasing/supplier_credit.php b/purchasing/supplier_credit.php index 57e8696e..f4982933 100644 --- a/purchasing/supplier_credit.php +++ b/purchasing/supplier_credit.php @@ -204,13 +204,13 @@ function check_data() foreach ($_SESSION['supp_trans']->grn_items as $n => $item) { if (is_inventory_item($item->item_code)) { - $qoh = get_qoh_on_date($item->item_code, null, $_SESSION['supp_trans']->tran_date); - if ($item->this_quantity_inv > $qoh) + if (check_negative_stock($item->item_code, -$item->this_quantity_inv, null, $_SESSION['supp_trans']->tran_date)) { $stock = get_item($item->item_code); display_error(_("The return cannot be processed because there is an insufficient quantity for item:") . " " . $stock['stock_id'] . " - " . $stock['description'] . " - " . - _("Quantity On Hand") . " = " . number_format2($qoh, get_qty_dec($stock['stock_id']))); + _("Quantity On Hand") . " = " . number_format2(get_qoh_on_date($stock['stock_id'], null, + $_SESSION['supp_trans']->tran_date), get_qty_dec($stock['stock_id']))); return false; } } @@ -276,6 +276,7 @@ function commit_item_data($n) $_POST['prev_quantity_inv'.$n], input_num('This_QuantityCredited'.$n), $_POST['order_price'.$n], input_num('ChgPrice'.$n), $_POST['std_cost_unit'.$n], ""); + reset_tax_input(); } }