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
8f64b8d5
Commit
8f64b8d5
authored
Aug 25, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes in report department
parent
ea6d844d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
242 additions
and
17 deletions
+242
-17
packages/portal/timesheet/resources/views/report/department.blade.php
+145
-0
packages/portal/timesheet/resources/views/report/project.blade.php
+22
-8
packages/portal/timesheet/resources/views/report/ringkasan.blade.php
+9
-3
packages/portal/timesheet/src/Http/Controllers/ReportController.php
+35
-6
packages/portal/timesheet/src/Model/VwOverhead.php
+31
-0
No files found.
packages/portal/timesheet/resources/views/report/department.blade.php
0 → 100644
View file @
8f64b8d5
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<div class="
ui
purple
left
ribbon
label
">
Report by Department
</div>
<br>
<br>
<div class="
ui
styled
fluid
accordion
">
<div class="
title
">
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
10
%
">Department </th>
<th style="
width
:
1
%
">:</th>
<th colspan="
3
">
{
{data_get($dept,'description')}
}
</th>
</tr>
<tr>
<th style="
width
:
10
%
"> Month/Year</th>
<th style="
width
:
1
%
">:</th>
<th colspan="
3
">
{
{$month}
}
{
{$year}
}
</th>
</tr>
</thead>
</table>
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
35
%
">staff</th>
<th style="
width
:
5
%
"></th>
<th style="
width
:
15
%
" class="
center
aligned
">project code / task</th>
<th style="
width
:
25
%
" class="
center
aligned
">description</th>
<th style="
width
:
10
%
" class="
center
aligned
">total hours</th>
<th style="
width
:
10
%
" class="
center
aligned
">total days</th>
</tr>
</thead>
<?php
$totalhours
=
$totaldays
=
$staffhours
=
$staffdays
= 0; ?>
@foreach(
$staffs
as
$key
=>
$staff
)
<tbody>
<tr>
<td colspan="
6
">
{
{data_get($staff,'name')}
}
</td>
</tr>
<?php
$chargeproject
=
$project->where
('ptype', 1);
$chargehours
=
$chargedays
= 0;
?>
@foreach(
$chargeproject
as
$key
=>
$chargeable
)
@if(data_get(
$chargeable
,'staffid') == data_get(
$staff
,'staffid'))
<tr>
<td style="
width
:
35
%
"></td>
<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
%
" class="
center
aligned
">
{
{data_get($chargeable,'pname')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{data_get($chargeable,'hours')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{number_format(data_get(
$chargeable
,'hours')/8, '1', '.', '')}}</td>
</tr>
<?php
$chargehours
+= data_get(
$chargeable
,'hours');
$chargedays
+= number_format(data_get(
$chargeable
,'hours')/8, '1', '.', '');
?>
@endif
@endforeach
<?php
$nonchargeproject
=
$project->where
('ptype', 2);
$nonchargehours
=
$nonchargedays
= 0;
?>
@foreach(
$nonchargeproject
as
$key
=>
$nonchargeable
)
@if(data_get(
$nonchargeable
,'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
">
{
{data_get($nonchargeable,'pcode')}
}
</td>
<td style="
width
:
25
%
" class="
center
aligned
">
{
{data_get($nonchargeable,'pname')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{data_get($nonchargeable,'hours')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{number_format(data_get(
$nonchargeable
,'hours')/8, '1', '.', '')}}</td>
</tr>
<?php
$nonchargehours
+= data_get(
$nonchargeable
,'hours');
$nonchargedays
+= number_format(data_get(
$nonchargeable
,'hours')/8, '1', '.', '');
?>
@endif
@endforeach
<?php
$overheadhours
=
$overheaddays
= 0;
?>
@foreach(
$overhead
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
%
" class="
center
aligned
">
{
{data_get($value,'pname')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{data_get($value,'hours')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{number_format(data_get(
$value
,'hours')/8, '1', '.', '')}}</td>
</tr>
<?php
$overheadhours
+= data_get(
$value
,'hours');
$overheaddays
+= number_format(data_get(
$value
,'hours')/8, '1', '.', '');
?>
@endif
@endforeach
<?php
$staffhours
=
$chargehours
+
$nonchargehours
+
$overheadhours
;
$staffdays
=
$chargedays
+
$nonchargedays
+
$overheaddays
;
?>
<tr>
<td colspan="
3
"></td>
<td style="
width
:
25
%
" class="
center
aligned
">Total</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{$staffhours}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{$staffdays}
}
</td>
</tr>
</tbody>
<?php
$totalhours
+=
$staffhours
;
$totaldays
+=
$staffdays
;
?>
@endforeach
<tfoot class="
full
-
width
">
<tr>
<th colspan="
3
"><strong>Total hours by department</strong></th>
<th style="
width
:
25
%
" class="
center
aligned
"></th>
<th style="
width
:
10
%
" class="
center
aligned
"><strong>
{
{$totalhours}
}
</strong></th>
<th style="
width
:
10
%
" class="
center
aligned
"><strong>
{
{$totaldays}
}
</strong></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection
@push('script')
@endpush
\ No newline at end of file
packages/portal/timesheet/resources/views/report/project.blade.php
View file @
8f64b8d5
...
@@ -14,10 +14,14 @@
...
@@ -14,10 +14,14 @@
<table class="
ui
unstackable
celled
table
">
<table class="
ui
unstackable
celled
table
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
4
">TIMESHEET
{
{$month}
}
{
{$year}
}
by Project</th>
<th style="
width
:
10
%
">Project </th>
<th style="
width
:
1
%
">:</th>
<th colspan="
3
">
{
{data_get($pdetail,'pcode')}
}
-
{
{data_get($pdetail,'pname')}
}
</th>
</tr>
</tr>
<tr>
<tr>
<th colspan="
4
">Project:
{
{data_get($pdetail,'pname')}
}
</th>
<th style="
width
:
10
%
"> Month/Year</th>
<th style="
width
:
1
%
">:</th>
<th colspan="
3
">
{
{$month}
}
{
{$year}
}
</th>
</tr>
</tr>
</thead>
</thead>
</table>
</table>
...
@@ -36,13 +40,23 @@
...
@@ -36,13 +40,23 @@
<tr>
<tr>
<td style="
width
:
40
%
">
{
{data_get($team,'name')}
}
</td>
<td style="
width
:
40
%
">
{
{data_get($team,'name')}
}
</td>
<td style="
width
:
30
%
" class="
center
aligned
">
{
{data_get($team,'role')}
}
</td>
<td style="
width
:
30
%
" class="
center
aligned
">
{
{data_get($team,'role')}
}
</td>
<td style="
width
:
15
%
" class="
center
aligned
">
{
{data_get($team,'hours')}
}
</td>
<td style="
width
:
15
%
" class="
center
aligned
">
<td style="
width
:
15
%
" class="
center
aligned
">{{number_format(data_get(
$team
,'hours')/8, 1, '.', '')}}</td>
@foreach(
$ptdetail
as
$key
=>
$hours
)
@if(data_get(
$hours
,'staffid') == data_get(
$team
,'staffid'))
{
{data_get($hours,'hours')}
}
<?php
$totalhours
+= data_get(
$hours
,'hours'); ?>
@endif
@endforeach
</td>
<td style="
width
:
15
%
" class="
center
aligned
">
@foreach(
$ptdetail
as
$key
=>
$hours
)
@if(data_get(
$hours
,'staffid') == data_get(
$team
,'staffid'))
{{number_format(data_get(
$hours
,'hours')/8, 1, '.', '')}}
<?php
$totaldays
+= number_format(data_get(
$hours
,'hours')/8, 1, '.', ''); ?>
@endif
@endforeach
</td>
</tr>
</tr>
<?php
$totalhours
+= data_get(
$team
,'hours');
$totaldays
+= number_format(data_get(
$team
,'hours')/8, 1, '.', '');
?>
@endforeach
@endforeach
</tbody>
</tbody>
<tfoot class="
full
-
width
">
<tfoot class="
full
-
width
">
...
...
packages/portal/timesheet/resources/views/report/ringkasan.blade.php
View file @
8f64b8d5
...
@@ -11,11 +11,17 @@
...
@@ -11,11 +11,17 @@
<div class="
ui
styled
fluid
accordion
">
<div class="
ui
styled
fluid
accordion
">
<div class="
title
scrolling
content
">
<div class="
title
scrolling
content
">
<table class="
ui
unstackable
celled
table
">
<table class="
ui
unstackable
celled
table
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
{{
count
(
$chargeproject
)
+
7
}}
"><b>TIMESHEET
{
{strtoupper($month)}
}
{
{$year}
}
</b></th>
<th style="
width
:
10
%
"> Month/Year</th>
<th style="
width
:
1
%
">:</th>
<th>
{
{$month}
}
{
{$year}
}
</th>
</tr>
</tr>
</thead>
</table>
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<tr>
<th colspan="
5
"></th>
<th colspan="
5
"></th>
<th colspan="
{{
count
(
$chargeproject
)}}
" class="
center
aligned
">Chargeable</th>
<th colspan="
{{
count
(
$chargeproject
)}}
" class="
center
aligned
">Chargeable</th>
...
...
packages/portal/timesheet/src/Http/Controllers/ReportController.php
View file @
8f64b8d5
...
@@ -22,6 +22,7 @@ use Portal\Timesheet\Model\VwRingkasanLaporan;
...
@@ -22,6 +22,7 @@ use Portal\Timesheet\Model\VwRingkasanLaporan;
use
Portal\Timesheet\Model\VwChargeable
;
use
Portal\Timesheet\Model\VwChargeable
;
use
Portal\Timesheet\Model\VwNonChargeable
;
use
Portal\Timesheet\Model\VwNonChargeable
;
use
Portal\Timesheet\Model\VwStaff
;
use
Portal\Timesheet\Model\VwStaff
;
use
Portal\Timesheet\Model\VwOverhead
;
use
Portal\Timesheet\Model\VwProject
;
use
Portal\Timesheet\Model\VwProject
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
Illuminate\Support\Facades\Input
;
...
@@ -98,8 +99,18 @@ class ReportController extends Controller
...
@@ -98,8 +99,18 @@ class ReportController extends Controller
public
function
generateprojectreport
(
Request
$request
)
public
function
generateprojectreport
(
Request
$request
)
{
{
$pdetail
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
first
();
$pdetail
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
$pteam
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
orderby
(
'roleid'
)
->
get
();
->
first
();
$pteam
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
orderby
(
'roleid'
)
->
get
();
$ptdetail
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
where
(
'MONTH'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
orderby
(
'roleid'
)
->
get
();
$year
=
date
(
'Y'
);
$year
=
date
(
'Y'
);
if
(
$request
->
year
)
{
if
(
$request
->
year
)
{
...
@@ -108,7 +119,7 @@ class ReportController extends Controller
...
@@ -108,7 +119,7 @@ class ReportController extends Controller
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
return
view
(
'timesheet::report.project'
,
compact
(
'month'
,
'year'
,
'pteam'
,
'pdetail'
));
return
view
(
'timesheet::report.project'
,
compact
(
'month'
,
'year'
,
'pteam'
,
'pdetail'
,
'ptdetail'
));
}
}
public
function
deptreport
()
public
function
deptreport
()
...
@@ -132,8 +143,25 @@ class ReportController extends Controller
...
@@ -132,8 +143,25 @@ class ReportController extends Controller
public
function
generatedeptreport
(
Request
$request
)
public
function
generatedeptreport
(
Request
$request
)
{
{
dd
(
$request
);
$dept
=
Department
::
where
(
'id'
,
$request
->
dept
)
->
first
();
$staffs
=
VwStaff
::
where
(
'deptID'
,
$request
->
dept
)
->
get
();
return
view
(
'timesheet::report.department'
);
$project
=
VwProject
::
where
(
'deptid'
,
$request
->
dept
)
->
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
get
();
$overhead
=
VwOverhead
::
where
(
'deptid'
,
$request
->
dept
)
->
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
get
();
$year
=
date
(
'Y'
);
if
(
$request
->
year
)
{
$year
=
$request
->
year
;
}
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
return
view
(
'timesheet::report.department'
,
compact
(
'year'
,
'month'
,
'dept'
,
'staffs'
,
'project'
,
'overhead'
));
}
}
}
}
\ No newline at end of file
packages/portal/timesheet/src/Model/VwOverhead.php
0 → 100644
View file @
8f64b8d5
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Notifications\Notifiable
;
class
VwOverhead
extends
Model
{
use
Notifiable
;
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'vw_report_overhead'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
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