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

include_once($path_to_root . "/includes/session.inc");

include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/inventory.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/assets/includes/db/stock_asset_transfers_inquiry_db.inc");
include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");

$js = "";
if ($SysPrefs->use_popup_windows)
	$js .= get_js_open_window(800, 500);
page(_($help_context = "View Stock Asset Transfer"), true, false, "", $js);

//-------------------------------------------------------------------------------------------------

$woid = 0;

if ($_GET['trans_no'] != "")
{
    $asset_material_issue_id = $_GET['trans_no'];
}

global $approval_statuses;

display_heading("Stock Asset Transfer ID: " . $asset_material_issue_id);
br();
$myrow = view_stock_asset_transfer($asset_material_issue_id);

start_table(TABLESTYLE2, "width=80%");

start_row();
label_cell("<b>General Details</b>", "colspan=2 align=center");
end_row();
label_cells(_("Reference"), $myrow['reference'], "class='tableheader2'");
end_row();
label_cells(_("Date"), sql2date($myrow['tran_date']), "class='tableheader2'");
end_row();
if($myrow["po_number"] > 0){
    label_cells(_("PO No"), get_supplier_trans_view_str(ST_PURCHORDER, $myrow["po_number"]), "class='tableheader2'");
}
else{
    label_cells(_("PO No"), '', "class='tableheader2'");
}
end_row();
label_cells(_("Comment"), $myrow['comment'], "class='tableheader2'");
end_row();
    if($myrow['is_return'] == 1){
        $return = "Return to Stock"; 
    }else{
        $return = "Move to Asset";
    }
label_cells(_("Type"), $return, "class='tableheader2'");
end_row();

start_row();
label_cell("<b>Stock Item</b>", "colspan=2 align=center");
end_row();
label_cells(_("Stock Item"), $myrow['stock_id']." - ".$myrow['stock_description'], "class='tableheader2'");
end_row();
label_cells(_("Stock Item Unit"), $myrow['tran_unit_name'], "class='tableheader2'");
end_row();
label_cells(_("Stock Item Qty."), number_format($myrow['tran_qty'],0), "class='tableheader2'");
end_row();
label_cells(_("Stock Item Location."), $myrow['stock_location_name'], "class='tableheader2'");
end_row();
label_cells(_("Stock Item (From) Project"), $myrow['stock_project_description'], "class='tableheader2'");
end_row(); 
label_cells(_("Stock Item (From) Budget"), $myrow['stock_task_description'], "class='tableheader2'");
end_row();

start_row();
label_cell("<b>Asset</b>", "colspan=2 align=center");
end_row();
label_cells(_("Asset"), $myrow['asset_code']." - ".$myrow['asset_description']." - "."(".$myrow['asset_id'].")", "class='tableheader2'");
end_row();
label_cells(_("Asset Quantity"), number_format($myrow['asset_quantity'],0), "class='tableheader2'");
end_row();
label_cells(_("Asset Value"), number_format($myrow['value'], 2), "class='tableheader2'");
end_row();
label_cells(_("Asset Location"), $myrow['asset_location_name'], "class='tableheader2'");
end_row();
label_cells(_("Asset (To) Project"), $myrow['asset_project_description'], "class='tableheader2'");
end_row(); 
label_cells(_("Asset (To) Budget"), $myrow['asset_task_description'], "class='tableheader2'");
end_row();
label_cells(_("Department"), $myrow['department_name'], "class='tableheader2'");
end_row();
label_cells(_("Job"), $myrow['site_description'], "class='tableheader2'");
end_row();
 
end_table(2);

end_page(true, false, false, ST_STOCK_ASSET_TRANSFER, $woid);


?>
