Merged changes from stable branch up to 2.3.12
[fa-stable.git] / purchasing / supplier_credit.php
index e4805768230b53374c9aa4566b118ba7f3e63996..a35533218f0e2f002dd315445255e5d27b24b8ba 100644 (file)
@@ -31,7 +31,7 @@ if ($use_date_picker)
 check_db_has_suppliers(_("There are no suppliers defined in the system."));
 
 if (isset($_GET['ModifyCredit']))
-       check_is_closed(ST_SUPPINVOICE, $_GET['ModifyCredit']);
+       check_is_editable(ST_SUPPINVOICE, $_GET['ModifyCredit']);
 
 //---------------------------------------------------------------------------------------------------
 
@@ -212,7 +212,7 @@ function check_data()
                        if (is_inventory_item($item->item_code))
                        {
                                $qoh = get_qoh_on_date($item->item_code, null, $_SESSION['supp_trans']->tran_date);
-                               if ($item->qty_recd > $qoh)
+                               if ($item->this_quantity_inv > $qoh)
                                {
                                        $stock = get_item($item->item_code);
                                        display_error(_("The return cannot be processed because there is an insufficient quantity for item:") .