Commit b2e67d6b by Azhan Hannan

BDD → submission attachment -> mandatory. make checking.

parent 13475f90
......@@ -6,6 +6,7 @@ use Illuminate\Routing\Controller;
use Carbon\Carbon;
use DB;
use Portal\Timesheet\Model\Users;
use Portal\Timesheet\Model\NotesAttachement;
use Portal\Timesheet\Model\Ts_master;
use Portal\Timesheet\Model\Ts_detail;
use Portal\Timesheet\Model\Project;
......@@ -1811,7 +1812,14 @@ class DashboardController extends Controller
{
$roleid = auth()->user()->roles['0']->id;
// dd(data_get($user,'penyokongpm.staff_id'));
$userinfo = Staff_info::where('fk_users', auth::id())->first();
if ($userinfo->fk_lkp_department == 7) {
$attachmentexist = NotesAttachement::where('fk_timesheet_master', $request->tid)->first();
if (is_null($attachmentexist)) {
return redirect()->route('timesheet::form.notelist', ['year' => $request->year, 'month'=> $request->month, 'phase'=> $request->phase, 'fk_tm_id'=> $request->tid ])->withSuccess('Kindly upload your weekly planning before submit your timesheet. Thank you.');
}
}
$checknotes = Ts_detail::where('fk_tm_id', $request->tid)
->whereNotNull('td_hours')
......
......@@ -2186,7 +2186,7 @@ class FormController extends Controller
}
return redirect()->back()->withSuccess('Berjaya mengemaskini attachment');
return redirect()->back()->withSuccess('The attachment has been uploaded successfully');
}
public function rejected(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