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); } }
} } //--------------------------------------------------------------------------------------------- if (isset($_GET['delete'])) { handle_delete(); } //--------------------------------------------------------------------------------------------- echo "<center>"; start_form(false, true); if (!isset($_POST['curr_abrev'])) { $_POST['curr_abrev'] = get_global_curr_code(); } echo tr("Select a currency :") . " "; currencies_list('curr_abrev', $_POST['curr_abrev'], true); // if currency sel has changed, clear the form if ($_POST['curr_abrev'] != get_global_curr_code()) { clear_data(); $selected_id = ""; } set_global_curr_code($_POST['curr_abrev']); if (is_company_currency($_POST['curr_abrev'])) { display_note(tr("The selected currency is the company currency."), 2); display_note(tr("The company currency is the base currency so exchange rates cannot be set for it."), 1); } else { display_rates($_POST['curr_abrev']); hyperlink_no_params($_SERVER['PHP_SELF'], tr("Enter a New Exchange Rate")); br(1); display_rate_edit(); } end_form(); end_page();
} $supp_trans = new supp_trans(ST_SUPPINVOICE); read_supp_invoice($trans_no, ST_SUPPINVOICE, $supp_trans); $supplier_curr_code = get_supplier_currency($supp_trans->supplier_id); display_heading(_("SUPPLIER INVOICE") . " # " . $trans_no); echo "<br>"; start_table(TABLESTYLE, "width=95%"); start_row(); label_cells(_("Supplier"), $supp_trans->supplier_name, "class='tableheader2'"); label_cells(_("Reference"), $supp_trans->reference, "class='tableheader2'"); label_cells(_("Supplier's Reference"), $supp_trans->supp_reference, "class='tableheader2'"); end_row(); start_row(); label_cells(_("Invoice Date"), $supp_trans->tran_date, "class='tableheader2'"); label_cells(_("Due Date"), $supp_trans->due_date, "class='tableheader2'"); if (!is_company_currency($supplier_curr_code)) { label_cells(_("Currency"), $supplier_curr_code, "class='tableheader2'"); } end_row(); comments_display_row(ST_SUPPINVOICE, $trans_no); end_table(1); $total_gl = display_gl_items($supp_trans, 2); $total_grn = display_grn_items($supp_trans, 2); $display_sub_tot = number_format2($total_gl + $total_grn, user_price_dec()); start_table(TABLESTYLE, "width=95%"); label_row(_("Sub Total"), $display_sub_tot, "align=right", "nowrap align=right width=15%"); $tax_items = get_trans_tax_details(ST_SUPPINVOICE, $trans_no); display_supp_trans_tax_details($tax_items, 1); $display_total = number_format2($supp_trans->ov_amount + $supp_trans->ov_gst, user_price_dec()); label_row(_("TOTAL INVOICE"), $display_total, "colspan=1 align=right", "nowrap align=right"); end_table(1);