Commit fb408792 by Azhan Hannan

Project reject by PM:

1- hanya project tersebut shj yg di reject
Reject -> update status timesheet_prj & timesheet_dtl == 6
PM verification page -> display semua project regardless any status
parent d341ef4e
...@@ -122,8 +122,8 @@ class DashboardController extends Controller ...@@ -122,8 +122,8 @@ class DashboardController extends Controller
->get(); ->get();
// dd($profile); // dd($profile);
$details = Tproject::where('tp_timesheet_sts', 2) $details = Tproject::where('tp_pm', $verifier->u_staffID)
->where('tp_pm', $verifier->u_staffID) // ->where('tp_timesheet_sts', 2)
->with('project') ->with('project')
->with('pm') ->with('pm')
->get(); ->get();
...@@ -372,7 +372,6 @@ class DashboardController extends Controller ...@@ -372,7 +372,6 @@ class DashboardController extends Controller
->orderby('roleid') ->orderby('roleid')
->with('countchargeable') ->with('countchargeable')
->get(); ->get();
// dd($profile);
$details = Tproject::where('tp_year', $curryear) $details = Tproject::where('tp_year', $curryear)
->where('tp_month', $month) ->where('tp_month', $month)
...@@ -477,6 +476,28 @@ class DashboardController extends Controller ...@@ -477,6 +476,28 @@ class DashboardController extends Controller
public function verify(Request $request) public function verify(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 project submission. Kindly give remarks for team references. Thank you 😊');
}
// dd($request);
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
$today = Carbon::today()->toDateString(); $today = Carbon::today()->toDateString();
...@@ -507,7 +528,7 @@ class DashboardController extends Controller ...@@ -507,7 +528,7 @@ class DashboardController extends Controller
->get(); ->get();
$allproject = Tproject::where('fk_tm_id', $request->tmid) $allproject = Tproject::where('fk_tm_id', $request->tmid)
->get(); ->get();
if(count($allproject) == count($checkapproved)){ if(count($allproject) == count($checkapproved)){
...@@ -531,16 +552,16 @@ class DashboardController extends Controller ...@@ -531,16 +552,16 @@ class DashboardController extends Controller
Ts_detail::where('fk_tm_id', $request->tmid) Ts_detail::where('fk_tm_id', $request->tmid)
->where('td_project', $request->pid) ->where('td_project', $request->pid)
->update([ 'td_timesheet_sts' => 6 ]); ->update(['td_timesheet_sts' => 6 ]);
Tproject::where('fk_tm_id', $request->tmid)
->update(['tp_timesheet_sts' => 6]);
$checkrejected = Tproject::where('fk_tm_id', $request->tmid) $checkrejected = Tproject::where('fk_tm_id', $request->tmid)
->where('tp_timesheet_sts', 6) ->where('tp_timesheet_sts', 6)
->first(); ->get();
if($checkrejected){ $allreject = Tproject::where('fk_tm_id', $request->tmid)
->get();
if(count($checkrejected) == count($allreject)){
Ts_master::where('id', $request->tmid) Ts_master::where('id', $request->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