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
4fc7ea03
Commit
4fc7ea03
authored
Dec 05, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report department buang redundant data
parent
61c17bf6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
17 deletions
+56
-17
packages/portal/timesheet/resources/views/dashboard/dashboardhod.blade.php
+0
-3
packages/portal/timesheet/resources/views/report/department.blade.php
+36
-12
packages/portal/timesheet/src/Http/Controllers/ReportController.php
+20
-2
No files found.
packages/portal/timesheet/resources/views/dashboard/dashboardhod.blade.php
View file @
4fc7ea03
...
...
@@ -39,9 +39,6 @@
<br>
<br>
@foreach(
$timesheet
as
$key
=>
$value
)
<!-- <?php
// dd(
$value->tm_timesheet_master_sts
);
?> -->
<div class="
ui
styled
fluid
accordion
">
<?php
$page
= 1; ?>
<div class="
title
">
...
...
packages/portal/timesheet/resources/views/report/department.blade.php
View file @
4fc7ea03
...
...
@@ -44,7 +44,7 @@
@foreach(
$staffs
as
$key
=>
$staff
)
<tbody>
<?php
$countproject
=
$project->where
('staffid', data_get(
$staff
,'staffid'));
$countproject
=
$project
title
->where
('staffid', data_get(
$staff
,'staffid'));
?>
<tr>
<td colspan="
6
">
{
{data_get($staff,'name')}
}
</td>
...
...
@@ -52,8 +52,8 @@
<?php
//
$chargeproject
=
$project->where
('ptype', 1);
$chargeproject
=
$project->where
('ptype', 1);
// d
d
(
$chargeproject
);
$chargeproject
=
$project
title
->where
('ptype', 1);
// d
ump
(
$chargeproject
);
$chargehours
=
$chargedays
= 0;
?>
...
...
@@ -64,12 +64,24 @@
<td style="
width
:
5
%
" class="
center
aligned
">C</td>
<td style="
width
:
15
%
" class="
center
aligned
">
{
{data_get($chargeable,'pcode')}
}
</td>
<td style="
width
:
25
%
">
{
{data_get($chargeable,'pname')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{ number_format(data_get(
$chargeable
,'hours'), '1', '.', '') }}</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{ number_format(data_get(
$chargeable
,'hours')/8, '1', '.', '') }}</td>
<td style="
width
:
10
%
" class="
center
aligned
">
<?php
$projectvaluehours
= 0; ?>
@foreach(
$project
as
$key
=>
$projecthours
)
@if(data_get(
$chargeable
,'staffid') == data_get(
$projecthours
,'staffid') && data_get(
$chargeable
,'pid') == data_get(
$projecthours
,'pid'))
<?php
$projectvaluehours
+= data_get(
$projecthours
,'hours');
?>
@endif
@endforeach
{{ number_format(
$projectvaluehours
, '1', '.', '') }}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{{ number_format(
$projectvaluehours
/8, '1', '.', '') }}
</td>
</tr>
<?php
$chargehours
+=
data_get(
$chargeable
,'hours')
;
$chargedays
+= number_format(
data_get(
$chargeable
,'hours')
/8, '1', '.', '');
$chargehours
+=
$projectvaluehours
;
$chargedays
+= number_format(
$projectvaluehours
/8, '1', '.', '');
?>
@endif
@endforeach
...
...
@@ -78,19 +90,31 @@
$overheadhours
=
$overheaddays
= 0;
?>
@foreach(
$overhead
as
$key
=>
$value
)
@foreach(
$overhead
title
as
$key
=>
$value
)
@if(data_get(
$value
,'staffid') == data_get(
$staff
,'staffid'))
<tr>
<td style="
width
:
35
%
"></td>
<td style="
width
:
5
%
" class="
center
aligned
">NC</td>
<td style="
width
:
15
%
" class="
center
aligned
"></td>
<td style="
width
:
25
%
">
{
{data_get($value,'pname')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{ number_format(data_get(
$value
,'hours'), '1', '.', '') }}</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{ number_format(data_get(
$value
,'hours')/8, '1', '.', '') }}</td>
<td style="
width
:
10
%
" class="
center
aligned
">
<?php
$overheadvaluehours
= 0 ?>
@foreach(
$overhead
as
$key
=>
$valuehours
)
@if(data_get(
$value
,'staffid') == data_get(
$valuehours
,'staffid') && data_get(
$value
,'oid') == data_get(
$valuehours
,'oid') )
<?php
$overheadvaluehours
+= data_get(
$valuehours
,'hours');
?>
@endif
@endforeach
{{ number_format(
$overheadvaluehours
, '1', '.', '') }}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{{ number_format(
$overheadvaluehours
/8, '1', '.', '') }}
</td>
</tr>
<?php
$overheadhours
+=
data_get(
$value
,'hours')
;
$overheaddays
+= number_format(
data_get(
$value
,'hours')
/8, '1', '.', '');
$overheadhours
+=
$overheadvaluehours
;
$overheaddays
+= number_format(
$overheadvaluehours
/8, '1', '.', '');
?>
@endif
@endforeach
...
...
packages/portal/timesheet/src/Http/Controllers/ReportController.php
View file @
4fc7ea03
...
...
@@ -248,17 +248,35 @@ class ReportController extends Controller
$dept
=
Department
::
where
(
'id'
,
$request
->
dept
)
->
first
();
// dd($dept);
$staffs
=
VwStaff
::
where
(
'deptID'
,
$request
->
dept
)
->
get
();
$approve
=
4
;
$project
=
VwProject
::
where
(
'deptid'
,
$request
->
dept
)
->
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
where
(
'status'
,
$approve
)
->
get
();
// dd($project);
$projecttitle
=
VwProject
::
select
(
'year'
,
'month'
,
'pcode'
,
'pname'
,
'staffid'
,
'deptid'
,
'ptype'
,
'pid'
)
->
where
(
'deptid'
,
$request
->
dept
)
->
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
distinct
()
->
get
();
// dd($projecttitle);
$overhead
=
VwOverhead
::
where
(
'deptid'
,
$request
->
dept
)
->
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
where
(
'status'
,
$approve
)
->
get
();
// dd($overhead);
$overheadtitle
=
VwOverhead
::
select
(
'staffid'
,
'deptid'
,
'oid'
,
'ptype'
,
'year'
,
'month'
,
'pname'
)
->
where
(
'deptid'
,
$request
->
dept
)
->
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
distinct
()
->
get
();
// dd($overheadtitle);
$year
=
date
(
'Y'
);
if
(
$request
->
year
)
{
...
...
@@ -269,7 +287,7 @@ class ReportController extends Controller
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
return
view
(
'timesheet::report.department'
,
compact
(
'intmonth'
,
'year'
,
'month'
,
'dept'
,
'staffs'
,
'project'
,
'overhead'
));
return
view
(
'timesheet::report.department'
,
compact
(
'intmonth'
,
'year'
,
'month'
,
'dept'
,
'staffs'
,
'project'
,
'overhead'
,
'overheadtitle'
,
'projecttitle'
));
}
public
function
filterOvertime
()
...
...
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