@ -53,7 +53,8 @@ class ProjectController extends Controller
'mulai_proyek' => 'required',
'akhir_proyek' => 'required',
'rencana_biaya' => 'required',
'type_proyek_id' => 'required'
'type_proyek_id' => 'required',
'value_proyek' => 'required'
]);
$data = $request->all();
@ -602,16 +603,16 @@ class ProjectController extends Controller
->value('end_date');
if(isset($payload['till_date'])) {
if (isset($payload['scurve'])) {
$overdueActivities = Activity::where('proyek_id', $payload['id'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->whereDate('end_date','< =',$endDate)->orderBy('end_date', 'asc')->get();
$overdueActivities = Activity::join('m_version_gantt', 'm_activity.version_gantt_id', '=', 'm_version_gantt.id')-> where('m_activity. proyek_id', $payload['id'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->whereDate('end_date','< =',$endDate)->orderBy('end_date', 'asc')->get();
} else {
$overdueActivities = Activity::where('version_gantt_id', $payload['gantt'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->whereDate('end_date','< =',$endDate)->orderBy('end_date', 'asc')->get();
$overdueActivities = Activity::join('m_version_gantt', 'm_activity.version_gantt_id', '=', 'm_version_gantt.id')-> where('version_gantt_id', $payload['gantt'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->whereDate('end_date','< =',$endDate)->orderBy('end_date', 'asc')->get();
}
}
else {
if (isset($payload['scurve'])) {
$overdueActivities = Activity::where('proyek_id', $payload['id'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->orderBy('end_date', 'asc')->get();
$overdueActivities = Activity::join('m_version_gantt', 'm_activity.version_gantt_id', '=', 'm_version_gantt.id')-> where('m_activity. proyek_id', $payload['id'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->orderBy('end_date', 'asc')->get();
} else {
$overdueActivities = Activity::where('version_gantt_id', $payload['gantt'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->orderBy('end_date', 'asc')->get();
$overdueActivities = Activity::join('m_version_gantt', 'm_activity.version_gantt_id', '=', 'm_version_gantt.id')-> where('version_gantt_id', $payload['gantt'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->orderBy('end_date', 'asc')->get();
}
}
$result->overdueActivities = $overdueActivities;