function display_bank_trans($yr, $mo, &$dec, &$rep, $dimension, $dimension2, $date)
{
    global $bank_account_types;
    $total = array(1 => 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $fill = 0;
    //Get Accounts directly under this group/type
    $result = get_bank_accounts();
    while ($account = db_fetch($result)) {
        $ctotal = array(1 => 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        $bal = getPeriods($yr, $mo, $account["id"], $dimension, $dimension2, true);
        $per = getPeriods($yr, $mo, $account["id"], $dimension, $dimension2);
        //_vd($bal);
        $is_home = is_company_currency($account['bank_curr_code']);
        $rep->row += 4;
        $rep->NewLine();
        $oldcMargin = $rep->GetCellPadding();
        $rep->SetCellPadding(0);
        $rep->SetCellPadding($oldcMargin);
        $rep->row += 1;
        $rep->Line($rep->row - 4);
        $rep->NewLine();
        $balance = array(1 => $bal['per01'], $bal['per02'], $bal['per03'], $bal['per04'], $bal['per05'], $bal['per06'], $bal['per07'], $bal['per08'], $bal['per09'], $bal['per10'], $bal['per11'], $bal['per12'], $bal['ytd'], $bal['mon12']);
        $period = array(1 => $per['per01'], $per['per02'], $per['per03'], $per['per04'], $per['per05'], $per['per06'], $per['per07'], $per['per08'], $per['per09'], $per['per10'], $per['per11'], $per['per12'], $per['ytd'], $per['mon12']);
        $rep->Font('b');
        $rep->TextCol(0, 3, $account['bank_account_name'] . " - " . $bank_account_types[$account['account_type']], 0, 4, 0, $fill, NULL, 1);
        $rep->Font();
        $rep->NewLine(2);
        $rep->TextCol(0, 1, _("Opening Balance"), 0, 4, 0, $fill, NULL, 1);
        for ($i = 1; $i <= 14; $i++) {
            if (!$is_home) {
                $balance[$i] = to_home_currency($balance[$i], $account['bank_curr_code'], $date);
            }
            $rep->AmountCol2($i, $i + 1, $balance[$i], $dec, 0, 4, 0, $fill, NULL, 1, true);
            $ctotal[$i] += $balance[$i];
        }
        $rep->NewLine(2);
        $rep->TextCol(0, 1, _("Net Cash Value"), 0, 4, 0, $fill, NULL, 1);
        for ($i = 1; $i <= 14; $i++) {
            if (!$is_home) {
                $period[$i] = to_home_currency($period[$i], $account['bank_curr_code'], $date);
            }
            $rep->AmountCol2($i, $i + 1, $period[$i], $dec, 0, 4, 0, $fill, NULL, 1, true);
            $ctotal[$i] += $period[$i];
        }
        $fill = !$fill;
        $rep->NewLine(2);
        $rep->TextCol(0, 1, _("Closing Balance"), 0, 4, 0, $fill, NULL, 1);
        for ($i = 1; $i <= 14; $i++) {
            $rep->AmountCol2($i, $i + 1, $ctotal[$i], $dec, 0, 4, 0, $fill, NULL, 1, true);
            $total[$i] += $ctotal[$i];
        }
    }
    $rep->Line($rep->row - 8);
    $rep->NewLine(2);
    $rep->TextCol(0, 1, _("Total Bank Accounts"), 0, 4, 0, $fill, NULL, 1);
    for ($i = 1; $i <= 14; $i++) {
        $rep->AmountCol2($i, $i + 1, $total[$i], $dec, 0, 4, 0, $fill, NULL, 1, true);
    }
}
Пример #2
0
        display_error(_("Cannot delete this bank account because POS definitions have been created using this account."));
    }
    if (!$cancel_delete) {
        delete_bank_account($selected_id);
        display_notification(_('Selected bank account has been deleted'));
    }
    //end if Delete bank account
    $Mode = 'RESET';
}
if ($Mode == 'RESET') {
    $selected_id = -1;
    $_POST['bank_name'] = $_POST['bank_account_name'] = '';
    $_POST['bank_account_number'] = $_POST['bank_address'] = '';
}
/* Always show the list of accounts */
$result = get_bank_accounts(check_value('show_inactive'));
start_form();
start_table(TABLESTYLE, "width='80%'");
$th = array(_("Account Name"), _("Type"), _("Currency"), _("GL Account"), _("Bank"), _("Number"), _("Bank Address"), _("Dflt"), '', '');
inactive_control_column($th);
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["bank_account_name"], "nowrap");
    label_cell($bank_account_types[$myrow["account_type"]], "nowrap");
    label_cell($myrow["bank_curr_code"], "nowrap");
    label_cell($myrow["account_code"] . " " . $myrow["account_name"], "nowrap");
    label_cell($myrow["bank_name"], "nowrap");
    label_cell($myrow["bank_account_number"], "nowrap");
    label_cell($myrow["bank_address"]);