Commit 6d565adf by Azhan Hannan

integration overhead form, public holiday

parent c4357f33
......@@ -928,7 +928,7 @@ class FormController extends Controller
->first();
$mcdetail->td_overhead_desc = $project->o_overhead_desc;
$mcdetail->td_overhead_note = 'Cuti Sakit';
$mcdetail->td_overhead_note = 'Medical Leave';
$mcdetail->td_hours = 8;
$mcdetail->td_timesheet_sts = 1;
$mcdetail->save();
......@@ -963,7 +963,7 @@ class FormController extends Controller
->first();
$eldetail->td_overhead_desc = $project->o_overhead_desc;
$eldetail->td_overhead_note = 'Cuti Kecemasan';
$eldetail->td_overhead_note = 'Emergency Leave';
$eldetail->td_hours = 8;
$eldetail->td_timesheet_sts = 1;
$eldetail->save();
......@@ -978,13 +978,13 @@ class FormController extends Controller
foreach ($halfday as $key => $value) {
if (data_get($value,'jenis_cuti') == 'AL(m)')
{
$checktdetailal = Ts_detail::where('td_date', data_get($value,'DATE'))
$checktdetailhd = Ts_detail::where('td_date', data_get($value,'DATE'))
->where('tm_staff_id', data_get($value,'staff_id'))
->where('fk_o_id', $al)
->where('fk_tm_id', $fk_tm_id)
->first();
if($checktdetailal)
if($checktdetailhd)
{
}
else
......@@ -1005,7 +1005,7 @@ class FormController extends Controller
->first();
$aldetail->td_overhead_desc = $project->o_overhead_desc;
$aldetail->td_overhead_note = 'Cuti Separuh Hari (Pagi)';
$aldetail->td_overhead_note = 'Halfday Leave (Morning)';
$aldetail->td_hours = 4;
$aldetail->td_timesheet_sts = 1;
$aldetail->save();
......@@ -1013,13 +1013,13 @@ class FormController extends Controller
}
else if (data_get($value,'jenis_cuti') == 'AL (e)')
{
$checktdetailal = Ts_detail::where('td_date', data_get($value,'DATE'))
$checktdetailhd = Ts_detail::where('td_date', data_get($value,'DATE'))
->where('tm_staff_id', data_get($value,'staff_id'))
->where('fk_o_id', $al)
->where('fk_tm_id', $fk_tm_id)
->first();
if($checktdetailal)
if($checktdetailhd)
{
}
else
......@@ -1040,7 +1040,7 @@ class FormController extends Controller
->first();
$aldetail->td_overhead_desc = $project->o_overhead_desc;
$aldetail->td_overhead_note = 'Cuti Separuh Hari (Petang)';
$aldetail->td_overhead_note = 'Halfday Leave (Evening)';
$aldetail->td_hours = 4;
$aldetail->td_timesheet_sts = 1;
$aldetail->save();
......@@ -1049,6 +1049,47 @@ class FormController extends Controller
}
}
$pubhol = $lat->where('attendance_status', 4);
// dd($pubhol);
if (count($pubhol) > 0) {
foreach ($pubhol as $key => $value) {
$checktdetailph = Ts_detail::where('td_date', data_get($value,'DATE'))
->where('tm_staff_id', data_get($value,'staff_id'))
->where('fk_o_id', $publichol)
->where('fk_tm_id', $fk_tm_id)
->first();
if($checktdetailph)
{
}
else
{
//create baru
$pbdetail = new Ts_detail;
$pbdetail->td_date = data_get($value,'DATE');
$pbdetail->fk_o_id = $publichol;
$pbdetail->fk_tm_id = $fk_tm_id;
$pbdetail->tm_staff_id = $userId;
$pbdetail->tm_month = $month;
$pbdetail->tm_year = $year;
$pbdetail->tm_phase = $phase;
$pbdetail->td_project_type = 3;
$pbdetail->updated_by = $userId;
$project = Overhead::where('id', $publichol)
->first();
$pbdetail->td_overhead_desc = $project->o_overhead_desc;
$pbdetail->td_overhead_note = 'Public Holiday';
$pbdetail->td_hours = 8;
$pbdetail->td_timesheet_sts = 1;
$pbdetail->save();
}
}
}
if($fk_tm_id)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment