Commit 5a77d066 by Azhan Hannan

issue saved notes when hours deleted

parent 0db6efdd
......@@ -87,7 +87,7 @@
@if(data_get($value,'td_overhead_note'))
<input type="text" name="note[{{$key}}]" value="{{data_get($value,'td_overhead_note')}}" required="required">
@else
<input type="text" name="note[{{$key}}]" placeholder="Fill in the notes for your overhead task" required="required">
<input type="text" name="note[{{$key}}]" placeholder="Fill in the notes for your task" required="required">
@endif
</td>
</tr>
......
......@@ -1141,6 +1141,7 @@ class FormController extends Controller
->where('tm_phase', $request->phase)
->where('fk_tm_id', $request->tmid)
->where('td_project_type', $overhead)
->whereNotNull('td_hours')
->where('tm_staff_id', $userId)
->orderby('td_date')
->get();
......@@ -1163,6 +1164,7 @@ class FormController extends Controller
if($check) {
foreach ($td as $key => $tdetail) {
// dd($td);
$tdetail->td_overhead_note = $request->note[$key];
$tdetail->save();
}
......@@ -1171,7 +1173,7 @@ class FormController extends Controller
}
else
{
return redirect()->route('timesheet::form.notelist', ['year'=> $year, 'month' =>$month, 'phase' => $phase, 'fk_tm_id' => $request->fk_tm_id])->with('warning', 'No data to update. Kindly update your overehead form first. Thank you!');
return redirect()->route('timesheet::form.notelist', ['year'=> $year, 'month' =>$month, 'phase' => $phase, 'fk_tm_id' => $request->fk_tm_id])->with('warning', 'No data to update. Kindly update your overehead form first. Thank you 😊');
}
}
......
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