Commit 933f0e6d by Azhan Hannan

changes in report summary

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