@ -53,7 +53,8 @@ class ProjectController extends Controller
'mulai_proyek' => 'required',
'mulai_proyek' => 'required',
'akhir_proyek' => 'required',
'akhir_proyek' => 'required',
'rencana_biaya' => 'required',
'rencana_biaya' => 'required',
'type_proyek_id' => 'required'
'type_proyek_id' => 'required',
'value_proyek' => 'required'
]);
]);
$data = $request->all();
$data = $request->all();
@ -543,7 +544,7 @@ class ProjectController extends Controller
$maxEndDate = Activity::where('proyek_id', $id)->select('end_date')
$maxEndDate = Activity::where('proyek_id', $id)->select('end_date')
->orderBy('end_date', 'desc')
->orderBy('end_date', 'desc')
->first();
->first();
}else{
}else{
// $actualEndExist = Activity::where('version_gantt_id', $ganttId)->exists();
// $actualEndExist = Activity::where('version_gantt_id', $ganttId)->exists();
$maxEndDate = Activity::where('version_gantt_id', $ganttId)->select('end_date')
$maxEndDate = Activity::where('version_gantt_id', $ganttId)->select('end_date')
@ -602,16 +603,16 @@ class ProjectController extends Controller
->value('end_date');
->value('end_date');
if(isset($payload['till_date'])) {
if(isset($payload['till_date'])) {
if (isset($payload['scurve'])) {
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 {
} 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 {
else {
if (isset($payload['scurve'])) {
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 {
} 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;
$result->overdueActivities = $overdueActivities;