Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dockers
3f-timesheet
Commits
9c65203d
Commit
9c65203d
authored
Mar 28, 2023
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dept PMS, staff yg hantar timesheet tanpa project, tak appear untuk verification.
parent
a4ed7c3f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
195 additions
and
6 deletions
+195
-6
packages/portal/timesheet/resources/views/dashboard/dashboardpmhod.blade.php
+169
-3
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+22
-2
packages/portal/timesheet/src/Model/VwChargeableVerification.php
+4
-1
No files found.
packages/portal/timesheet/resources/views/dashboard/dashboardpmhod.blade.php
View file @
9c65203d
...
@@ -267,12 +267,10 @@
...
@@ -267,12 +267,10 @@
<?php
<?php
$pms
=
$others
= null;
$pms
=
$others
= null;
foreach (
$profile
as
$key
=>
$value
) {
foreach (
$profile
as
$key
=>
$value
) {
// dump(data_get(
$value
,'dept'));
if (data_get(
$value
,'dept') == 4) {
if (data_get(
$value
,'dept') == 4) {
$pms
=
$value
;
$pms
=
$value
;
} else {
} else {
$others
=
$value
;
$others
=
$value
;
// dd(
$others
);
}
}
}
}
?>
?>
...
@@ -289,7 +287,8 @@
...
@@ -289,7 +287,8 @@
$page
= 1;
$page
= 1;
$project
=
$checksts
= 0;
$project
=
$checksts
= 0;
$pmss
=
$profile->where
('dept', 4)->where('staff_id', '<>',
$verifier->u_staffID
);
$pmss
=
$profile->where
('dept', 4)->where('staff_id', '<>',
$verifier->u_staffID
);
// dd(
$pmss
);
$ovpmss
=
$ovprofiles->where
('dept', 4)->where('staff_id', '<>',
$verifier->u_staffID
);
// dd(
$ovpmss
);
?>
?>
@if(
$pms
)
@if(
$pms
)
@foreach(
$pmss
as
$key
=>
$staff
)
@foreach(
$pmss
as
$key
=>
$staff
)
...
@@ -522,6 +521,173 @@
...
@@ -522,6 +521,173 @@
</thead>
</thead>
</table> -->
</table> -->
@endif
@endif
@if(count(
$ovpmss
) > 0)
@foreach(
$ovpmss
as
$key
=>
$staff
)
<?php
$project
= count(data_get(
$staff
,'countchargeable')->where('tp_pm',
$verifier->id
));
$checksts
= count(data_get(
$staff
,'countchargeable')->where('tp_pm',
$verifier->id
)->where('tp_timesheet_sts', 3));
?>
@endforeach
<!-- @if(
$project
==
$checksts
)
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th class="
text
-
center
">All timesheet has been verified</th>
</tr>
</thead>
</table>
@endif -->
@foreach(
$ovpmss
as
$key
=>
$staff
)
<?php
// dump(
$staff
);
// dd(data_get(
$staff
,'countchargeable'));
$project
= count(data_get(
$staff
,'countchargeable')->where('tp_pm',
$verifier->id
));
$projectoverhead
= count(data_get(
$staff
,'countoverhead')->where('tp_pm',
$verifier->id
));
$checksts
= count(data_get(
$staff
,'countchargeable')->where('tp_pm',
$verifier->id
)->where('tp_timesheet_sts', 3));
$checkstsoverhead
= count(data_get(
$staff
,'countoverhead')->where('tp_pm',
$verifier->id
)->where('tp_timesheet_sts', 3));
?>
@if((
$project
+
$projectoverhead
) == (
$checksts
+
$checkstsoverhead
))
@else
<div class="
title
">
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
40
%
;
"><i class="
dropdown
icon
"></i>{{ data_get(
$staff
,'sname.fullname') }}</th>
<th style="
width
:
20
%
" class="
text
-
center
">
@if(data_get(
$staff
,'phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("
F
", mktime(0, 0, 0, data_get(
$staff
,'month'), 10)) }} - {{ data_get(
$staff
,'year') }}
</th>
<th style="
width
:
15
%
;
" class="
center
aligned
">
<?php
// dd(
$ovpmss
);
$status
=
$staff->status
;
$verified
= count(data_get(
$ovpmss[$key]
, 'countchargeable')->where('tp_timesheet_sts', 3));
$allproject
= count(data_get(
$ovpmss[$key]
, 'countchargeable'));
?>
@if(
$status
== 1 ||
$status
== null) In Preparation
@elseif(
$status
== 2) <i class="
red
attention
icon
"></i> Submitted
@elseif($$status == 3) <i class="
green
check
icon
"></i> Verified by PM
@elseif(
$status
== 4) <i class="
green
check
icon
"></i>Verified by PD
@elseif(
$status
== 5) <i class="
red
attention
icon
"></i>Dissaproved by PD
@elseif(
$status
== 6) <i class="
red
attention
icon
"></i>Rejected by PM
@elseif(
$status
== 7) <i class="
red
attention
icon
"></i>Rejected by HR
@endif
</th>
<th style="
width
:
13
%
" class="
text
-
center
">Submitted on: {{ date("
d
/
m
/
Y
", strtotime(data_get(
$staff
,'submission'))) }}</th>
<th style="
width
:
12
%
" class="
text
-
center
">
<button class="
center
aligned
ui
blue
icon
button
">View Details</button>
</th>
</tr>
</thead>
</table>
</div>
<div class="
content
" style="
padding
-
top
:
0
px
;
">
<form class="
ui
form
" action="
{{
route
(
'timesheet::dashboard.selectverification'
)
}}
" method="
POST
">
{
{csrf_field()}
}
<input type="
hidden
" name="
tmid
" value="
{{
data_get
(
$staff
,
'tmid'
)}}
">
<input type="
hidden
" name="
page
" value="
{{
$page
}}
">
<?php
$overhead
=
$overheads->where
('staffid',
$staff->staff_id
);
$checkoverhead
=
$overheads->where
('staffid',
$staff->staff_id
)->first();
?>
@if(
$checkoverhead
)
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
25
%
;
">Overhead</th>
<th style="
width
:
10
%
;
" class="
center
aligned
">Total Hours</th>
<th style="
width
:
10
%
;
" class="
center
aligned
">Total Days</th>
<th style="
width
:
30
%
">Remarks</th>
<th style="
width
:
13
%
" class="
text
-
center
">Status</th>
<th style="
width
:
12
%
;
" class="
text
-
center
">Action</th>
</tr>
</thead>
@foreach(
$overheads
as
$key
=>
$tp
)
@if(data_get(
$staff
, 'tmid') == data_get(
$tp
, 'fk_tm_id'))
<tr>
<td style="
width
:
25
;
">
@if(data_get(
$tp
,'tp_timesheet_sts') == 2)
<div class="
ui
toggle
checkbox
">
<input type="
checkbox
" name="
pid
[{{
data_get
(
$tp
,
'id'
)}}]
" value="
{{
data_get
(
$tp
,
'id'
)}}
">
</div>
@else
<div class="
ui
toggle
checkbox
">
<input type="
checkbox
" disabled="
disabled
">
</div>
@endif
{{data_get(
$tp
, 'tp_project_name')}}
</td>
<td style="
width
:
10
%
;
" class="
center
aligned
">{{data_get(
$tp
, 'tp_hours')}}</td>
<td style="
width
:
10
%
;
" class="
center
aligned
">
{{ number_format(data_get(
$tp
, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="
width
:
30
%
">{{data_get(
$tp
, 'verifier_remark')}}</td>
<td style="
width
:
13
%
" class="
text
-
center
">
@if(data_get(
$tp
, 'tp_timesheet_sts') == 1 || data_get(
$tp
, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get(
$tp
, 'tp_timesheet_sts') == 2) <i class="
red
attention
icon
"></i> Submitted
@elseif(data_get(
$tp
, 'tp_timesheet_sts') == 3) <i class="
green
check
icon
"></i> Verified by HOD/HOU
@elseif(data_get(
$tp
, 'tp_timesheet_sts') == 4) <i class="
green
check
icon
"></i>Verified by BOD
@elseif(data_get(
$tp
, 'tp_timesheet_sts') == 5) <i class="
red
attention
icon
"></i>Dissaproved by BOD
@elseif(data_get(
$tp
, 'tp_timesheet_sts') == 6) <i class="
red
attention
icon
"></i>Rejected by HOD/HOU
@elseif(data_get(
$tp
, 'tp_timesheet_sts') == 7) <i class="
red
attention
icon
"></i>Rejected by HR
@endif
</td>
<td style="
width
:
12
%
;
" class="
text
-
center
single
line
">
@if(data_get(
$tp
, 'tp_timesheet_sts') == 2)
<button class="
center
aligned
ui
green
icon
button
" onclick="
window
.
location
.
href
=
'{{route('
timesheet
::
dashboard
.
revaction
', ['
tpid
'=>data_get($tp, '
id
'), '
phase
'=>data_get($tp, '
tp_phase
'), '
month
'=>data_get($tp, '
tp_month
'), '
year
'=>data_get($tp, '
tp_year
') ]) }}'
;
" type="
button
">Verify | Reject</button>
@else
<!-- <button class="
center
aligned
ui
green
icon
button
disabled
">Verify | Reject</button> -->
<a class="
center
aligned
ui
blue
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
timesheetViewer
', [ '
user
'=>data_get($staff,'
staff_id
') ,'
phase
' => data_get($staff,'
phase
'), '
month
' => data_get($staff,'
month
'), '
year
' => data_get($staff,'
year
')]) }}'
;
" type="
button
" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
10
%
" class="
center
aligned
">Date</th>
<th style="
width
:
15
%
" class="
single
line
"> Overhead Description</th>
<th class="
center
aligned
">Notes</th>
</tr>
</thead>
<?php
$pmsoverheads
=
$overheads->where
('fk_tm_id', data_get(
$staff
,'tmid'));
?>
@foreach(
$pmsoverheads
as
$key
=>
$overhead
)
@if(data_get(
$staff
,'staff_id') == data_get(
$overhead
, 'staffid'))
@foreach(data_get(
$overhead
,'notes') as
$key
=>
$value
)
@if(data_get(
$value
,'td_hours'))
<tr>
<td style="
width
:
10
%
" class="
center
aligned
">{{ date("
d
-
m
-
Y
", strtotime(data_get(
$value
, 'td_date'))) }}</td>
<td style="
width
:
15
%
" class="
single
line
">{{data_get(
$value
, 'td_overhead_desc')}}</td>
<td>{{data_get(
$value
, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<button type="
submit
" class="
center
aligned
ui
green
icon
button
">Verify</button>
<button type="
button
" class="
center
aligned
ui
green
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
verifyallaction
', ['
tmid
'=>data_get($staff, '
tmid
'), '
phase
'=>data_get($staff, '
tm_phase
'), '
month
'=>data_get($staff, '
tm_month
'), '
year
'=>data_get($staff, '
tm_year
'), '
page
'=>$page ]) }}'
;
">Verify All</button>
</form>
</div>
@endif
@endforeach
@endif
</div>
</div>
</div>
</div>
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
9c65203d
...
@@ -242,7 +242,27 @@ class DashboardController extends Controller
...
@@ -242,7 +242,27 @@ class DashboardController extends Controller
->
with
(
'countoverhead'
)
->
with
(
'countoverhead'
)
// ->with('department')
// ->with('department')
->
get
();
->
get
();
// dd($profile);
$staffpms
=
[];
foreach
(
$profile
as
$key
=>
$value
)
{
if
(
data_get
(
$value
,
'dept'
)
==
4
)
{
$staffpms
[]
=
$value
->
staff_id
;
}
}
$ovprofiles
=
VwChargeableVerification
::
select
(
'tmid'
,
'staff_id'
,
'year'
,
'month'
,
'phase'
,
'status'
,
'submission'
,
'fullname'
,
'pmstaffid'
,
'dept'
)
->
where
(
'pmstaffid'
,
$verifier
->
id
)
// ->where('status', '<>', 1)
->
whereIn
(
'status'
,
[
2
,
3
,
5
,
6
])
->
whereNotIn
(
'staff_id'
,
$staffpms
)
->
distinct
(
'staff_id'
)
->
orderby
(
'roleid'
)
->
with
(
'countchargeable'
)
->
with
(
'countoverhead'
)
->
with
(
'sname'
)
// ->with('department')
->
get
();
// dd($ovprofiles);
$staffnotes
=
Tproject
::
where
(
'tp_project_type'
,
3
)
$staffnotes
=
Tproject
::
where
(
'tp_project_type'
,
3
)
->
whereIn
(
'tp_timesheet_sts'
,
[
2
,
3
,
5
,
6
])
->
whereIn
(
'tp_timesheet_sts'
,
[
2
,
3
,
5
,
6
])
->
where
(
'staffid'
,
$verifier
->
u_staffID
)
->
where
(
'staffid'
,
$verifier
->
u_staffID
)
...
@@ -288,7 +308,7 @@ class DashboardController extends Controller
...
@@ -288,7 +308,7 @@ class DashboardController extends Controller
->
with
(
'bod'
)
->
with
(
'bod'
)
->
get
();
->
get
();
return
view
(
'timesheet::dashboard.dashboardpmhod'
,
compact
(
'profile'
,
'details'
,
'verifier'
,
'overheads'
,
'staffinfo'
,
'timesheet'
,
'projects'
,
'roleid'
,
'staffnotes'
));
return
view
(
'timesheet::dashboard.dashboardpmhod'
,
compact
(
'profile'
,
'details'
,
'verifier'
,
'overheads'
,
'staffinfo'
,
'timesheet'
,
'projects'
,
'roleid'
,
'staffnotes'
,
'ovprofiles'
));
}
}
if
((
$roleid
==
(
'5'
||
'6'
)))
{
if
((
$roleid
==
(
'5'
||
'6'
)))
{
...
...
packages/portal/timesheet/src/Model/VwChargeableVerification.php
View file @
9c65203d
...
@@ -33,7 +33,10 @@ class VwChargeableVerification extends Model
...
@@ -33,7 +33,10 @@ class VwChargeableVerification extends Model
return
$this
->
hasMany
(
'Portal\Timesheet\Model\Tproject'
,
'fk_tm_id'
,
'tmid'
)
->
where
(
'tp_project_type'
,
3
);
return
$this
->
hasMany
(
'Portal\Timesheet\Model\Tproject'
,
'fk_tm_id'
,
'tmid'
)
->
where
(
'tp_project_type'
,
3
);
}
}
public
function
sname
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'staff_id'
,
'staff_id'
);
}
// public function department()
// public function department()
// {
// {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment