Commit b9ec660e by Azhan Hannan

Annual Leave

parent 6d565adf
......@@ -969,6 +969,41 @@ class FormController extends Controller
$eldetail->save();
}
}
else if (data_get($value,'jenis_cuti') == 'AL')
{
$checktdetailal = 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)
{
}
else
{
//create baru
$aldetail = new Ts_detail;
$aldetail->td_date = data_get($value,'DATE');
$aldetail->fk_o_id = $al;
$aldetail->fk_tm_id = $fk_tm_id;
$aldetail->tm_staff_id = $userId;
$aldetail->tm_month = $month;
$aldetail->tm_year = $year;
$aldetail->tm_phase = $phase;
$aldetail->td_project_type = 3;
$aldetail->updated_by = $userId;
$project = Overhead::where('id', $al)
->first();
$aldetail->td_overhead_desc = $project->o_overhead_desc;
$aldetail->td_overhead_note = 'Annual Leave';
$aldetail->td_hours = 8;
$aldetail->td_timesheet_sts = 1;
$aldetail->save();
}
}
}
}
......
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