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
9b2b22b9
Commit
9b2b22b9
authored
Nov 24, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5a3f9eb6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
51 deletions
+18
-51
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
+8
-7
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+10
-44
No files found.
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
View file @
9b2b22b9
...
@@ -211,8 +211,8 @@
...
@@ -211,8 +211,8 @@
@endfor
@endfor
@endif
@endif
<th style="
width
:
5
%
">@if(
$totalchargeableall
){{ number_format(
$totalchargeableall
, 1, '.', '') }}@else 0 @endif</th>
<th style="
width
:
5
%
">@if(
$totalchargeableall
){{ number_format(
$totalchargeableall
, 1, '.', '') }}@else 0
.0
@endif</th>
<th style="
width
:
5
%
">@if(
$totalchargeableall
){{ number_format(
$totalchargeableall
/8, 1, '.', '') }}@else 0 @endif</th>
<th style="
width
:
5
%
">@if(
$totalchargeableall
){{ number_format(
$totalchargeableall
/8, 1, '.', '') }}@else 0
.0
@endif</th>
</tfoot>
</tfoot>
</table>
</table>
</div>
</div>
...
@@ -260,6 +260,7 @@
...
@@ -260,6 +260,7 @@
<?php
<?php
$totaloverhead
= 0;
$totaloverhead
= 0;
?>
?>
<tr>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">{{
$projectoverhead['pname']
}}</td>
<td style="
width
:
23
%
;
">{{
$projectoverhead['pname']
}}</td>
...
@@ -320,8 +321,8 @@
...
@@ -320,8 +321,8 @@
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
, 1, '.', '') }}</td>
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
, 1, '.', '') }}</td>
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
/8, 1, '.', '') }}</td>
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
/8, 1, '.', '') }}</td>
@else
@else
<td style="
width
:
5
%
">0</td>
<td style="
width
:
5
%
">0
.0
</td>
<td style="
width
:
5
%
">0</td>
<td style="
width
:
5
%
">0
.0
</td>
@endif
@endif
</tr>
</tr>
@endforeach
@endforeach
...
@@ -372,8 +373,8 @@
...
@@ -372,8 +373,8 @@
<?php
<?php
// dd(
$totaloverheadhrs
);
// dd(
$totaloverheadhrs
);
?>
?>
<th style="
width
:
5
%
">@if(
$totaloverheadall
) {{ number_format(
$totaloverheadall
, 1, '.', '') }} @endif</th>
<th style="
width
:
5
%
">@if(
$totaloverheadall
) {{ number_format(
$totaloverheadall
, 1, '.', '') }} @e
lse 0.0 @e
ndif</th>
<th style="
width
:
5
%
">@if(
$totaloverheadall
) {{ number_format(
$totaloverheadall
/8, 1, '.', '') }} @endif</th>
<th style="
width
:
5
%
">@if(
$totaloverheadall
) {{ number_format(
$totaloverheadall
/8, 1, '.', '') }} @e
lse 0.0 @e
ndif</th>
</tfoot>
</tfoot>
</table>
</table>
</div>
</div>
...
@@ -504,7 +505,7 @@
...
@@ -504,7 +505,7 @@
<th style="
width
:
4
%
;
">{{ number_format(
$ac
, '1', '.', '') }}</th>
<th style="
width
:
4
%
;
">{{ number_format(
$ac
, '1', '.', '') }}</th>
@endfor
@endfor
@endif
@endif
<th style="
width
:
5
%
;
">
@if(
$check
) {{ number_format((
$totalchargeableall
+
$totaloverheadall
), 1, '.', '') }} @else 0 @endif
</th>
<th style="
width
:
5
%
;
">
{{ number_format((
$totalchargeableall
+
$totaloverheadall
), 1, '.', '') }}
</th>
<th style="
width
:
5
%
;
"> {{ number_format((
$totalchargeableall
+
$totaloverheadall
)/8, 1, '.', '') }} </th>
<th style="
width
:
5
%
;
"> {{ number_format((
$totalchargeableall
+
$totaloverheadall
)/8, 1, '.', '') }} </th>
</tr>
</tr>
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
9b2b22b9
...
@@ -1254,7 +1254,6 @@ class DashboardController extends Controller
...
@@ -1254,7 +1254,6 @@ class DashboardController extends Controller
public
function
timesheetViewer
(
Request
$request
)
public
function
timesheetViewer
(
Request
$request
)
{
{
// dd($request);
$curruser
=
$user
=
Staff_info
::
where
(
'fk_users'
,
Auth
::
id
())
$curruser
=
$user
=
Staff_info
::
where
(
'fk_users'
,
Auth
::
id
())
->
first
();
->
first
();
...
@@ -1266,7 +1265,6 @@ class DashboardController extends Controller
...
@@ -1266,7 +1265,6 @@ class DashboardController extends Controller
$profile
=
VwViewer
::
where
(
'STAFF_ID'
,
$user
->
staff_id
)
$profile
=
VwViewer
::
where
(
'STAFF_ID'
,
$user
->
staff_id
)
->
orderby
(
'DEPARTMENT'
,
'DESC'
)
->
orderby
(
'DEPARTMENT'
,
'DESC'
)
->
first
();
->
first
();
// dd($user->staff_id);
$dept
=
Department
::
where
(
'id'
,
$user
->
fk_lkp_department
)
$dept
=
Department
::
where
(
'id'
,
$user
->
fk_lkp_department
)
->
first
();
->
first
();
...
@@ -1292,16 +1290,17 @@ class DashboardController extends Controller
...
@@ -1292,16 +1290,17 @@ class DashboardController extends Controller
$date
=
Carbon
::
createFromFormat
(
'm/d/Y'
,
$myDate
);
$date
=
Carbon
::
createFromFormat
(
'm/d/Y'
,
$myDate
);
$strdays
=
[];
$strdays
=
[];
$arraydates
=
[];
for
(
$i
=
0
;
$i
<
$daymonth
;
$i
++
)
{
for
(
$i
=
0
;
$i
<
$daymonth
;
$i
++
)
{
$tempdate
=
$year
.
'-'
.
sprintf
(
'%02d'
,
$month
)
.
'-'
.
sprintf
(
'%02d'
,
$i
+
1
);
$tempdate
=
$year
.
'-'
.
sprintf
(
'%02d'
,
$month
)
.
'-'
.
sprintf
(
'%02d'
,
$i
+
1
);
$arraydates
[]
=
$tempdate
;
$strday
=
Carbon
::
createFromFormat
(
'Y-m-d'
,
$tempdate
)
->
format
(
'l'
);
$strday
=
Carbon
::
createFromFormat
(
'Y-m-d'
,
$tempdate
)
->
format
(
'l'
);
$strdays
[
$i
]
=
substr
(
$strday
,
0
,
3
);
$strdays
[
$i
]
=
substr
(
$strday
,
0
,
3
);
}
}
$strMonth
=
$date
->
format
(
'F'
);
$strMonth
=
$date
->
format
(
'F'
);
$chargeable
=
1
;
$chargeable
=
1
;
$overhead
=
3
;
$overhead
=
3
;
...
@@ -1352,7 +1351,7 @@ class DashboardController extends Controller
...
@@ -1352,7 +1351,7 @@ class DashboardController extends Controller
->
groupby
(
'fk_o_id'
)
->
groupby
(
'fk_o_id'
)
->
orderby
(
'fk_o_id'
,
'asc'
)
->
orderby
(
'fk_o_id'
,
'asc'
)
->
get
();
->
get
();
// dd($ovlist);
foreach
(
$ovlist
as
$key
=>
$value
)
foreach
(
$ovlist
as
$key
=>
$value
)
{
{
$overheadlist
[]
=
[
$overheadlist
[]
=
[
...
@@ -1361,43 +1360,6 @@ class DashboardController extends Controller
...
@@ -1361,43 +1360,6 @@ class DashboardController extends Controller
];
];
}
}
// dd($overheadlist);
// $tempOverhead[0] = "";
// $tempOverheadid[0] = 0;
// if(isset($overheadhour[0]))
// {
// // dd('sini ke?');
// $tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
// $tempOverheadid[0] = $overheadhour[0]->fk_o_id;
// $j = 0;
// for($i = 0; $i < count($overheadhour); $i++)
// {
// if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
// }
// else
// {
// $j++;
// $tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
// $tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
// }
// }
// // dd($tempOverhead);
// foreach ($tempOverhead as $key => $value) {
// $overheadlist[] = [
// 'pid' => $tempOverheadid[$key],
// 'pname' => $tempOverhead[$key],
// ];
// }
// }
// else
// {
// // dd('ke sini?');
// }
$totalchargehrs
=
$check
->
tm_chargeable_hrs
;
$totalchargehrs
=
$check
->
tm_chargeable_hrs
;
$totaloverheadhrs
=
$check
->
tm_overhead_hrs
;
$totaloverheadhrs
=
$check
->
tm_overhead_hrs
;
...
@@ -1420,9 +1382,13 @@ class DashboardController extends Controller
...
@@ -1420,9 +1382,13 @@ class DashboardController extends Controller
$notes
=
null
;
$notes
=
null
;
$check
=
null
;
$check
=
null
;
}
}
// dd($check->id);
return
view
(
'timesheet::dashboard.timesheetViewer'
,
compact
(
'curruser'
,
'user'
,
'profile'
,
'dept'
,
'phase'
,
'month'
,
'year'
,
'strMonth'
,
'daymonth'
,
'chargeablelist'
,
'overheadlist'
,
'chargehour'
,
'totalchargehrs'
,
'totaloverheadhrs'
,
'overheadhour'
,
'notes'
,
'check'
,
'strdays'
));
$statushari
=
LAttendance
::
where
(
'staff_id'
,
data_get
(
$user
,
'staff_id'
))
->
whereIn
(
'DATE'
,
$arraydates
)
->
get
();
// dd($statushari);
return
view
(
'timesheet::dashboard.timesheetViewer'
,
compact
(
'curruser'
,
'user'
,
'profile'
,
'dept'
,
'phase'
,
'month'
,
'year'
,
'strMonth'
,
'daymonth'
,
'chargeablelist'
,
'overheadlist'
,
'chargehour'
,
'totalchargehrs'
,
'totaloverheadhrs'
,
'overheadhour'
,
'notes'
,
'check'
,
'strdays'
,
'statushari'
));
}
}
public
function
tsubmit
(
Request
$request
)
public
function
tsubmit
(
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