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
8d4d849f
Commit
8d4d849f
authored
Oct 28, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bod approval screen -> checking to display detail overhead and chargeable
parent
5ee38e76
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
189 additions
and
41 deletions
+189
-41
packages/portal/timesheet/resources/views/dashboard/approvalaction.blade.php
+148
-0
packages/portal/timesheet/resources/views/dashboard/revaction.blade.php
+35
-35
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+6
-6
No files found.
packages/portal/timesheet/resources/views/dashboard/approvalaction.blade.php
View file @
8d4d849f
...
...
@@ -44,6 +44,7 @@
</tbody>
</table>
@if(data_get(
$profile
,'tp_project_type') == 1)
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
...
...
@@ -185,6 +186,153 @@
<th>@if(
$totalchargehrs
){{ number_format(
$totalchargehrs
/8, 1, '.', '') }}@else 0 @endif</th>
</tfoot> -->
</table>
@else
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
" rowspan="
3
" class="
center
aligned
" style="
width
:
27
%
;
">Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
2
" rowspan="
2
" class="
center
aligned
">Total</th>
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@endif
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach(
$overheadlist
as
$key
=>
$projectoverhead
)
<?php
$totaloverhead
= 0; ?>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">{{
$projectoverhead['pname']
}}</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valoverheadhour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$overheadhour
)
{
// dd('masuk');
$valoverheadhour
=
$overheadhour->where
('td_date','=',
$date
)
->where('fk_o_id',
$projectoverhead['pid']
)
->where('tm_phase',
$phase
)
->first();
$totaloverhead
+= data_get(
$valoverheadhour
,'td_hours');
}
?>
@if(
$valoverheadhour
)
<td style="
width
:
4
%
;
">{{ data_get(
$valoverheadhour
,'td_hours') }}</td>
@else
<td style="
width
:
4
%
;
"></td>
@endif
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$valoverheadhour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$overheadhour
)
{
$valoverheadhour
=
$overheadhour->where
('td_date','=',
$date
)
->where('fk_o_id',
$projectoverhead['pid']
)
->where('tm_phase',
$phase
)
->first();
$totaloverhead
+= data_get(
$valoverheadhour
,'td_hours');
}
?>
@if(
$valoverheadhour
)
<td style="
width
:
4
%
;
">{{ data_get(
$valoverheadhour
,'td_hours') }}</td>
@else
<td style="
width
:
4
%
;
"></td>
@endif
@endfor
@endif
@if(
$totaloverhead
)
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
, 1, '.', '') }}</td>
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
/8, 1, '.', '') }}</td>
@else
<td style="
width
:
5
%
">0</td>
<td style="
width
:
5
%
">0</td>
@endif
</tr>
@endforeach
</tbody>
<!-- <tfoot>
<th colspan="
2
">Total (B)</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if (
$overheadhour
) {
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+= data_get(
$value
,'td_hours');
}
}
?>
<th style="
width
:
4
%
">{{
$totaloverheadbyday
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if (
$overheadhour
) {
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+= data_get(
$value
,'td_hours');
}
}
?>
<th style="
width
:
4
%
">{{
$totaloverheadbyday
}}</th>
@endfor
@endif
<th style="
width
:
5
%
">@if(
$totaloverheadhrs
) {{ number_format(
$totaloverheadhrs
, 1, '.', '') }} @else 0 @endif</th>
<th style="
width
:
5
%
">@if(
$totaloverheadhrs
) {{ number_format(
$totaloverheadhrs
/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> -->
</table>
@endif
</div>
<div class="
ui
segment
">
...
...
packages/portal/timesheet/resources/views/dashboard/revaction.blade.php
View file @
8d4d849f
...
...
@@ -43,43 +43,43 @@
</tr>
</tbody>
</table>
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
" rowspan="
3
" class="
center
aligned
" style="
width
:
27
%
;
">Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
2
" rowspan="
2
" class="
center
aligned
">Total</th>
</tr>
<tr>
@if(
$phase
== 1)
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
" rowspan="
3
" class="
center
aligned
" style="
width
:
27
%
;
">Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
2
" rowspan="
2
" class="
center
aligned
">Total</th>
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@endif
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
@endif
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach(
$overheadlist
as
$key
=>
$projectoverhead
)
<?php
$totaloverhead
= 0; ?>
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
8d4d849f
...
...
@@ -981,7 +981,7 @@ class DashboardController extends Controller
$bod
=
Users
::
find
(
Auth
::
id
());
// dd($profile);
// dd($profile
->tp_project_type
);
$phase
=
$profile
->
tp_phase
;
...
...
@@ -1019,7 +1019,7 @@ class DashboardController extends Controller
->
where
(
'tm_phase'
,
$phase
)
->
with
(
'attachement'
)
->
first
();
// dd($check);
$chargeableproject
=
Tproject
::
where
(
'fk_tm_id'
,
data_get
(
$check
,
'id'
))
->
where
(
'tp_project_type'
,
1
)
->
with
(
'project'
)
...
...
@@ -1075,11 +1075,11 @@ class DashboardController extends Controller
}
}
foreach
(
$tempOverhead
as
$key
=>
$value
)
{
if
(
$profile
->
tp_project_type
==
3
)
{
$overheadlist
[]
=
[
'pid'
=>
$
tempOverheadid
[
$key
]
,
'pname'
=>
$
tempOverhead
[
$key
]
,
'pid'
=>
$
profile
->
fk_o_id
,
'pname'
=>
$
profile
->
tp_project_name
,
];
}
}
...
...
@@ -1111,7 +1111,7 @@ class DashboardController extends Controller
$check
=
null
;
}
return
view
(
'timesheet::dashboard.approvalaction'
,
compact
(
'profile'
,
'bod'
,
'page'
,
'staff'
,
'daymonth'
,
'strMonth'
,
'year'
,
'month'
,
'phase'
,
'strdays'
,
'chargeablelist'
,
'chargehour'
,
'totalchargehrs'
));
return
view
(
'timesheet::dashboard.approvalaction'
,
compact
(
'profile'
,
'bod'
,
'page'
,
'staff'
,
'daymonth'
,
'strMonth'
,
'year'
,
'month'
,
'phase'
,
'strdays'
,
'chargeablelist'
,
'chargehour'
,
'totalchargehrs'
,
'overheadlist'
,
'overheadhour'
,
'totaloverheadhrs'
));
}
public
function
approval
(
Request
$request
)
...
...
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