bank_accounts_list_row(_("From Account:"), 'FromBankAccount', null, true);
+ bank_balance_row($_POST['FromBankAccount']);
+
bank_accounts_list_row(_("To Account:"), 'ToBankAccount', null, true);
date_row(_("Transfer Date:"), 'DatePaid', '', null, 0, 0, 0, null, true);
table_section(1);
bank_accounts_list_row( $payment ? _("From:") : _("To:"), 'bank_account', null, true);
-
+
+ if ($payment)
+ bank_balance_row($_POST['bank_account']);
+
date_row(_("Date:"), 'date_', '', true, 0, 0, 0, null, true);
table_section(2, "33%");
$js .= get_js_open_window(800, 500);
if ($use_date_picker)
$js .= get_js_date_picker();
-page(_($help_context = "Bank Statement"), false, false, "", $js);
+page(_($help_context = "Bank Statement"), isset($_GET['bank_account']), false, "", $js);
check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
}
//------------------------------------------------------------------------------------------------
+if (isset($_GET['bank_account']))
+ $_POST['bank_account'] = $_GET['bank_account'];
+
start_form();
start_table(TABLESTYLE_NOBORDER);
start_row();
."</a>", $parms);
}
+function bank_balance_row($bank_acc, $parms='')
+{
+ global $path_to_root;
+
+ $to = add_days(Today(), 1);
+ $bal = get_balance_before_for_bank_account($bank_acc, $to);
+ label_row( _("Bank Balance:"),
+ "<a target='_blank' " . ($bal<0 ? 'class="redfg"' : '')
+ ."href='$path_to_root/gl/inquiry/bank_inquiry.php?bank_account=".$bank_acc."'"
+ ." onclick=\"javascript:openWindow(this.href,this.target); return false;\" > "
+ . price_format($bal)
+ ."</a>", $parms);
+}
+
?>
\ No newline at end of file
set_global_supplier($_POST['supplier_id']);
bank_accounts_list_row(_("From Bank Account:"), 'bank_account', null, true);
+
+ bank_balance_row($_POST['bank_account']);
table_section(2);