Release 2.0.5
[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 include_once($path_to_root . "/includes/date_functions.inc");
8 include_once($path_to_root . "/includes/ui.inc");
9 include_once($path_to_root . "/sales/includes/sales_db.inc");
10
11 $js = "";
12 if ($use_popup_windows)
13         $js .= get_js_open_window(900, 600);
14
15 page(_("View Customer Payment"), true, false, "", $js);
16
17 if (isset($_GET["trans_no"]))
18 {
19         $trans_id = $_GET["trans_no"];
20 }
21
22 $receipt = get_customer_trans($trans_id, systypes::cust_payment());
23
24 display_heading(sprintf(_("Customer Payment #%d"),$trans_id));
25
26 echo "<br>";
27 start_table("$table_style width=80%");
28 start_row();
29 label_cells(_("From Customer"), $receipt['DebtorName'], "class='tableheader2'");
30 label_cells(_("Into Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
31 label_cells(_("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'");
32 end_row();
33 start_row();
34 label_cells(_("Payment Currency"), $receipt['curr_code'], "class='tableheader2'");
35 label_cells(_("Amount"), price_format($receipt['ov_amount']), "class='tableheader2'");
36 label_cells(_("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
37 end_row();
38 start_row();
39 label_cells(_("Payment Type"), $receipt['BankTransType'], "class='tableheader2'");
40 label_cells(_("Reference"), $receipt['reference'], "class='tableheader2'", "colspan=4");
41 end_row();
42 comments_display_row(systypes::cust_payment(), $trans_id);
43
44 end_table(1);
45
46 $voided = is_voided_display(systypes::cust_payment(), $trans_id, _("This customer payment has been voided."));
47
48 if (!$voided)
49 {
50         display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, $receipt['Total']);
51 }
52
53 end_page(true);
54 ?>