<?php

function display_job_order_status_view($jo_id) {
    global $systypes_array;
    $tp_name = $systypes_array[ST_JOB_ORDER];
    
        display_heading("$tp_name #$jo_id");        br();
    
        view_job_order_header($jo_id);
    
        start_outer_table(false, "width=100%");

            echo "<td>";
                display_heading("$tp_name Costs");  br(1);
                display_job_order_status_costs_view($jo_id);
            echo "</td><td>";
                display_heading("$tp_name Requisitions");  br(1);
                display_job_order_status_requisitions_view($jo_id);
            echo "</td>";

        start_outer_table(false, "width=100%");
            view_job_activity_details_by_jo_id($jo_id, 95);
        end_outer_table(2);
}

function display_job_order_status_costs_view($jo_id) {
    
    view_job_material_issue_return_headers_by_jo_id($jo_id, ST_JOB_MATERIAL_ISSUE, 95);
    
    view_job_material_issue_return_headers_by_jo_id($jo_id, ST_JOB_MATERIAL_RETURN, 95);
    
    view_personal_material_issue_headers_by_jo_id($jo_id, ST_PERSONAL_MATERIAL_ISSUE, 95);
    
    view_personal_material_issue_headers_by_jo_id($jo_id, ST_PERSONAL_MATERIAL_RETURN, 95);
    
    view_job_manual_cost_headers_by_jo_id($jo_id, ST_JOB_MANUAL_COST, 95);
    
    view_job_manual_cost_headers_by_jo_id($jo_id, ST_JOB_MANUAL_COST_RETURN, 95);
    
    view_job_order_labour_by_jo_id($jo_id, 95);
    
    view_budget_to_budget_borrowed_headers_by_jo_id($jo_id, 95);
    
    view_budget_to_budget_lent_headers_by_jo_id($jo_id, 95);
}

function display_job_order_status_requisitions_view($jo_id) {
    
    view_job_order_repairs($jo_id, 95);
    
    view_material_list_headers_by_jo_id($jo_id, ST_MATERIAL_LIST, 95);
    
    view_job_material_requisition_headers_by_jo_id($jo_id, ST_JOB_MATERIAL_REQ, 95);
    
    view_job_material_issue_requisition_return_headers_by_jo_id($jo_id, ST_JOB_MATERIAL_ISSUE_REQ, 95);
    
    view_direct_purchase_requisition_headers_by_jo_id($jo_id, ST_DIRECT_PURCHASE_REQ, 95);
    
    view_quality_check_headers_by_jo_id($jo_id, ST_QUALITY_CHECK, 95);
    
    view_quality_check_headers_by_jo_id($jo_id, ST_DIRECT_PURCHASE_RECEIPT, 95);
    
    view_quality_check_headers_by_jo_id($jo_id, ST_DIRECT_PURCHASE_RETURN, 95);
    
    view_outside_material_requisition_headers_by_jo_id($jo_id, ST_OUTSIDE_MATERIAL_REQ, 95);
    
    view_outside_material_receipt_return_headers_by_jo_id($jo_id, ST_OUTSIDE_MATERIAL_RECEIPT, 95);
    
    view_outside_material_return_headers_by_jo_id($jo_id, ST_OUTSIDE_MATERIAL_RETURN, 95);
    
    display_job_order_sub_jobs($jo_id, 95, true);
    
    view_salvage_return_headers_by_jo_id($jo_id, ST_SALVAGE_RETURN, 95);
}

?>