X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_credit.php;fp=purchasing%2Fsupplier_credit.php;h=b4f31966d9aa7f8f7e82368b5625a6960c0a5991;hb=ec51d9a922df61d39de8444cd0a3aaf51ebcbf2b;hp=57e8696eda925d5ef974100877afc3213f0a7632;hpb=96ad9190fa3637a41b3161f5b99fc044cbe01867;p=fa-stable.git diff --git a/purchasing/supplier_credit.php b/purchasing/supplier_credit.php index 57e8696e..b4f31966 100644 --- a/purchasing/supplier_credit.php +++ b/purchasing/supplier_credit.php @@ -204,8 +204,7 @@ 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:") .