When updating costs and no quantity on hand we got a db error (in newer mysql releases).
[fa-stable.git] / gl / gl_bank.php
index 97f67ddcb9815f7d123358d9ede77175a8467ded..17547fb2114914a6e9ecf8d6b581b560f20ea1c2 100644 (file)
@@ -88,7 +88,7 @@ if (isset($_GET['UpdatedID']))
        $trans_no = $_GET['UpdatedID'];
        $trans_type = ST_BANKPAYMENT;
 
-       display_notification_centered(_("Payment $trans_no has been modified"));
+       display_notification_centered(sprintf(_("Payment %d has been modified"), $trans_no));
 
        display_note(get_gl_view_str($trans_type, $trans_no, _("&View the GL Postings for this Payment")));
 
@@ -119,7 +119,7 @@ if (isset($_GET['UpdatedDep']))
        $trans_no = $_GET['UpdatedDep'];
        $trans_type = ST_BANKDEPOSIT;
 
-       display_notification_centered(_("Deposit $trans_no has been modified"));
+       display_notification_centered(sprintf(_("Deposit %d has been modified"), $trans_no));
 
        display_note(get_gl_view_str($trans_type, $trans_no, _("&View the GL Postings for this Deposit")));
 
@@ -278,6 +278,8 @@ if (isset($_POST['Process']))
                set_focus('person_id');
                $input_error = 1;
        }
+       if (!db_has_currency_rates(get_bank_account_currency($_POST['bank_account']), $_POST['date_'], true))
+               $input_error = 1;
 
        if ($input_error == 1)
                unset($_POST['Process']);