function edit_param()
 {
     $_POST['data_filter'] = $this->data_filter;
     $_POST['days_past'] = $this->days_past;
     $_POST['days_future'] = $this->days_future;
     $_POST['bank_act'] = $this->bank_act;
     text_row_ex(_("Days in past:"), 'days_past', 2);
     text_row_ex(_("Days in future:"), 'days_future', 2);
     bank_accounts_list_cells(_("Account:"), 'bank_act', null);
     text_row_ex(_("Filter:"), 'data_filter', 50);
 }
 function edit_param()
 {
     $graph_types = array('LineChart' => _("Line Chart"), 'ColumnChart' => _("Column Chart"), 'Table' => _("Table"));
     $_POST['days_past'] = $this->days_past;
     $_POST['days_future'] = $this->days_future;
     $_POST['bank_act'] = $this->bank_act;
     $_POST['graph_type'] = $this->graph_type;
     text_row_ex(_("Days in past:"), 'days_past', 2);
     text_row_ex(_("Days in future:"), 'days_future', 2);
     bank_accounts_list_cells(_("Account:"), 'bank_act', null);
     select_row(_("Graph Type"), "graph_type", null, $graph_types, null);
 }
if (isset($_POST['Reconcile'])) {
    set_focus('bank_date');
    foreach ($_POST['last'] as $id => $value) {
        if ($value != check_value('rec_' . $id)) {
            if (!change_tpl_flag($id)) {
                break;
            }
        }
    }
    $Ajax->activate('_page_body');
}
//------------------------------------------------------------------------------------------------
start_form();
start_table(TABLESTYLE_NOBORDER);
start_row();
bank_accounts_list_cells(_("Account:"), 'bank_account', null, true);
bank_reconciliation_list_cells(_("Bank Statement:"), get_post('bank_account'), 'bank_date', null, true, _("New"));
end_row();
end_table();
$result = get_max_reconciled(get_post('reconcile_date'), $_POST['bank_account']);
if ($row = db_fetch($result)) {
    $_POST["reconciled"] = price_format($row["end_balance"] - $row["beg_balance"]);
    $total = $row["total"];
    if (!isset($_POST["beg_balance"])) {
        // new selected account/statement
        $_POST["last_date"] = sql2date($row["last_date"]);
        $_POST["beg_balance"] = price_format($row["beg_balance"]);
        $_POST["end_balance"] = price_format($row["end_balance"]);
        if (get_post('bank_date')) {
            // if it is the last updated bank statement retrieve ending balance
            $row = get_ending_reconciled($_POST['bank_account'], $_POST['bank_date']);
Exemplo n.º 4
0
include_once $path_to_root . "/gl/includes/gl_db.inc";
include_once $path_to_root . "/includes/banking.inc";
$js = "";
if ($use_popup_windows) {
    $js .= get_js_open_window(800, 500);
}
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
page(tr("Bank Statement"), false, false, "", $js);
check_db_has_bank_accounts(tr("There are no bank accounts defined in the system."));
//------------------------------------------------------------------------------------------------
start_form();
start_table("class='tablestyle_noborder'");
start_row();
bank_accounts_list_cells(tr("Account:"), 'bank_account', null);
date_cells(tr("From:"), 'TransAfterDate', null, -30);
date_cells(tr("To:"), 'TransToDate');
submit_cells('Show', tr("Show"));
end_row();
end_table();
end_form();
//------------------------------------------------------------------------------------------------
$date_after = date2sql($_POST['TransAfterDate']);
$date_to = date2sql($_POST['TransToDate']);
if (!isset($_POST['bank_account'])) {
    $_POST['bank_account'] = "";
}
$sql = "SELECT bank_trans.*,name AS BankTransType " . "FROM bank_trans, bank_trans_types " . "WHERE bank_trans.bank_act = '" . $_POST['bank_account'] . "'" . "AND trans_date >= '{$date_after}' " . "AND trans_date <= '{$date_to}' " . "AND bank_trans_types.id = bank_trans.bank_trans_type_id " . "ORDER BY trans_date,bank_trans.id";
$result = db_query($sql, "The transactions for '" . $_POST['bank_account'] . "' could not be retrieved");
$act = get_bank_account($_POST["bank_account"]);