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
1ba1c7d7
Commit
1ba1c7d7
authored
Oct 31, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log Kak Shikin #41.1) revamp - Table project report with mandays
parent
106366c5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
17 deletions
+67
-17
packages/portal/timesheet/resources/views/maintenance/mandays.blade.php
+2
-1
packages/portal/timesheet/resources/views/report/project.blade.php
+40
-11
packages/portal/timesheet/src/Http/Controllers/ReportController.php
+18
-5
packages/portal/timesheet/src/Model/Pmandays.php
+7
-0
No files found.
packages/portal/timesheet/resources/views/maintenance/mandays.blade.php
View file @
1ba1c7d7
...
...
@@ -18,7 +18,7 @@
</thead>
<tbody>
<?php
$limit
= count(
$limitrole
);
// dd(
$
limit
role
);
// dd(
$role
);
?>
@foreach(
$role
as
$key
=>
$value
)
...
...
@@ -59,6 +59,7 @@
onchange="
calcDays
(
this
.
value
,{{
$limit
}},{{
data_get
(
$value
,
'role.id'
)}})
">
</td>
</tr>
@endforeach
<tr>
<td class="
single
line
"></td>
...
...
packages/portal/timesheet/resources/views/report/project.blade.php
View file @
1ba1c7d7
...
...
@@ -48,42 +48,71 @@
</tr>
</thead>
<tbody>
<?php
$totalhours
=
$totaldays
= 0;
?>
<?php
$totalhours
=
$totaldays
= 0;?>
@foreach(
$pteam
as
$key
=>
$team
)
<?php
$balhours
= 0; ?>
@foreach(
$ptstaffs
as
$key
=>
$staff
)
@if(data_get(
$team
,'pm_roles') == data_get(
$staff
,'roleid'))
<?php
// dump(
$staff->staffid
);
$count
=
$ptstaffs->where
('roleid', data_get(
$team
,'pm_roles'));
$acc
=
$accumulate->where
('staffid', data_get(
$staff
,'staffid'));
// dump(
$acc
);
?>
<tr>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{data_get($team,'role')}
}
</td>
<td class="
center
aligned
">allocation</td>
<td class="
center
aligned
">accumulate</td>
<td style="
width
:
10
%
">
{
{data_get($team,'name')}
}
</td>
<td style="
width
:
10
%
" class="
center
aligned
">
{
{data_get($team,'role.role')}
}
</td>
<td class="
center
aligned
">
{
{data_get($team,'pm_days')}
}
Days <br>
{
{data_get($team,'pm_hours')}
}
Hours
<?php
$balhours
= data_get(
$team
,'pm_hours'); ?>
</td>
<td class="
center
aligned
">
<?php
$sum
= 0;
foreach (
$acc
as
$key
=>
$value
) {
$sum
+= data_get(
$value
, 'tp_hours');
}
?>
{{ number_format(
$sum
/8, 1, '.', '') }} Days <br>
{{ number_format(
$sum
, 1, '.', '') }} Hours
<?php
$balhours
-=
$sum
; ?>
</td>
<td style="
width
:
10
%
">
{
{data_get($staff,'name')}
}
</td>
<td style="
width
:
15
%
" class="
center
aligned
">
<?php
$sumhours
= 0; ?>
@foreach(
$ptdetail
as
$key
=>
$hours
)
@if(data_get(
$hours
,'staffid') == data_get(
$team
,'staffid'))
@if(data_get(
$hours
,'staffid') == data_get(
$staff
,'staffid'))
<?php
$sumhours
+= data_get(
$hours
,'hours'); ?>
<?php
$totalhours
+= data_get(
$hours
,'hours'); ?>
@endif
@endforeach
@if(
$sumhours
== 0)
@else
{
{$sumhours
}
}
{{ number_format(
$sumhours
, 1, '.', '')
}}
@endif
</td>
<td style="
width
:
15
%
" class="
center
aligned
">
<?php
$sumdays
= 0; ?>
@foreach(
$ptdetail
as
$key
=>
$hours
)
@if(data_get(
$hours
,'staffid') == data_get(
$team
,'staffid'))
<!-- {{number_format(data_get(
$hours
,'hours')/8, 1, '.', '')}} -->
@if(data_get(
$hours
,'staffid') == data_get(
$staff
,'staffid'))
<?php
$sumdays
+= number_format(data_get(
$hours
,'hours')/8, 1, '.', ''); ?>
<?php
$totaldays
+= number_format(data_get(
$hours
,'hours')/8, 1, '.', ''); ?>
@endif
@endforeach
@if(
$sumdays
== 0)
@else
{
{$sumdays
}
}
{{ number_format(
$sumdays
, 1, '.', '')
}}
@endif
</td>
<td class="
center
aligned
">balance</td>
<td class="
center
aligned
">
{{ number_format(
$balhours
/8, 1, '.', '') }} Days <br>
{{ number_format(
$balhours
, 1, '.', '') }} Hours
</td>
</tr>
@endif
@endforeach
@endforeach
</tbody>
<!-- <tfoot class="
full
-
width
">
...
...
packages/portal/timesheet/src/Http/Controllers/ReportController.php
View file @
1ba1c7d7
...
...
@@ -12,6 +12,7 @@ use Portal\Timesheet\Model\Project;
use
Portal\Timesheet\Model\Tproject
;
use
Portal\Timesheet\Model\Department
;
use
Portal\Timesheet\Model\Pteam
;
use
Portal\Timesheet\Model\Pmandays
;
use
Portal\Timesheet\Model\Staff_info
;
use
Portal\Timesheet\Model\Overhead
;
use
Portal\Timesheet\Model\Role
;
...
...
@@ -144,14 +145,14 @@ class ReportController extends Controller
}
$checkyear
=
Ts_master
::
select
(
'tm_year'
)
->
where
(
'tm_timesheet_master_sts'
,
4
)
//
->where('tm_timesheet_master_sts', 4)
->
distinct
(
'tm_year'
)
->
orderby
(
'tm_year'
,
'DESC'
)
->
first
();
if
(
$checkyear
)
{
$year
=
Ts_master
::
select
(
'tm_year'
)
->
where
(
'tm_timesheet_master_sts'
,
4
)
//
->where('tm_timesheet_master_sts', 4)
->
distinct
(
'tm_year'
)
->
orderby
(
'tm_year'
,
'DESC'
)
->
get
();
...
...
@@ -176,16 +177,22 @@ class ReportController extends Controller
}
$pid
=
$request
->
project
;
// dd($pid);
$pdetail
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
with
(
'mandays'
)
->
first
();
// dd($pdetail);
$pt
eam
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
$pt
staffs
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
where
(
'roleid'
,
'<>'
,
'7'
)
->
orderby
(
'roleid'
)
->
groupby
(
'name'
)
->
get
();
$pteam
=
Pmandays
::
where
(
'fk_project'
,
$pid
)
->
with
(
'role'
)
->
orderby
(
'pm_roles'
,
'ASC'
)
->
get
();
// dd($pteam);
$ptdetail
=
VwProject
::
where
(
'pid'
,
$request
->
project
)
->
where
(
'MONTH'
,
$request
->
month
)
...
...
@@ -193,6 +200,12 @@ class ReportController extends Controller
->
where
(
'roleid'
,
'<>'
,
'7'
)
->
orderby
(
'roleid'
)
->
get
();
// dd($ptdetail);
$accumulate
=
Tproject
::
where
(
'td_project'
,
$pid
)
->
where
(
'tp_year'
,
$request
->
year
)
->
where
(
'tp_month'
,
$request
->
month
)
->
get
();
// dd($accumulate);
$year
=
date
(
'Y'
);
if
(
$request
->
year
)
{
...
...
@@ -203,7 +216,7 @@ class ReportController extends Controller
$month
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$request
->
month
,
1
,
date
(
'Y'
)));
return
view
(
'timesheet::report.project'
,
compact
(
'month'
,
'intmonth'
,
'year'
,
'pteam'
,
'pdetail'
,
'ptdetail'
,
'pid'
));
return
view
(
'timesheet::report.project'
,
compact
(
'month'
,
'intmonth'
,
'year'
,
'pteam'
,
'pdetail'
,
'ptdetail'
,
'pid'
,
'ptstaffs'
,
'accumulate'
));
}
public
function
deptreport
()
...
...
packages/portal/timesheet/src/Model/Pmandays.php
View file @
1ba1c7d7
...
...
@@ -24,6 +24,13 @@ class Pmandays extends Model
* @return void
* @author
**/
public
function
role
()
{
// dd('1');
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Role'
,
'id'
,
'pm_roles'
);
}
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