Commit 9e777547 by Azhan Hannan

report ringkasan & report project changes

parent 933f0e6d
<table> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th>Project </th> <th style="width: 10%">Project </th>
<th>:</th> <th style="width: 1%">:</th>
<th colspan="3"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th> <th colspan="2"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th>
</tr> </tr>
<tr> <tr>
<th> Month/Year</th> <th style="width: 10%"> Month/Year</th>
<th>:</th> <th style="width: 1%">:</th>
<th colspan="3"> {{$month}} {{$year}}</th> <th colspan="2"> {{$month}} {{$year}}</th>
</tr> </tr>
</thead> </thead>
</table> </table>
<table>
<thead> <table class="ui unstackable celled table">
<tr> <thead>
<th>Staff Name</th> <tr>
<th>Role</th> <th style="width: 10%" class="center aligned" rowspan="2">role</th>
<th>Total Hours</th> <th style="width: 10%" class="center aligned" rowspan="2">allocation</th>
<th>Total Days</th> <th style="width: 10%" class="center aligned" rowspan="2">total accumulate</th>
</tr> <th style="width: 15%" class="center aligned" rowspan="2">staff name</th>
</thead> <th style="width: 20%" class="center aligned" colspan="2">Mandays</th>
<tbody> <th style="width: 10%" class="center aligned" rowspan="2">balance</th>
<?php $totalhours = $totaldays = 0; ?> </tr>
@foreach($pteam as $key => $team) <tr>
<tr> <th style="width: 15%" class="center aligned">total hours</th>
<td>{{data_get($team,'name')}}</td> <th style="width: 15%" class="center aligned">total days</th>
<td>{{data_get($team,'role')}}</td> </tr>
<td> </thead>
<?php $sumhours = 0; ?> <tbody>
@foreach($ptdetail as $key => $hours) <?php
@if(data_get($hours,'staffid') == data_get($team,'staffid')) $pteam = [];
<?php $sumhours += data_get($hours,'hours'); ?> ?>
<?php $totalhours += data_get($hours,'hours'); ?> @foreach($roles as $key => $role)
@endif <?php
@endforeach $pteam = $pteams->where('role_id', data_get($role,'pm_roles'));
@if($sumhours == 0) ?>
@else <tr>
{{$sumhours}} <td rowspan="{{count($pteam)+1}}">{{data_get($role,'role.role')}}</td>
@endif <td rowspan="{{count($pteam)+1}}">{{data_get($role,'pm_hours')}} Hours <br> {{data_get($role,'pm_days')}} Days
</td> </td>
<td> <td rowspan="{{count($pteam)+1}}">
<?php $sumdays = 0; ?> <?php
@foreach($ptdetail as $key => $hours) $accumulatehours = 0;
@if(data_get($hours,'staffid') == data_get($team,'staffid')) $staffaccumulateshours = $accumulates->where('tp_roles', data_get($role,'pm_roles'));
<!-- {{number_format(data_get($hours,'hours')/8, 1, '.', '')}} --> foreach ($staffaccumulateshours as $key => $accumulateshours) {
<?php $sumdays += number_format(data_get($hours,'hours')/8, 1, '.', ''); ?> $accumulatehours += data_get($accumulateshours,'tp_hours');
<?php $totaldays += number_format(data_get($hours,'hours')/8, 1, '.', ''); ?> }
@endif ?>
@endforeach {{ number_format($accumulatehours, 1, '.', '') }} Hours <br>
@if($sumdays == 0) {{ number_format($accumulatehours/8, 1, '.', '') }} Days
@else </td>
{{$sumdays}} </tr>
@endif <?php $count = 0; ?>
</td> @foreach($pteam as $key => $team)
</tr> <tr>
@endforeach <td>{{data_get($team,'pt_team')}}</td>
</tbody> <td class="center aligned">
<tfoot> <?php
<tr> $currhour = 0;
<th><strong>Total</strong></th> $currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id'));
<th></th> foreach ($currmonthhours as $key => $hours) {
<th><strong>{{$totalhours}} / {{data_get($pdetail,'mandays.p_total_hours')}}</strong></th> $currhour = data_get($hours,'tp_hours');
<th><strong>{{$totaldays}} / {{data_get($pdetail,'mandays.p_total_days')}}</strong></th> }
</tr> ?>
</tfoot> {{ number_format($currhour, '1', '.', '') }} Hours
</td>
<td class="center aligned">
{{ number_format($currhour/8, '1', '.', '') }} Days
</td>
@if($count == 0)
<td rowspan="{{count($pteam)}}" class="center aligned">
<?php
$balancehours = data_get($role,'pm_hours') - $accumulatehours;
?>
{{ number_format($balancehours, '1', '.', '') }} Hours <br>
{{ number_format($balancehours/8, '1', '.', '') }} Days
</td>
@else
@endif
<?php
$count++;
?>
</tr>
@endforeach
@endforeach
</tbody>
</table> </table>
\ No newline at end of file
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
<div class="ui purple left ribbon label"> <div class="ui purple left ribbon label">
Report Summary Report Summary
</div> </div>
<button class="floated center aligned ui violet compact labeled icon button" onclick="window.location.href='{{ route('timesheet::export.exportsummary', ['month'=> $intmonth, 'year'=> $year, 'dept'=> $dept]) }}';">
<button class="floated center aligned ui violet compact labeled icon button" onclick="window.location.href='{{ route('timesheet::export.exportsummary', ['month'=> $intmonth, 'year'=> $year]) }}';">
<i class="file excel outline icon"></i> <i class="file excel outline icon"></i>
Export to Excel Export to Excel
</button> </button>
......
...@@ -52,9 +52,9 @@ class ExportController extends Controller ...@@ -52,9 +52,9 @@ class ExportController extends Controller
return (new RingkasanExport( return (new RingkasanExport(
[ [
'dept' => $request->dept,
'month' => $request->month, 'month' => $request->month,
'year' => $request->year 'year' => $request->year
]))->download('Report Summary '.$month.' '.$year.'.xlsx'); ]))->download('Report Summary '.$month.' '.$year.'.xlsx');
...@@ -62,8 +62,6 @@ class ExportController extends Controller ...@@ -62,8 +62,6 @@ class ExportController extends Controller
public function exportproject(Request $request) public function exportproject(Request $request)
{ {
// dd($request);
$month = date('F', mktime(0,0,0,$request->month, 1, date('Y'))); $month = date('F', mktime(0,0,0,$request->month, 1, date('Y')));
$year = strval($request->year); $year = strval($request->year);
$pdetail = VwProject::where('pid', $request->pid) $pdetail = VwProject::where('pid', $request->pid)
......
...@@ -65,6 +65,8 @@ class ReportController extends Controller ...@@ -65,6 +65,8 @@ class ReportController extends Controller
public function generateRingkasan(Request $request) public function generateRingkasan(Request $request)
{ {
// dd($request);
$dept = $request->dept;
$ringkasan = VwRingkasanLaporan::where('month', $request->month) $ringkasan = VwRingkasanLaporan::where('month', $request->month)
->where('year', $request->year) ->where('year', $request->year)
->where('status', 4) ->where('status', 4)
...@@ -135,7 +137,7 @@ class ReportController extends Controller ...@@ -135,7 +137,7 @@ class ReportController extends Controller
$month = date('F', mktime(0,0,0,$request->month, 1, date('Y'))); $month = date('F', mktime(0,0,0,$request->month, 1, date('Y')));
return view('timesheet::report.ringkasan', compact('intmonth','month', 'year','ringkasan', 'chargeproject', 'staffs', 'overhead', 'ovhours', 'chargeprojects', 'chargehours')); return view('timesheet::report.ringkasan', compact('intmonth','month', 'year','ringkasan', 'chargeproject', 'staffs', 'overhead', 'ovhours', 'chargeprojects', 'chargehours', 'dept'));
} }
public function projectreport() public function projectreport()
...@@ -293,6 +295,7 @@ class ReportController extends Controller ...@@ -293,6 +295,7 @@ class ReportController extends Controller
->where('tp_month', '<=', $request->month) ->where('tp_month', '<=', $request->month)
->orderby('tp_month', 'ASC') ->orderby('tp_month', 'ASC')
->get(); ->get();
$currentmonthhours = Tproject::where('td_project', $pid) $currentmonthhours = Tproject::where('td_project', $pid)
->where('tp_year', $request->year) ->where('tp_year', $request->year)
->where('tp_month', $request->month) ->where('tp_month', $request->month)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment