Commit 33820873 by Azhan Hannan

JIKA PM SELECT ‘Reject’, wajib isi Remarks *, dan tak lepas submit selagi tak…

JIKA PM SELECT ‘Reject’, wajib isi Remarks *, dan tak lepas submit selagi tak isi remarks. Expectation:Selepas resubmit ke PM, Paparkan popup message ‘Timesheet has been resubmit  to Project Manager’.
parent 273839ff
......@@ -55,8 +55,8 @@
@elseif(data_get($value,'tm_timesheet_master_sts') == 2) <i class="green check icon"></i> Submitted
@elseif(data_get($value,'tm_timesheet_master_sts') == 3) <i class="green check icon"></i> Verified by PM
@elseif(data_get($value,'tm_timesheet_master_sts') == 4) <i class="green check icon"></i> Approved by PD
@elseif(data_get($value,'tm_timesheet_master_sts') == 5) <i class="green check icon"></i> Rejected by PD
@elseif(data_get($value,'tm_timesheet_master_sts') == 6) <i class="green check icon"></i> Rejected by PM
@elseif(data_get($value,'tm_timesheet_master_sts') == 5) <i class="red attention icon"></i> Rejected by PD
@elseif(data_get($value,'tm_timesheet_master_sts') == 6) <i class="red attention icon"></i> Rejected by PM
@endif
</th>
<th style="width: 13%" class="text-center">Submitted on: {{data_get($value,'tm_submission_at')}}</th>
......
......@@ -120,7 +120,7 @@ class DashboardController extends Controller
$profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'roleid', 'pmstaffid')
->where('pmstaffid', $verifier->u_staffID)
->where('status', 2)
->whereIn('status', [2,6])
// ->groupby('staff_id')
->distinct('staff_id')
->orderby('year', 'desc')
......@@ -146,7 +146,7 @@ class DashboardController extends Controller
$profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'roleid', 'pmstaffid', 'dept')
->where('pmstaffid', $verifier->u_staffID)
->where('status', 2)
->whereIn('status', [2,6])
->distinct('staff_id')
->orderby('roleid')
->with('countchargeable')
......@@ -514,7 +514,7 @@ class DashboardController extends Controller
$pm = Users::find(Auth::id());
if(data_get($request,'page') == 1){
return redirect()->route('timesheet::dashboard.index');
return redirect()->route('timesheet::dashboard.index')->withWarning('You wanted to rejected the project submission. Kindly give remarks for team references. Thank you 😊');
}
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 😊');
......
......@@ -1537,6 +1537,8 @@ class FormController extends Controller
public function resubmit(Request $request)
{
$roleid = auth()->user()->roles['0']->id;
// dd($request);
$profile = Tproject::where('id', $request->tpid)
......@@ -1593,7 +1595,19 @@ class FormController extends Controller
$valuehour = 0;
}
// dd($checkTimesheetDetail);
if($valuehour == 0)
{
if($checkTimesheetDetail)
{
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->save();
}
}
else
{
if($checkTimesheetDetail)
{
$checkTimesheetDetail->td_hours = $valuehour;
......@@ -1619,11 +1633,14 @@ class FormController extends Controller
$tmdetail->td_project_name = $project->p_project_description;
$tmdetail->td_hours = $valuehour;
$tmdetail->td_timesheet_sts = 1;
$tmdetail->td_timesheet_sts = 2;
$tmdetail->updated_by = $userId;
$tmdetail->save();
}
}
}
$checktproject = Tproject::where('fk_tm_id', $tmasterid)
......@@ -1663,21 +1680,27 @@ class FormController extends Controller
}
$zeroedproject = Tproject::where('fk_tm_id', $tmasterid)
->where('td_project', $projectid)
$zeroedproject = Tproject::where('id', data_get($request,'tpid'))
->where('tp_hours', 0)
->first();
// dd($request->tpid);
Ts_detail::where('fk_tm_id', $tmasterid)
->where('td_project', data_get($zeroedproject,'td_project'))
->where('td_hours', 0)
->delete();
if ($zeroedproject)
{
Tproject::where('fk_tm_id', $tmasterid)
->where('td_project', $projectid)
Tproject::where('id', $request->tpid)
->delete();
Ts_detail::where('fk_tm_id', $tmasterid)
->where('td_project', $projectid)
->where('td_project', data_get($zeroedproject,'td_project'))
// ->where('td_hours', 0)
->delete();
}
// dd($datasat);
}
$sumdetailhour = Ts_detail::where('td_project_type', $chargeable)
......@@ -1698,7 +1721,7 @@ class FormController extends Controller
->where('td_project', $profile->td_project)
->update(['td_timesheet_sts' => 2]);
return redirect()->route('timesheet::dashboard.index');
return redirect()->route('timesheet::dashboard.index')->withSuccess('Timesheet has been resubmit to Project Manager');
}
public function resubmitoverhead(Request $request)
......
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