+ $limit = get_bank_account_limit($_POST['FromBankAccount'], $_POST['DatePaid']);
+
+ $amnt_tr = input_num('charge') + input_num('amount');
+
+ $problemTransaction = null;
+ if ($trans_no) {
+ $problemTransaction = check_bank_transfer( $trans_no, $_POST['FromBankAccount'], $_POST['ToBankAccount'], $_POST['DatePaid'],
+ $amnt_tr, input_num('target_amount', $amnt_tr));
+
+ if ($problemTransaction != null ) {
+ if (!array_key_exists('trans_no', $problemTransaction)) {
+ display_error(sprintf(
+ _("This bank transfer change would result in exceeding authorized overdraft limit (%s) of the account '%s'"),
+ price_format(-$problemTransaction['amount']), $problemTransaction['bank_account_name']
+ ));
+ } else {
+ display_error(sprintf(
+ _("This bank transfer change would result in exceeding authorized overdraft limit on '%s' for transaction: %s #%s on %s."),
+ $problemTransaction['bank_account_name'], $systypes_array[$problemTransaction['type']],
+ $problemTransaction['trans_no'], sql2date($problemTransaction['trans_date'])
+ ));
+ }
+ set_focus('amount');