*** empty log message ***
[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(_("Customer Payment") . " #$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"), number_format2(-$receipt['ov_amount'], user_price_dec()), "class='tableheader2'");
32 label_cells(_("Discount"), number_format2(-$receipt['ov_discount'], user_price_dec()), "class='tableheader2'");
33 end_row();
34 start_row();
35 label_cells(_("Payment Type"), $receipt['BankTransType'], "class='tableheader2'");
36 label_cells(_("Reference"), $receipt['reference'], "class='tableheader2'", "colspan=4");
37 end_row();
38 comments_display_row(systypes::cust_payment(), $trans_id);
39
40 end_table(1);
41
42 $voided = is_voided_display(systypes::cust_payment(), $trans_id, _("This customer payment has been voided."));
43
44 if (!$voided)
45 {
46         display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, -$receipt['Total']);
47 }
48
49 end_page(true);
50 ?>