Allowed multiply bank accounts on same gl account, removed bank trans type.
[fa-stable.git] / sales / view / view_receipt.php
1 <?php
2
3 $page_security = 1;
4 $path_to_root="../..";
5 include_once($path_to_root . "/includes/session.inc");
6
7 page(_("View Customer Payment"), true);
8
9 include_once($path_to_root . "/includes/date_functions.inc");
10 include_once($path_to_root . "/includes/ui.inc");
11 include_once($path_to_root . "/sales/includes/sales_db.inc");
12
13 if (isset($_GET["trans_no"]))
14 {
15         $trans_id = $_GET["trans_no"];
16 }
17
18 $receipt = get_customer_trans($trans_id, systypes::cust_payment());
19
20 display_heading(sprintf(_("Customer Payment #%d"),$trans_id));
21
22 echo "<br>";
23 start_table("$table_style width=80%");
24 start_row();
25 label_cells(_("From Customer"), $receipt['DebtorName'], "class='tableheader2'");
26 label_cells(_("Into Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
27 label_cells(_("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'");
28 end_row();
29 start_row();
30 label_cells(_("Payment Currency"), $receipt['curr_code'], "class='tableheader2'");
31 label_cells(_("Amount"), price_format($receipt['ov_amount']), "class='tableheader2'");
32 label_cells(_("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
33 end_row();
34 start_row();
35 label_cells(_("Payment Type"), 
36         bank_account_types::transfer_type($receipt['BankTransType']), "class='tableheader2'");
37 label_cells(_("Reference"), $receipt['reference'], "class='tableheader2'", "colspan=4");
38 end_row();
39 comments_display_row(systypes::cust_payment(), $trans_id);
40
41 end_table(1);
42
43 $voided = is_voided_display(systypes::cust_payment(), $trans_id, _("This customer payment has been voided."));
44
45 if (!$voided)
46 {
47         display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, $receipt['Total']);
48 }
49
50 end_page(true);
51 ?>