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
045b5422
Commit
045b5422
authored
Nov 22, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
6bda12c8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
25 deletions
+33
-25
packages/portal/timesheet/resources/views/ajax/senaraistaff.blade.php
+2
-2
packages/portal/timesheet/resources/views/maintenance/penambahanProjectTeam.blade.php
+2
-2
packages/portal/timesheet/resources/views/report/department.blade.php
+9
-9
packages/portal/timesheet/resources/views/report/ringkasan.blade.php
+3
-5
packages/portal/timesheet/src/Http/Controllers/MaintenanceController.php
+9
-5
packages/portal/timesheet/src/Http/Controllers/ReportController.php
+2
-1
packages/portal/timesheet/src/Model/Staff_info.php
+1
-1
packages/portal/timesheet/src/Model/Users.php
+5
-0
No files found.
packages/portal/timesheet/resources/views/ajax/senaraistaff.blade.php
View file @
045b5422
@
if
(
$staffs
)
@
if
(
$staffs
)
@
foreach
(
$staffs
as
$key
=>
$staff
)
@
foreach
(
$staffs
as
$key
=>
$staff
)
<
div
class
="
item
" data-value="
{{
data_get
(
$staff
,
'id'
)
}}
" data-text="
{{
data_get
(
$staff
,
'
full
name'
)
}}
">
<
div
class
="
item
" data-value="
{{
data_get
(
$staff
,
'id'
)
}}
" data-text="
{{
data_get
(
$staff
,
'name'
)
}}
">
{{ data_get(
$staff
,'
full
name') }}
{{ data_get(
$staff
,'name') }}
</div>
</div>
@endforeach
@endforeach
@else
@else
...
...
packages/portal/timesheet/resources/views/maintenance/penambahanProjectTeam.blade.php
View file @
045b5422
...
@@ -39,9 +39,9 @@
...
@@ -39,9 +39,9 @@
<div class="
default
text
">Staff Name</div>
<div class="
default
text
">Staff Name</div>
<div class="
menu
" id="
divstaff
" name="
divstaff
">
<div class="
menu
" id="
divstaff
" name="
divstaff
">
@foreach(
$staffs
as
$key
=>
$staff
)
@foreach(
$staffs
as
$key
=>
$staff
)
<div class="
item
" data-value="
{{
data_get
(
$staff
,
'id'
)}}
" data-text="
{{
data_get
(
$staff
,
'fullname'
)}}
">
<!--
<div class="
item
" data-value="
{{
data_get
(
$staff
,
'id'
)}}
" data-text="
{{
data_get
(
$staff
,
'fullname'
)}}
">
{
{data_get($staff,'fullname')}
}
{
{data_get($staff,'fullname')}
}
</div>
</div> -->
@endforeach
@endforeach
</div>
</div>
</div>
</div>
...
...
packages/portal/timesheet/resources/views/report/department.blade.php
View file @
045b5422
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<?php
<?php
//
$chargeproject
=
$project->where
('ptype', 1);
//
$chargeproject
=
$project->where
('ptype', 1);
$chargeproject
=
$project->where
('ptype', 1);
$chargeproject
=
$project->where
('ptype', 1);
dd(
$chargeproject
);
//
dd(
$chargeproject
);
$chargehours
=
$chargedays
= 0;
$chargehours
=
$chargedays
= 0;
?>
?>
...
@@ -64,8 +64,8 @@
...
@@ -64,8 +64,8 @@
<td style="
width
:
5
%
" class="
center
aligned
">C</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
:
15
%
" class="
center
aligned
">
{
{data_get($chargeable,'pcode')}
}
</td>
<td style="
width
:
25
%
">
{
{data_get($chargeable,'pname')}
}
</td>
<td style="
width
:
25
%
">
{
{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'), '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
">{{
number_format(data_get(
$chargeable
,'hours')/8, '1', '.', '')
}}</td>
</tr>
</tr>
<?php
<?php
$chargehours
+= data_get(
$chargeable
,'hours');
$chargehours
+= data_get(
$chargeable
,'hours');
...
@@ -85,8 +85,8 @@
...
@@ -85,8 +85,8 @@
<td style="
width
:
5
%
" class="
center
aligned
">NC</td>
<td style="
width
:
5
%
" class="
center
aligned
">NC</td>
<td style="
width
:
15
%
" class="
center
aligned
"></td>
<td style="
width
:
15
%
" class="
center
aligned
"></td>
<td style="
width
:
25
%
">
{
{data_get($value,'pname')}
}
</td>
<td style="
width
:
25
%
">
{
{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'), '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
">{{
number_format(data_get(
$value
,'hours')/8, '1', '.', '')
}}</td>
</tr>
</tr>
<?php
<?php
$overheadhours
+= data_get(
$value
,'hours');
$overheadhours
+= data_get(
$value
,'hours');
...
@@ -102,8 +102,8 @@
...
@@ -102,8 +102,8 @@
<tr>
<tr>
<td colspan="
3
"></td>
<td colspan="
3
"></td>
<td style="
width
:
25
%
" class="
center
aligned
">Total</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
">{{
number_format(
$staffhours
, '1', '.', '')
}}</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{
$staffdays
}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">{{
number_format(
$staffdays
, '1', '.', '')
}}</td>
</tr>
</tr>
</tbody>
</tbody>
...
@@ -116,8 +116,8 @@
...
@@ -116,8 +116,8 @@
<tr>
<tr>
<th colspan="
3
"><strong>Total</strong></th>
<th colspan="
3
"><strong>Total</strong></th>
<th style="
width
:
25
%
" class="
center
aligned
"></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>{{
number_format(
$totalhours
, '1', '.', '')
}}</strong></th>
<th style="
width
:
10
%
" class="
center
aligned
"><strong>
{
{
$totaldays
}
}
</strong></th>
<th style="
width
:
10
%
" class="
center
aligned
"><strong>{{
number_format(
$totaldays
, '1', '.', '')
}}</strong></th>
</tr>
</tr>
</tfoot>
</tfoot>
</table>
</table>
...
...
packages/portal/timesheet/resources/views/report/ringkasan.blade.php
View file @
045b5422
...
@@ -28,9 +28,9 @@
...
@@ -28,9 +28,9 @@
<table class="
ui
unstackable
celled
table
" style="
width
:
100
%
">
<table class="
ui
unstackable
celled
table
" style="
width
:
100
%
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
5
"></th>
<th colspan="
4
"></th>
<th colspan="
{{
count
(
$chargeproject
)
+
2
}}
" class="
center
aligned
">Chargeable</th>
<th colspan="
{{
count
(
$chargeproject
)
+
2
}}
" class="
center
aligned
">Chargeable</th>
<th colspan="
{{
count
(
$overhead
)
+
2
}}
" class="
center
aligned
">
Non-Chargeable
</th>
<th colspan="
{{
count
(
$overhead
)
+
2
}}
" class="
center
aligned
">
Overhead
</th>
<th rowspan="
2
" class="
center
aligned
">Total (Working Days)</th>
<th rowspan="
2
" class="
center
aligned
">Total (Working Days)</th>
</tr>
</tr>
<tr>
<tr>
...
@@ -38,7 +38,6 @@
...
@@ -38,7 +38,6 @@
<th>Department</th>
<th>Department</th>
<th>Staff Id</th>
<th>Staff Id</th>
<th>Staff Name</th>
<th>Staff Name</th>
<th>Position</th>
@foreach(
$chargeproject
as
$key
=>
$chargeable
)
@foreach(
$chargeproject
as
$key
=>
$chargeable
)
<th>
<th>
{{data_get(
$chargeable
, 'p_project_code')}}
{{data_get(
$chargeable
, 'p_project_code')}}
...
@@ -62,7 +61,6 @@
...
@@ -62,7 +61,6 @@
<td>
{
{data_get($staff,'deptCode')}
}
</td>
<td>
{
{data_get($staff,'deptCode')}
}
</td>
<td>
{
{data_get($staff,'staffid')}
}
</td>
<td>
{
{data_get($staff,'staffid')}
}
</td>
<td class="
single
line
">
{
{data_get($staff,'name')}
}
</td>
<td class="
single
line
">
{
{data_get($staff,'name')}
}
</td>
<td></td>
<?php
$totalc
= 0; ?>
<?php
$totalc
= 0; ?>
@foreach(
$chargeproject
as
$key
=>
$chargeable
)
@foreach(
$chargeproject
as
$key
=>
$chargeable
)
<td>
<td>
...
@@ -112,7 +110,7 @@
...
@@ -112,7 +110,7 @@
<tfoot>
<tfoot>
<tr>
<tr>
<th colspan="
5
" class="
center
aligned
">
<th colspan="
4
" class="
center
aligned
">
<strong>Total</strong>
<strong>Total</strong>
</th>
</th>
<?php
$tch
= 0; ?>
<?php
$tch
= 0; ?>
...
...
packages/portal/timesheet/src/Http/Controllers/MaintenanceController.php
View file @
045b5422
...
@@ -368,11 +368,14 @@ class MaintenanceController extends Controller
...
@@ -368,11 +368,14 @@ class MaintenanceController extends Controller
foreach
(
$departments
as
$key
=>
$value
)
foreach
(
$departments
as
$key
=>
$value
)
{
{
$staffs
=
Staff_info
::
where
(
'fk_lkp_department'
,
$value
->
id
)
$staffs
=
Users
::
with
(
'toStaffInfo'
)
->
where
(
'status'
,
'ACTIVE'
)
->
get
();
->
get
();
// dd($value->id);
// dd($staffs);
// dd(data_get($staffs,'toUser'));
}
}
$roles
=
Role
::
where
(
'status'
,
1
)
$roles
=
Role
::
where
(
'status'
,
1
)
->
get
();
->
get
();
...
@@ -645,9 +648,10 @@ class MaintenanceController extends Controller
...
@@ -645,9 +648,10 @@ class MaintenanceController extends Controller
public
function
loadstaff
(
$dept
)
public
function
loadstaff
(
$dept
)
{
{
$staffs
=
Staff_info
::
where
(
'fk_lkp_department'
,
$dept
)
$staffs
=
Users
::
where
(
'status'
,
'ACTIVE'
)
->
where
(
'status'
,
1
)
->
whereHas
(
'toStaffInfo'
,
function
(
$q
)
use
(
$dept
){
->
get
();
$q
->
where
(
'fk_lkp_department'
,
$dept
);
})
->
get
();
return
view
(
'timesheet::ajax.senaraistaff'
,
compact
(
'staffs'
));
return
view
(
'timesheet::ajax.senaraistaff'
,
compact
(
'staffs'
));
}
}
...
...
packages/portal/timesheet/src/Http/Controllers/ReportController.php
View file @
045b5422
...
@@ -84,7 +84,7 @@ class ReportController extends Controller
...
@@ -84,7 +84,7 @@ class ReportController extends Controller
->
get
();
->
get
();
// dd($ovhours);
// dd($ovhours);
$chargeproject
=
VwChargeable
::
all
();
$chargeproject
=
VwChargeable
::
where
(
'deleted_at'
,
null
)
->
get
();
// dd($chargeproject);
// dd($chargeproject);
if
(
$request
->
dept
==
'all'
)
{
if
(
$request
->
dept
==
'all'
)
{
$staffs
=
VwStaff
::
orderby
(
'deptID'
)
$staffs
=
VwStaff
::
orderby
(
'deptID'
)
...
@@ -254,6 +254,7 @@ class ReportController extends Controller
...
@@ -254,6 +254,7 @@ class ReportController extends Controller
->
where
(
'month'
,
$request
->
month
)
->
where
(
'month'
,
$request
->
month
)
->
where
(
'year'
,
$request
->
year
)
->
where
(
'year'
,
$request
->
year
)
->
get
();
->
get
();
// dd($overhead);
$year
=
date
(
'Y'
);
$year
=
date
(
'Y'
);
if
(
$request
->
year
)
{
if
(
$request
->
year
)
{
...
...
packages/portal/timesheet/src/Model/Staff_info.php
View file @
045b5422
...
@@ -20,7 +20,7 @@ class Staff_info extends Model
...
@@ -20,7 +20,7 @@ class Staff_info extends Model
public
function
toUser
()
public
function
toUser
()
{
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Users'
,
'u_staffID'
,
'staff_id'
);
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Users'
,
'u_staffID'
,
'staff_id'
)
->
where
(
'status'
,
'ACTIVE'
)
;
}
}
public
function
deptname
()
public
function
deptname
()
...
...
packages/portal/timesheet/src/Model/Users.php
View file @
045b5422
...
@@ -28,5 +28,10 @@ class Users extends Model
...
@@ -28,5 +28,10 @@ class Users extends Model
}
}
public
function
toStaffInfo
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'staff_id'
,
'u_staffID'
);
}
}
}
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