common_cycle::jobs($_GET['id']);
common_main_header::get_header();
$context = array(
"id" => $_GET['id'],
"note_num"=>$num_notes,
"tasks" => $tasks,
"approvals" => $approvals,
"actions" => $actions,
);
$job_details = common_jobs::get_details($_GET['id']);
$quote_id = $job_details['quote_id'];
$error = false;
if( $_POST['ptp'] ) {
if( $_POST['ptp'] == 'Cancel PTP' ) {
common_jobs::proceed_to_production($_GET['id'], 0);
} else {
$materials = common_materials::get_quote_materials_job( $quote_id );
$time = common_job_trackings::has_job_budget( $quote_id );
if($materials && $time) {
common_jobs::proceed_to_production($_GET['id']);
} else {
$error = true;
}
}
}
$jobs = new views_job_overview($context);
$jobs->set();
$jobs->production_job_overview();
//only if the job has material and labour, then PTP is allowed.
if( $error ) {
confirmation::error_temp("Process to production. PTP is only available when suffient labour and material budget provided. ");
}
$obj = new views_jobs($context);
$obj->set()->view();
?>
$context = array("id" => $quote_id,"type" => "quotes");
$req = new form_job_requirements($context);
$req->set()->form();
?>