Commit a5916ce8 by hannan

summary, department and project report page, remove non-chargeable

parent 3c95e20b
...@@ -71,28 +71,6 @@ ...@@ -71,28 +71,6 @@
@endforeach @endforeach
<?php <?php
$nonchargeproject = $project->where('ptype', 2);
$nonchargehours = $nonchargedays = 0;
?>
@foreach($nonchargeproject as $key => $nonchargeable)
@if(data_get($nonchargeable,'staffid') == data_get($staff,'staffid'))
<tr>
<td style="width: 35%"></td>
<td style="width: 5%" class="center aligned">NC</td>
<td style="width: 15%" class="center aligned">{{data_get($nonchargeable,'pcode')}}</td>
<td style="width: 25%">{{data_get($nonchargeable,'pname')}}</td>
<td style="width: 10%" class="center aligned">{{data_get($nonchargeable,'hours')}}</td>
<td style="width: 10%" class="center aligned">{{number_format(data_get($nonchargeable,'hours')/8, '1', '.', '')}}</td>
</tr>
<?php
$nonchargehours += data_get($nonchargeable,'hours');
$nonchargedays += number_format(data_get($nonchargeable,'hours')/8, '1', '.', '');
?>
@endif
@endforeach
<?php
$overheadhours = $overheaddays = 0; $overheadhours = $overheaddays = 0;
?> ?>
...@@ -114,8 +92,8 @@ ...@@ -114,8 +92,8 @@
@endforeach @endforeach
<?php <?php
$staffhours = $chargehours+$nonchargehours+$overheadhours; $staffhours = $chargehours+$overheadhours;
$staffdays = $chargedays+$nonchargedays+$overheaddays; $staffdays = $chargedays+$overheaddays;
?> ?>
<tr> <tr>
<td colspan="3"></td> <td colspan="3"></td>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<tr> <tr>
<th colspan="5"></th> <th colspan="5"></th>
<th colspan="{{count($chargeproject)+2}}" class="center aligned">Chargeable</th> <th colspan="{{count($chargeproject)+2}}" class="center aligned">Chargeable</th>
<th colspan="{{count($overhead)+3}}" class="center aligned">Non-Chargeable</th> <th colspan="{{count($overhead)+2}}" class="center aligned">Non-Chargeable</th>
<th rowspan="2" class="center aligned">Total (Working Days)</th> <th rowspan="2" class="center aligned">Total (Working Days)</th>
</tr> </tr>
<tr> <tr>
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
@endforeach @endforeach
<th>Total Hours</th> <th>Total Hours</th>
<th>Total Days</th> <th>Total Days</th>
<th class="center aligned">Project</th>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<th>{{data_get($value,'o_overhead_desc')}}</th> <th>{{data_get($value,'o_overhead_desc')}}</th>
@endforeach @endforeach
...@@ -54,6 +53,7 @@ ...@@ -54,6 +53,7 @@
<th>Total Days</th> <th>Total Days</th>
</tr> </tr>
</thead> </thead>
<?php $totaldays = $totalalldays = 0; ?> <?php $totaldays = $totalalldays = 0; ?>
@foreach($staffs as $key => $staff) @foreach($staffs as $key => $staff)
<tbody> <tbody>
...@@ -76,15 +76,8 @@ ...@@ -76,15 +76,8 @@
@endforeach @endforeach
<td class="center aligned">{{$totalc}}</td> <td class="center aligned">{{$totalc}}</td>
<td class="center aligned">{{number_format($totalc/8, 1, '.', '')}}</td> <td class="center aligned">{{number_format($totalc/8, 1, '.', '')}}</td>
<td class="center aligned">
<?php $totalnc = 0; ?> <?php $totalnc = 0; ?>
@foreach($projectnc as $key => $project)
@if(data_get($project,'staffid') == data_get($staff,'staffid'))
{{data_get($project,'nonchargehours')}}
<?php $totalnc += data_get($project,'nonchargehours'); ?>
@endif
@endforeach
</td>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<td> <td>
@foreach($ovhours as $key => $hours) @foreach($ovhours as $key => $hours)
...@@ -103,15 +96,17 @@ ...@@ -103,15 +96,17 @@
</tbody> </tbody>
<?php $totalalldays += $totaldays; ?> <?php $totalalldays += $totaldays; ?>
@endforeach @endforeach
<tfoot> <tfoot>
<tr> <tr>
<th colspan="5" class="center aligned"> <th colspan="5" class="center aligned">
<strong>Total</strong> <strong>Total</strong>
</th> </th>
<th colspan="{{count($chargeproject)+2+count($overhead)+3}}"></th> <th colspan="{{count($chargeproject)+2+count($overhead)+2}}"></th>
<th><strong>{{$totalalldays}}</strong></th> <th><strong>{{$totalalldays}}</strong></th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</div> </div>
</div> </div>
......
...@@ -65,9 +65,9 @@ class ReportController extends Controller ...@@ -65,9 +65,9 @@ class ReportController extends Controller
->where('year', $request->year) ->where('year', $request->year)
->get(); ->get();
$projectnc = VwNonchargeSummary::where('month', $request->month) // $projectnc = VwNonchargeSummary::where('month', $request->month)
->where('year', $request->year) // ->where('year', $request->year)
->get(); // ->get();
$overhead = Overhead::where('o_overhead_sts', 1)->get(); $overhead = Overhead::where('o_overhead_sts', 1)->get();
// dd($overhead); // dd($overhead);
...@@ -91,7 +91,7 @@ class ReportController extends Controller ...@@ -91,7 +91,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', 'projectnc', 'overhead', 'ovhours')); return view('timesheet::report.ringkasan', compact('intmonth','month', 'year','ringkasan', 'chargeproject', 'staffs', 'overhead', 'ovhours'));
} }
public function projectreport() public function projectreport()
......
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