6 include($path_to_root . "/includes/session.inc");
8 page(_("View Bank Deposit"), true);
10 include_once($path_to_root . "/includes/date_functions.inc");
11 include_once($path_to_root . "/includes/ui.inc");
13 include_once($path_to_root . "/gl/includes/gl_db.inc");
15 if (isset($_GET["trans_no"]))
17 $trans_no = $_GET["trans_no"];
20 // get the pay-to bank payment info
21 $result = get_bank_trans(systypes::bank_deposit(), $trans_no);
23 if (db_num_rows($result) != 1)
24 display_db_error("duplicate payment bank transaction found", "");
26 $to_trans = db_fetch($result);
28 $company_currency = get_company_currency();
30 $show_currencies = false;
32 if ($to_trans['bank_curr_code'] != $company_currency)
34 $show_currencies = true;
39 display_heading(_("GL Deposit") . " #$trans_no");
42 start_table("$table_style width=80%");
55 label_cells(_("To Bank Account"), $to_trans['bank_account_name'], "class='tableheader2'");
57 label_cells(_("Currency"), $to_trans['bank_curr_code'], "class='tableheader2'");
58 label_cells(_("Amount"), number_format2($to_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
59 label_cells(_("Date"), sql2date($to_trans['trans_date']), "class='tableheader2'");
62 label_cells(_("From"), payment_person_types::person_name($to_trans['person_type_id'], $to_trans['person_id']), "class='tableheader2'", "colspan=$colspan1");
63 label_cells(_("Deposit Type"), $to_trans['BankTransType'], "class='tableheader2'");
66 label_cells(_("Reference"), $to_trans['ref'], "class='tableheader2'", "colspan=$colspan2");
68 comments_display_row(systypes::bank_deposit(), $trans_no);
72 is_voided_display(systypes::bank_deposit(), $trans_no, _("This deposit has been voided."));
74 $items = get_gl_trans(systypes::bank_deposit(), $trans_no);
76 if (db_num_rows($items) == 0)
78 display_note(_("There are no items for this deposit."));
83 display_heading2(_("Items for this Deposit"));
85 display_heading2(_("Item Amounts are Shown in :") . " " . $company_currency);
87 start_table("$table_style width=80%");
88 $th = array(_("Account Code"), _("Account Description"),
89 _("Amount"), _("Memo"));
92 $k = 0; //row colour counter
95 while ($item = db_fetch($items))
98 if ($item["account"] != $to_trans["account_code"])
100 alt_table_row_color($k);
102 label_cell($item["account"]);
103 label_cell($item["account_name"]);
104 amount_cell(abs($item["amount"]));
105 label_cell($item["memo_"]);
107 $total_amount += abs($item["amount"]);
111 label_row(_("Total"), number_format2($total_amount, user_price_dec()),"colspan=2 align=right", "align=right");
115 display_allocations_from($to_trans['person_type_id'], $to_trans['person_id'], 2, $trans_no, $to_trans['amount']);