Merged changes from mai trunk up to 2.3.1
[fa-stable.git] / gl / bank_transfer.php
index 5ed84c08e4528c12537c456bc4a9fa94d9ab17ec..351bfb5d51dd5cc6dd91a2a4b86f30de816282a3 100644 (file)
@@ -123,6 +123,15 @@ function check_valid_entries()
                return false;
        }
 
+       $limit = get_bank_account_limit($_POST['FromBankAccount'], $_POST['DatePaid']);
+
+       if ($limit != null && ($limit < (input_num('charge') + input_num('amount'))))
+       {
+               display_error(sprintf(_("The total bank amount exceeds allowed limit (%s) for source account."), price_format($limit)));
+               set_focus('amount');
+               return false;
+       }
+
        if (isset($_POST['charge']) && !check_num('charge', 0)) 
        {
                display_error(_("The entered amount is invalid or less than zero."));