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 ***********************************************************************/
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 ($use_popup_windows)
22 $js .= get_js_open_window(900, 600);
24 page(_("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, systypes::cust_payment());
33 display_heading(sprintf(_("Customer Payment #%d"),$trans_id));
36 start_table("$table_style width=80%");
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'");
43 label_cells(_("Payment Currency"), $receipt['curr_code'], "class='tableheader2'");
44 label_cells(_("Amount"), price_format($receipt['Total'] - $receipt['ov_discount']), "class='tableheader2'");
45 label_cells(_("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
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");
52 comments_display_row(systypes::cust_payment(), $trans_id);
56 $voided = is_voided_display(systypes::cust_payment(), $trans_id, _("This customer payment has been voided."));
60 display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, $receipt['Total']);