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
ea6d844d
Commit
ea6d844d
authored
Aug 25, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes in project report
parent
398b0d85
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
9 deletions
+150
-9
packages/portal/timesheet/resources/views/report/deptReport.blade.php
+45
-0
packages/portal/timesheet/resources/views/report/project.blade.php
+31
-5
packages/portal/timesheet/src/Http/Controllers/ReportController.php
+41
-2
packages/portal/timesheet/src/Model/VwProject.php
+31
-0
packages/portal/timesheet/src/ServiceProvider.php
+2
-2
No files found.
packages/portal/timesheet/resources/views/report/deptReport.blade.php
0 → 100644
View file @
ea6d844d
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
green
left
ribbon
label
">Report by Department</a>
<br><br>
<form class="
ui
form
" action="
{{
route
(
'timesheet::report.generatedeptreport'
)
}}
" method="
POST
">
{
{csrf_field()}
}
<div class="
five
wide
field
">
<label>Department</label>
<select name="
dept
" class="
ui
fluid
dropdown
" required="
required
">
@foreach(
$dept
as
$key
=>
$value
)
<option value="
{{
data_get
(
$value
,
'id'
)}}
">
{
{data_get($value,'code')}
}
|
{
{data_get($value,'description')}
}
</option>
@endforeach
</select>
</div>
<div class="
two
fields
">
<div class="
three
wide
field
">
<label>Year</label>
<select name="
year
" class="
ui
fluid
dropdown
" required="
required
">
@foreach(
$year
as
$key
=>
$value
)
<option value="
{{
data_get
(
$value
,
'tm_year'
)
}}
">{{ data_get(
$value
,'tm_year') }}</option>
@endforeach
</select>
</div>
<div class="
three
wide
field
">
<label>Month</label>
<select name="
month
" class="
ui
fluid
dropdown
" required="
required
">
@foreach(
$month
as
$key
=>
$value
)
<option value="
{{
$key
+
1
}}
">{{
$value
}}</option>
@endforeach
</select>
</div>
</div>
<button class="
ui
olive
button
" type="
submit
">Generate Report</button>
</form>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/report/project.blade.php
View file @
ea6d844d
...
...
@@ -14,22 +14,48 @@
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th>TIMESHEET
{
{$month}
}
{
{$year}
}
by Project</th>
<th
colspan="
4
"
>TIMESHEET
{
{$month}
}
{
{$year}
}
by Project</th>
</tr>
<tr>
<th>Project: </th>
<th></th>
<th colspan="
4
">Project:
{
{data_get($pdetail,'pname')}
}
</th>
</tr>
</thead>
</table>
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
45
%
">staff name</th>
<th style="
width
:
25
%
" class="
center
aligned
">role</th>
<th style="
width
:
15
%
" class="
center
aligned
">total hours</th>
<th style="
width
:
15
%
" class="
center
aligned
">total days</th>
</tr>
</thead>
<tbody>
<?php
$totalhours
=
$totaldays
= 0; ?>
@foreach(
$pteam
as
$key
=>
$team
)
<tr>
<td>aiaya</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
:
15
%
" class="
center
aligned
">
{
{data_get($team,'hours')}
}
</td>
<td style="
width
:
15
%
" class="
center
aligned
">{{number_format(data_get(
$team
,'hours')/8, 1, '.', '')}}</td>
</tr>
<?php
$totalhours
+= data_get(
$team
,'hours');
$totaldays
+= number_format(data_get(
$team
,'hours')/8, 1, '.', '');
?>
@endforeach
</tbody>
<tfoot class="
full
-
width
">
<tr>
<th style="
width
:
40
%
"><strong>Total</strong></th>
<th style="
width
:
30
%
"></th>
<th style="
width
:
15
%
" class="
center
aligned
"><strong>
{
{$totalhours}
}
</strong></th>
<th style="
width
:
15
%
" class="
center
aligned
"><strong>
{
{$totaldays}
}
</strong></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection
...
...
packages/portal/timesheet/src/Http/Controllers/ReportController.php
View file @
ea6d844d
...
...
@@ -22,6 +22,7 @@ use Portal\Timesheet\Model\VwRingkasanLaporan;
use
Portal\Timesheet\Model\VwChargeable
;
use
Portal\Timesheet\Model\VwNonChargeable
;
use
Portal\Timesheet\Model\VwStaff
;
use
Portal\Timesheet\Model\VwProject
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
File
;
...
...
@@ -58,9 +59,12 @@ class ReportController extends Controller
$ringkasan
=
VwRingkasanLaporan
::
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
get
();
$chargeproject
=
VwChargeable
::
all
();
$nonchargeproject
=
VwNonChargeable
::
all
();
$staffs
=
VwStaff
::
orderby
(
'deptID'
)
->
get
();
$staffs
=
VwStaff
::
orderby
(
'deptID'
)
->
where
(
'deptID'
,
'!='
,
8
)
->
get
();
// dd($nonchargeproject);
$year
=
date
(
'Y'
);
...
...
@@ -94,8 +98,42 @@ class ReportController extends Controller
public
function
generateprojectreport
(
Request
$request
)
{
$pdetail
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
first
();
$pteam
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
orderby
(
'roleid'
)
->
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.project'
,
compact
(
'month'
,
'year'
,
'pteam'
,
'pdetail'
));
}
public
function
deptreport
()
{
$dept
=
Department
::
all
()
->
except
([
8
]);
$month
=
[];
for
(
$m
=
1
;
$m
<=
12
;
$m
++
)
{
$month
[]
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$m
,
1
,
date
(
'Y'
)));
}
$year
=
Ts_master
::
select
(
'tm_year'
)
->
distinct
(
'tm_year'
)
->
orderby
(
'tm_year'
,
'DESC'
)
->
get
();
return
view
(
'timesheet::report.deptReport'
,
compact
(
'month'
,
'year'
,
'dept'
));
}
public
function
generatedeptreport
(
Request
$request
)
{
dd
(
$request
);
return
view
(
'timesheet::report.
projec
t'
);
return
view
(
'timesheet::report.
departmen
t'
);
}
}
\ No newline at end of file
packages/portal/timesheet/src/Model/VwProject.php
0 → 100644
View file @
ea6d844d
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Notifications\Notifiable
;
class
VwProject
extends
Model
{
use
Notifiable
;
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'vw_project_report'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/ServiceProvider.php
View file @
ea6d844d
...
...
@@ -100,11 +100,11 @@ class ServiceProvider extends BaseServiceProvider
->
data
(
'icon'
,
'file alternate outline icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
laporan
);
$laporan
->
add
(
__
(
'Report by Project'
))
$laporan
->
add
(
__
(
'Report by Project'
)
,
route
(
'timesheet::report.projectReport'
)
)
->
data
(
'icon'
,
'file alternate outline icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
laporan
);
$laporan
->
add
(
__
(
'Report by Department'
),
route
(
'timesheet::report.
projectR
eport'
))
$laporan
->
add
(
__
(
'Report by Department'
),
route
(
'timesheet::report.
deptr
eport'
))
->
data
(
'icon'
,
'file alternate outline icon'
)
->
active
(
'pengurusan/*'
)
->
data
(
'permission'
,
Permission
::
laporan
);
...
...
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