6 include($path_to_root . "/includes/session.inc");
8 include_once($path_to_root . "/includes/ui.inc");
9 include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
11 if ($use_popup_windows)
12 $js .= get_js_open_window(900, 500);
13 page(_("View Payment to Supplier"), true, false, "", $js);
15 if (isset($_GET["trans_no"]))
17 $trans_no = $_GET["trans_no"];
20 $receipt = get_supp_trans($trans_no, 22);
22 $company_currency = get_company_currency();
24 $show_currencies = false;
25 $show_both_amounts = false;
27 if (($receipt['bank_curr_code'] != $company_currency) || ($receipt['SupplierCurrCode'] != $company_currency))
28 $show_currencies = true;
30 if ($receipt['bank_curr_code'] != $receipt['SupplierCurrCode'])
32 $show_currencies = true;
33 $show_both_amounts = true;
38 display_heading(_("Payment to Supplier") . " #$trans_no");
41 start_table("$table_style2 width=80%");
44 label_cells(_("To Supplier"), $receipt['supplier_name'], "class='tableheader2'");
45 label_cells(_("From Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
46 label_cells(_("Date Paid"), sql2date($receipt['tran_date']), "class='tableheader2'");
50 label_cells(_("Payment Currency"), $receipt['bank_curr_code'], "class='tableheader2'");
51 label_cells(_("Amount"), number_format2(-$receipt['BankAmount'], user_price_dec()), "class='tableheader2'");
52 label_cells(_("Payment Type"), $receipt['BankTransType'], "class='tableheader2'");
57 label_cells(_("Supplier's Currency"), $receipt['SupplierCurrCode'], "class='tableheader2'");
59 if ($show_both_amounts)
60 label_cells(_("Amount"), number_format2(-$receipt['ov_amount'], user_price_dec()), "class='tableheader2'");
61 label_cells(_("Reference"), $receipt['ref'], "class='tableheader2'");
63 comments_display_row(22, $trans_no);
67 $voided = is_voided_display(22, $trans_no, _("This payment has been voided."));
69 // now display the allocations for this payment
72 display_allocations_from(payment_person_types::supplier(), $receipt['supplier_id'], 22, $trans_no, -$receipt['ov_amount']);