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");
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");
21 if ($SysPrefs->use_popup_windows)
22 $js .= get_js_open_window(900, 600);
24 page(_($help_context = "View Customer Payment"), true, false, "", $js);
26 if (isset($_GET["trans_no"]))
28 $trans_id = $_GET["trans_no"];
31 $receipt = get_customer_trans($trans_id, ST_CUSTPAYMENT);
33 if (!empty($SysPrefs->prefs['company_logo_on_views']))
34 company_logo_on_view();
36 display_heading(sprintf(_("Customer Payment #%d"),$trans_id));
39 start_table(TABLESTYLE, "width='80%'");
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'");
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'");
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'");
55 comments_display_row(ST_CUSTPAYMENT, $trans_id);
59 $voided = is_voided_display(ST_CUSTPAYMENT, $trans_id, _("This customer payment has been voided."));
63 display_allocations_from(PT_CUSTOMER, $receipt['debtor_no'], ST_CUSTPAYMENT, $trans_id, $receipt['Total']);
66 end_page(true, false, false, ST_CUSTPAYMENT, $trans_id);