Commit 00fc052b by Azhan Hannan

Log Pia #180 -> submit overhead only. bod reject, staff resubmit, hod tak dapat timesheet.

parent 6410e2ff
......@@ -2197,9 +2197,9 @@ class FormController extends Controller
public function resubmit(Request $request)
{
$roleid = auth()->user()->roles['0']->id;
dd('resubmit');
// dd($request);
$roleid = auth()->user()->roles['0']->id;
$profile = Tproject::where('id', $request->tpid)
->first();
......@@ -2212,7 +2212,6 @@ class FormController extends Controller
$check = Ts_master::where('id', $profile->fk_tm_id)
->first();
// dd($check);
if($check)
{
......@@ -2416,7 +2415,7 @@ class FormController extends Controller
public function resubmitoverhead(Request $request)
{
// dd($request);
dd($request);
// dd(gettype($request->hour[1][3]));
......@@ -2687,7 +2686,7 @@ class FormController extends Controller
->whereNotNull('td_hours')
->where('td_project_type', 3)
->get();
// dd($checknotes);
foreach ($checknotes as $key => $value)
{
......@@ -2697,6 +2696,13 @@ class FormController extends Controller
}
}
// dd($tmaster->id);
$overheadonly = Tproject::where('fk_tm_id', $tmaster->id)
->where('tp_project_type', 1)
->first();
if ($overheadonly) {
Tproject::where('fk_tm_id', $request->fk_tm_id)
->where('tp_project_type', 3)
->update([
......@@ -2710,6 +2716,27 @@ class FormController extends Controller
'td_timesheet_sts' => 2,
'updated_by' => $userId
]);
}
else
{
Tproject::where('fk_tm_id', $request->fk_tm_id)
->where('tp_project_type', 3)
->update([
'tp_timesheet_sts' => 2,
'updated_by' => $userId
]);
Ts_detail::where('fk_tm_id', $request->fk_tm_id)
->where('td_project_type', 3)
->update([
'td_timesheet_sts' => 2,
'updated_by' => $userId
]);
Ts_master::where('id', $request->fk_tm_id)
->update([ 'tm_timesheet_master_sts' => 2 ]);
}
if( $roleid == '8' )
{
......
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