Merged changes from mai trunk up to 2.3.1
[fa-stable.git] / purchasing / supplier_payment.php
index 0d094ba346b5e49d0512ed05b905e1d33be4bf38..5421ee401d426db3ce60862252aa81999c6a94df 100644 (file)
@@ -186,6 +186,16 @@ function check_inputs()
                set_focus('DatePaid');
                return false;
        }
+
+       $limit = get_bank_account_limit($_POST['bank_account'], $_POST['DatePaid']);
+
+       if ($limit != null && ($limit < input_num('amount')))
+       {
+               display_error(sprintf(_("The total bank amount exceeds allowed limit (%s)."), price_format($limit)));
+               set_focus('amount');
+               return false;
+       }
+
     if (!$Refs->is_valid($_POST['ref'])) 
     {
                display_error(_("You must enter a reference."));