Commit 8169db45 by Azhan Hannan

integration webtas -> attendance_status = 3, training

parent b9ec660e
......@@ -885,15 +885,13 @@ class FormController extends Controller
->groupby('DATE')
->get();
// $lat = [];
// dd($lat);
$leave = $lat->where('attendance_status', 2);
// dd($checklat);
$publichol = 6;
$mc = 8;
$el = 10;
$al = 7;
$tr = 5;
if (count($leave) > 0) {
foreach ($leave as $key => $value)
......@@ -1084,6 +1082,46 @@ class FormController extends Controller
}
}
$training = $lat->where('attendance_status', 3);
// dd($pubhol);
if (count($training) > 0) {
foreach ($training as $key => $value) {
$checktdetailtr = Ts_detail::where('td_date', data_get($value,'DATE'))
->where('tm_staff_id', data_get($value,'staff_id'))
->where('fk_o_id', $tr)
->where('fk_tm_id', $fk_tm_id)
->first();
if($checktdetailtr)
{
}
else
{
//create baru
$trdetail = new Ts_detail;
$trdetail->td_date = data_get($value,'DATE');
$trdetail->fk_o_id = $tr;
$trdetail->fk_tm_id = $fk_tm_id;
$trdetail->tm_staff_id = $userId;
$trdetail->tm_month = $month;
$trdetail->tm_year = $year;
$trdetail->tm_phase = $phase;
$trdetail->td_project_type = 3;
$trdetail->updated_by = $userId;
$project = Overhead::where('id', $tr)
->first();
$trdetail->td_overhead_desc = $project->o_overhead_desc;
$trdetail->td_overhead_note = 'Public Holiday';
$trdetail->td_hours = 8;
$trdetail->td_timesheet_sts = 1;
$trdetail->save();
}
}
}
$pubhol = $lat->where('attendance_status', 4);
// dd($pubhol);
if (count($pubhol) > 0) {
......@@ -1124,8 +1162,6 @@ class FormController extends Controller
}
}
if($fk_tm_id)
{
$hour = Ts_detail::where('fk_tm_id',$checkoverhead->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