Commit 201bb5c2 by Azhan Hannan

Bila tarikh belum lepas timesheet master, tm_phase, takleh submit

parent fe3a338f
......@@ -289,7 +289,7 @@
$page = 1;
$project = $checksts = 0;
$pmss = $profile->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID);
// dd($profile);
// dd($pmss);
?>
@if($pms)
@foreach($pmss as $key => $staff)
......
......@@ -1815,6 +1815,28 @@ class DashboardController extends Controller
$userinfo = Staff_info::where('fk_users', auth::id())->first();
$request->year = 2023;
$request->month = 2;
$request->phase = 1;
$lastday = cal_days_in_month(CAL_GREGORIAN, $request->month, $request->year);
$tm_date = date($request->year.'-'.$request->month.'-01');
if ($request->phase == 1) {
$tm_date = date($request->year.'-'.$request->month.'-15');
} else {
$tm_date = date($request->year.'-'.$request->month.'-'.$lastday);
}
$date = date($request->year.'-'.$request->month.'-'.$lastday);
$submissiondate = date("Y-n-j");
if ($submissiondate > $tm_date) {
} else {
return redirect()->route('timesheet::form.filterChargeable')->withWarning('You have not pass the submission day yet. Please check your month and phase before you submit');
}
if ($userinfo->fk_lkp_department == 7) {
$attachmentexist = NotesAttachement::where('fk_timesheet_master', $request->tid)->first();
if (is_null($attachmentexist)) {
......@@ -1825,8 +1847,7 @@ class DashboardController extends Controller
$checknotes = Ts_detail::where('fk_tm_id', $request->tid)
->whereNotNull('td_hours')
->where('td_project_type', 3)
->get();
// dd($checknotes);
->get();
foreach ($checknotes as $key => $value) {
if($value->td_overhead_note == null)
......@@ -1843,7 +1864,6 @@ class DashboardController extends Controller
$phase = data_get($tm,'tm_phase');
$month = data_get($tm,'tm_month');
$year = data_get($tm,'tm_year');
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
......@@ -1920,7 +1940,7 @@ class DashboardController extends Controller
$intro = 'The timesheet is not complete. Please refer to the date and hours required.<br>';
$text = '';
foreach ($kurang as $key => $value) {
// dd($value);
$text = $text.'<br>'.strval(data_get($value,'tarikh')).' : not enough '.strval(data_get($value,'hourskurang')).' hours';
}
$fulltext = $intro.$text;
......
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