Added company switch for placing company logo on certain views.
[fa-stable.git] / sales / view / view_receipt.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         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/gpl-3.0.html>.
11 ***********************************************************************/
12 $page_security = 'SA_SALESTRANSVIEW';
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 ($SysPrefs->use_popup_windows)
22         $js .= get_js_open_window(900, 600);
23
24 page(_($help_context = "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, ST_CUSTPAYMENT);
32
33 if (!empty($SysPrefs->prefs['company_logo_on_views']))
34         company_logo_on_view();
35
36 display_heading(sprintf(_("Customer Payment #%d"),$trans_id));
37
38 echo "<br>";
39 start_table(TABLESTYLE, "width='80%'");
40 start_row();
41 label_cells(_("From Customer"), $receipt['DebtorName'], "class='tableheader2'");
42 label_cells(_("Reference"), $receipt['reference'], "class='tableheader2'");
43 label_cells(_("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'");
44 end_row();
45 start_row();
46 label_cells(_("Customer Currency"), $receipt['curr_code'], "class='tableheader2'");
47 label_cells(_("Amount"), price_format($receipt['Total'] - $receipt['ov_discount']), "class='tableheader2'");
48 label_cells(_("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
49 end_row();
50 start_row();
51 label_cells(_("Into Bank Account"), $receipt['bank_account_name'].' ['.$receipt['bank_curr_code'].']', "class='tableheader2'");
52 label_cells(_("Bank Amount"), price_format($receipt['bank_amount']), "class='tableheader2'");
53 label_cells(_("Payment Type"), $bank_transfer_types[$receipt['BankTransType']], "class='tableheader2'");
54 end_row();
55 comments_display_row(ST_CUSTPAYMENT, $trans_id);
56
57 end_table(1);
58
59 $voided = is_voided_display(ST_CUSTPAYMENT, $trans_id, _("This customer payment has been voided."));
60
61 if (!$voided)
62 {
63         display_allocations_from(PT_CUSTOMER, $receipt['debtor_no'], ST_CUSTPAYMENT, $trans_id, $receipt['Total']);
64 }
65
66 end_page(true, false, false, ST_CUSTPAYMENT, $trans_id);