<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_ITEMSTRANSVIEW';
$path_to_root = "../..";

include($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc"); 
include_once($path_to_root . "/sales/includes/ui/pos_invoice_ui.inc");
include_once($path_to_root . "/sales/includes/db/pos_invoice_db.inc");
include_once($path_to_root . "/sales/includes/ui/pos_customer_payments_ui.inc"); 
include_once($path_to_root . "/sales/includes/db/pos_customer_payments_db.inc");

$js = "";
$js .= get_js_open_window(800, 500);

global $systypes_array;

page(_($help_context = "POS Invoice"), true, false, "", $js);

if (isset($_GET["trans_no"])) {
    $trans_no = $_GET["trans_no"];
}
if (isset($_GET["trans_type"])) {
    $trans_type = $_GET["trans_type"];
}

    display_heading($systypes_array[$trans_type]." #$trans_no");
    
    br(1);

    view_pos_invoice_header($trans_type, $trans_no);

    display_heading("Details");

    view_pos_invoice_details($trans_type, $trans_no);
    
    if ($trans_type == ST_POS_INVOICE) {
        display_heading($systypes_array[ST_POS_CUSTOMER_PAYMENT]."s");
    } else {
        display_heading($systypes_array[ST_POS_CUSTOMER_RETURN]."s");
    }

    view_pos_customer_payments_by_source_type_source_trans_no($trans_type, $trans_no);
    
end_page(true, false, false, $trans_type, $trans_no);

?>