Commit 088f7387 by Azhan Hannan

filter timesheet viewer, only notes with hours appeared. handle deleted hours.…

filter timesheet viewer, only notes with hours appeared. handle deleted hours. overhead form, nullify zeroed hours.
parent 5a77d066
......@@ -540,7 +540,7 @@ class DashboardController extends Controller
->where('fk_tm_id', $check->id)
->where('tm_staff_id', $user->staff_id)
->where('td_project_type', $overhead)
->whereNotNull('td_overhead_note')
->whereNotNull('td_hours')
->orderby('td_date')
->get();
}
......
......@@ -752,6 +752,8 @@ class FormController extends Controller
public function saveoverheadhours(Request $request)
{
// dd(gettype($request->hour[1][3]));
$overhead = 3;
$userId = users::find(Auth::id())
......@@ -790,6 +792,26 @@ class FormController extends Controller
foreach ($value as $keyday => $day)
{
if($day == "0"){
$day = null;
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
$checkTimesheetDetail = Ts_detail::where('fk_o_id', $projectid)
->where('fk_tm_id', $tmasterid)
->where('td_project_type', $overhead)
->where('td_date', $date)
->where('tm_phase', $request->phase)
->first();
if($checkTimesheetDetail)
{
$checkTimesheetDetail->td_hours = $day;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
}
// dd($checkTimesheetDetail->td_hours);
}
if($day){
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
......
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