Removed unneeded double forms in scripts with db_pager. Missing $_POST variables.
[fa-stable.git] / purchasing / supplier_payment.php
index 713d0122ffda7fc292716b9cf3a767bf1fea960e..ce217913e0aefc4522fac4060232d13a12fc7617 100644 (file)
@@ -102,10 +102,13 @@ function check_inputs()
                return false;
        }
 
-       if (isset($_POST['charge']) && input_num('charge') > 0 && get_company_pref('bank_charge_act') == '') {
-               display_error(_("The Bank Charge Account has not been set in System and General GL Setup."));
-               set_focus('charge');
-               return false;
+       if (isset($_POST['charge']) && input_num('charge') > 0) {
+               $charge_acct = get_company_pref('bank_charge_act');
+               if (get_gl_account($charge_acct) == false) {
+                       display_error(_("The Bank Charge Account has not been set in System and General GL Setup."));
+                       set_focus('charge');
+                       return false;
+               }       
        }
 
        if (isset($_POST['_ex_rate']) && !check_num('_ex_rate', 0.000001))
@@ -161,7 +164,11 @@ function check_inputs()
        }
 
        $_SESSION['alloc']->amount = -input_num('amount');
-       return check_allocations();
+
+       if (isset($_POST["TotalNumberOfAllocs"]))
+               return check_allocations();
+       else
+               return true;
 }
 
 //----------------------------------------------------------------------------------------