Commit 9202bc15 by Azhan Hannan

Resubmit function bila takde project shj atau overhead shj -> project & overhead

parent 9a44b473
...@@ -2301,7 +2301,7 @@ class FormController extends Controller ...@@ -2301,7 +2301,7 @@ class FormController extends Controller
public function resubmit(Request $request) public function resubmit(Request $request)
{ {
// dd('resubmit'); // dd($request);
$roleid = auth()->user()->roles['0']->id; $roleid = auth()->user()->roles['0']->id;
...@@ -2313,7 +2313,6 @@ class FormController extends Controller ...@@ -2313,7 +2313,6 @@ class FormController extends Controller
$userId = users::find(Auth::id()) $userId = users::find(Auth::id())
->u_staffID; ->u_staffID;
$check = Ts_master::where('id', $profile->fk_tm_id) $check = Ts_master::where('id', $profile->fk_tm_id)
->first(); ->first();
...@@ -2484,6 +2483,19 @@ class FormController extends Controller ...@@ -2484,6 +2483,19 @@ class FormController extends Controller
->where('td_project', $profile->td_project) ->where('td_project', $profile->td_project)
->update(['td_timesheet_sts' => 2]); ->update(['td_timesheet_sts' => 2]);
$soleproject = Tproject::where('fk_tm_id', $profile->fk_tm_id)
->where('deleted_at', null)
->get();
if(count($soleproject) == 1) {
$check = Ts_master::where('id', $profile->fk_tm_id)
->first();
$check->tm_timesheet_master_sts = 2;
$check->save();
}
// dd($soleproject);
if( $roleid == '9' ) if( $roleid == '9' )
{ {
Tproject::where('id', $profile->id) Tproject::where('id', $profile->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