From: Joe Hunt Date: Sun, 3 Apr 2011 21:58:41 +0000 (+0200) Subject: Display bank balance in payment forms. X-Git-Tag: 2.3-final~723 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=da774ae85617b051675afe581f413da78febfc0f;p=fa-stable.git Display bank balance in payment forms. --- diff --git a/gl/bank_transfer.php b/gl/bank_transfer.php index a9f99def..89ba5fc7 100644 --- a/gl/bank_transfer.php +++ b/gl/bank_transfer.php @@ -65,6 +65,8 @@ function gl_payment_controls() 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); diff --git a/gl/includes/ui/gl_bank_ui.inc b/gl/includes/ui/gl_bank_ui.inc index 6454edbd..b1031a96 100644 --- a/gl/includes/ui/gl_bank_ui.inc +++ b/gl/includes/ui/gl_bank_ui.inc @@ -21,7 +21,10 @@ function display_bank_header(&$order) 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%"); diff --git a/gl/inquiry/bank_inquiry.php b/gl/inquiry/bank_inquiry.php index 65a691fd..b264fe7f 100644 --- a/gl/inquiry/bank_inquiry.php +++ b/gl/inquiry/bank_inquiry.php @@ -25,7 +25,7 @@ if ($use_popup_windows) $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.")); @@ -38,6 +38,9 @@ if (get_post('Show')) } //------------------------------------------------------------------------------------------------ +if (isset($_GET['bank_account'])) + $_POST['bank_account'] = $_GET['bank_account']; + start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 1889962d..1e966a1a 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -931,4 +931,18 @@ function supplier_credit_row($supplier, $credit, $parms='') ."", $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:"), + " " + . price_format($bal) + ."", $parms); +} + ?> \ No newline at end of file diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index 5421ee40..276a821c 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -275,6 +275,8 @@ start_form(); 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);