Commit f0ffd832 by Azhan Hannan

pd/ bod is mandatory to filled the remarks to reject the submission

only reject current project
parent 9c3f2fa7
...@@ -501,7 +501,6 @@ class DashboardController extends Controller ...@@ -501,7 +501,6 @@ class DashboardController extends Controller
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
$today = Carbon::today()->toDateString(); $today = Carbon::today()->toDateString();
$profile = Tproject::where('id', $request->tpid) $profile = Tproject::where('id', $request->tpid)
->first(); ->first();
...@@ -577,6 +576,26 @@ class DashboardController extends Controller ...@@ -577,6 +576,26 @@ class DashboardController extends Controller
public function verifyoverhead(Request $request) public function verifyoverhead(Request $request)
{ {
if($request->action == 2 && $request->remarks == null)
{
// dd('reject & tak komen');
$profile = Tproject::where('id', $request->tpid)
->with('team')
->with('project')
->first();
// dd($profile);
$tpid = $profile->id;
$year = $profile->tp_year;
$month = $profile->tp_month;
$phase = $profile->tp_phase;
$pm = Users::find(Auth::id());
return redirect()->route('timesheet::dashboard.projectaction', compact('profile', 'pm', 'tpid', 'year', 'month', 'phase'))->with('warning', 'You wanted to rejected the overhead submission. Kindly give remarks for staff references. Thank you 😊');
}
$hod = Users::find(Auth::id()); $hod = Users::find(Auth::id());
$today = Carbon::today()->toDateString(); $today = Carbon::today()->toDateString();
...@@ -633,14 +652,14 @@ class DashboardController extends Controller ...@@ -633,14 +652,14 @@ class DashboardController extends Controller
->where('fk_o_id', $pid) ->where('fk_o_id', $pid)
->update([ 'td_timesheet_sts' => 6 ]); ->update([ 'td_timesheet_sts' => 6 ]);
Tproject::where('fk_tm_id', $tmid)
->update(['tp_timesheet_sts' => 6]);
$checkrejected = Tproject::where('fk_tm_id', $tmid) $checkrejected = Tproject::where('fk_tm_id', $tmid)
->where('tp_timesheet_sts', 6) ->where('tp_timesheet_sts', 6)
->first(); ->get();
if($checkrejected){ $allrejected = Tproject::where('fk_tm_id', $tmid)
->get();
if(count($checkrejected) == count($allreject)){
Ts_master::where('id', $tmid) Ts_master::where('id', $tmid)
->update( ->update(
[ [
......
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