597e02138387fc1dbe1dee8279e25b831521c0ff
[fa-stable.git] / sales / view / view_receipt.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU Affero General Public License,
5         AGPL, as published by the Free Software Foundation, either version 
6         3 of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
11 ***********************************************************************/
12 $page_security = 1;
13 $path_to_root="../..";
14 include_once($path_to_root . "/includes/session.inc");
15
16 include_once($path_to_root . "/includes/date_functions.inc");
17 include_once($path_to_root . "/includes/ui.inc");
18 include_once($path_to_root . "/sales/includes/sales_db.inc");
19
20 $js = "";
21 if ($use_popup_windows)
22         $js .= get_js_open_window(900, 600);
23
24 page(_("View Customer Payment"), true, false, "", $js);
25
26 if (isset($_GET["trans_no"]))
27 {
28         $trans_id = $_GET["trans_no"];
29 }
30
31 $receipt = get_customer_trans($trans_id, systypes::cust_payment());
32
33 display_heading(sprintf(_("Customer Payment #%d"),$trans_id));
34
35 echo "<br>";
36 start_table("$table_style width=80%");
37 start_row();
38 label_cells(_("From Customer"), $receipt['DebtorName'], "class='tableheader2'");
39 label_cells(_("Into Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
40 label_cells(_("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'");
41 end_row();
42 start_row();
43 label_cells(_("Payment Currency"), $receipt['curr_code'], "class='tableheader2'");
44 label_cells(_("Amount"), price_format($receipt['ov_amount']), "class='tableheader2'");
45 label_cells(_("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
46 end_row();
47 start_row();
48 label_cells(_("Payment Type"), 
49         bank_account_types::transfer_type($receipt['BankTransType']), "class='tableheader2'");
50 label_cells(_("Reference"), $receipt['reference'], "class='tableheader2'", "colspan=4");
51 end_row();
52 comments_display_row(systypes::cust_payment(), $trans_id);
53
54 end_table(1);
55
56 $voided = is_voided_display(systypes::cust_payment(), $trans_id, _("This customer payment has been voided."));
57
58 if (!$voided)
59 {
60         display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, $receipt['Total']);
61 }
62
63 end_page(true);
64 ?>