include_once $path_to_root . "/includes/date_functions.inc"; include_once $path_to_root . "/includes/ui.inc"; include_once $path_to_root . "/sales/includes/sales_db.inc"; if (isset($_GET["trans_no"])) { $trans_id = $_GET["trans_no"]; } $receipt = get_customer_trans($trans_id, systypes::cust_payment()); display_heading(sprintf(tr("Customer Payment #%d"), $trans_id)); echo "<br>"; start_table("{$table_style} width=80%"); start_row(); label_cells(tr("From Customer"), $receipt['DebtorName'], "class='tableheader2'"); label_cells(tr("Into Bank Account"), $receipt['bank_account_name'], "class='tableheader2'"); label_cells(tr("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'"); end_row(); start_row(); label_cells(tr("Payment Currency"), $receipt['curr_code'], "class='tableheader2'"); label_cells(tr("Amount"), price_format($receipt['ov_amount']), "class='tableheader2'"); label_cells(tr("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'"); end_row(); start_row(); label_cells(tr("Payment Type"), $receipt['BankTransType'], "class='tableheader2'"); label_cells(tr("Reference"), $receipt['reference'], "class='tableheader2'", "colspan=4"); end_row(); comments_display_row(systypes::cust_payment(), $trans_id); end_table(1); $voided = is_voided_display(systypes::cust_payment(), $trans_id, tr("This customer payment has been voided.")); if (!$voided) { display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, -$receipt['Total']); } end_page(true);
label_cell($myrow2["StockDescription"]); qty_cell($myrow2["quantity"]); label_cell($myrow2["units"], "align=right"); amount_cell($myrow2["unit_price"]); label_cell($display_discount, "align=right"); amount_cell($value); end_row(); } //end while there are line items to print out } else { display_note(tr("There are no line items on this credit note."), 1, 2); } $display_sub_tot = price_format($sub_total); $display_freight = price_format($myrow["ov_freight"]); $credit_total = $myrow["ov_freight"] + $myrow["ov_gst"] + $myrow["ov_amount"] + $myrow["ov_freight_tax"]; $display_total = price_format($credit_total); /*Print out the invoice text entered */ if ($sub_total != 0) { label_row(tr("Sub Total"), $display_sub_tot, "colspan=6 align=right", "nowrap align=right width=15%"); } label_row(tr("Shipping"), $display_freight, "colspan=6 align=right", "nowrap align=right"); $tax_items = get_customer_trans_tax_details(11, $trans_id); display_customer_trans_tax_details($tax_items, 6); label_row("<font color=red>" . tr("TOTAL CREDIT") . "</font", "<font color=red>{$display_total}</font>", "colspan=6 align=right", "nowrap align=right"); end_table(1); $voided = is_voided_display(11, $trans_id, tr("This credit note has been voided.")); if (!$voided) { display_allocations_from(payment_person_types::customer(), $myrow['debtor_no'], 11, $trans_id, $credit_total); } /* end of check to see that there was an invoice record to print */ end_page(true);