Commit 933f0e6d by Azhan Hannan

changes in report summary

parent d5e863d4
...@@ -128,32 +128,34 @@ ...@@ -128,32 +128,34 @@
<strong>Total</strong> <strong>Total</strong>
</th> </th>
<?php $tch = 0; ?> <?php $tch = 0; ?>
@foreach($chargeprojects as $key => $value) @if(count($chargeprojects) > 0)
<?php @foreach($chargeprojects as $key => $value)
$projecthours = $chargehours->where('td_project', data_get($value,'td_project')); <?php
$monthly_hours = 0; $projecthours = $chargehours->where('td_project', data_get($value,'td_project'));
?> $monthly_hours = 0;
<th class="center aligned"> ?>
@foreach($projecthours as $key => $project) <th class="center aligned">
<?php @foreach($projecthours as $key => $project)
$monthly_hours += data_get($project,'tp_hours'); <?php
?> $monthly_hours += data_get($project,'tp_hours');
@endforeach ?>
@endforeach
{{ number_format($monthly_hours, '1', '.', '') }}
</th> {{ number_format($monthly_hours, '1', '.', '') }}
<?php $tch += $monthly_hours; ?> </th>
@endforeach <?php $tch += $monthly_hours; ?>
<th class="text-center">{{ number_format($tch, '1', '.', '') }}</th> @endforeach
<th class="text-center">{{ number_format($tch/8, 1, '.', '') }}</th> <th class="text-center">{{ number_format($tch, '1', '.', '') }}</th>
<th class="text-center">{{ number_format($tch/8, 1, '.', '') }}</th>
@endif
<?php $totaloverhead = 0; ?> <?php $totaloverhead = 0; ?>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<?php <?php
$monthly_ov = 0; $monthly_ov = 0;
$oid = data_get($value,'id'); $oid = data_get($value,'id');
$ov = $ovhours->where('oid', $oid); $ov = $ovhours->where('oid', $oid);
foreach ($ov as $key => $value) { foreach ($ov as $key => $val) {
$monthly_ov += data_get($value,'hours'); $monthly_ov += data_get($val,'hours');
} }
?> ?>
<th class="center aligned">{{ number_format($monthly_ov, '1', '.', '') }}</th> <th class="center aligned">{{ number_format($monthly_ov, '1', '.', '') }}</th>
......
...@@ -72,11 +72,7 @@ class ReportController extends Controller ...@@ -72,11 +72,7 @@ class ReportController extends Controller
$overhead = Overhead::where('o_overhead_sts', 1)->get(); $overhead = Overhead::where('o_overhead_sts', 1)->get();
$ovhours = VwOverheadSummary::where('month', $request->month)
->where('year', $request->year)
->where('status', 4)
->get();
$liststaffs = []; $liststaffs = [];
$chargeproject = VwChargeable::where('deleted_at', null)->get(); $chargeproject = VwChargeable::where('deleted_at', null)->get();
...@@ -103,6 +99,13 @@ class ReportController extends Controller ...@@ -103,6 +99,13 @@ class ReportController extends Controller
$liststaffs[] = data_get($staff,'staffid'); $liststaffs[] = data_get($staff,'staffid');
} }
} }
$ovhours = VwOverheadSummary::where('month', $request->month)
->where('year', $request->year)
->where('status', 4)
->whereIn('staffid', $liststaffs)
->get();
// dd($ovhours);
$chargehours = Tproject::where('tp_year', $request->year) $chargehours = Tproject::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