Commit 933f0e6d by Azhan Hannan

changes in report summary

parent d5e863d4
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
<strong>Total</strong> <strong>Total</strong>
</th> </th>
<?php $tch = 0; ?> <?php $tch = 0; ?>
@if(count($chargeprojects) > 0)
@foreach($chargeprojects as $key => $value) @foreach($chargeprojects as $key => $value)
<?php <?php
$projecthours = $chargehours->where('td_project', data_get($value,'td_project')); $projecthours = $chargehours->where('td_project', data_get($value,'td_project'));
...@@ -146,14 +147,15 @@ ...@@ -146,14 +147,15 @@
@endforeach @endforeach
<th class="text-center">{{ number_format($tch, '1', '.', '') }}</th> <th class="text-center">{{ number_format($tch, '1', '.', '') }}</th>
<th class="text-center">{{ number_format($tch/8, 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,10 +72,6 @@ class ReportController extends Controller ...@@ -72,10 +72,6 @@ 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 = [];
...@@ -104,6 +100,13 @@ class ReportController extends Controller ...@@ -104,6 +100,13 @@ class ReportController extends Controller
} }
} }
$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)
->where('tp_hours', '<>', null) ->where('tp_hours', '<>', null)
......
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