Commit 6bb4c3ba by Azhan Hannan

Calculate overtime hours based on timesheet.

parent 1bf8e272
......@@ -148,8 +148,8 @@
@endfor
@endif
@if($valchargehour)
<td>{{ $totalcharge }}</td>
@if($totalcharge)
<td>{{ number_format($totalcharge, 1, '.', '') }}</td>
<td>{{ number_format($totalcharge/8, 1, '.', '') }}</td>
@else
<td>0</td>
......@@ -196,7 +196,7 @@
@endfor
@endif
<th>@if($totalchargehrs){{ $totalchargehrs }}@else 0 @endif</th>
<th>@if($totalchargehrs){{ number_format($totalchargehrs, 1, '.', '') }}@else 0 @endif</th>
<th>@if($totalchargehrs){{ number_format($totalchargehrs/8, 1, '.', '') }}@else 0 @endif</th>
</tfoot>
</table>
......@@ -301,7 +301,7 @@
@endif
@if($totaloverhead)
<td>{{ $totaloverhead }}</td>
<td>{{ number_format($totaloverhead, 1, '.', '') }}</td>
<td>{{ number_format($totaloverhead/8, 1, '.', '') }}</td>
@else
<td>0</td>
......@@ -346,7 +346,7 @@
<th>{{ $totaloverheadbyday }}</th>
@endfor
@endif
<th>@if($totaloverheadhrs) {{ $totaloverheadhrs }} @else 0 @endif</th>
<th>@if($totaloverheadhrs) {{ number_format($totaloverheadhrs, 1, '.', '') }} @else 0 @endif</th>
<th>@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot>
</table>
......@@ -472,7 +472,7 @@
<td style="width: 4%;">{{ $ac }}</td>
@endfor
@endif
<td> @if($check) {{ ($totalchargehrs + $totaloverheadhrs) }} @else 0 @endif </td>
<td> @if($check) {{ number_format(($totalchargehrs + $totaloverheadhrs), 1, '.', '') }} @else 0 @endif </td>
<td> {{ number_format(($totalchargehrs + $totaloverheadhrs)/8, 1, '.', '') }} </td>
</tr>
......@@ -483,10 +483,9 @@
@if( $phase == 1 )
@for($i = 0; $i < 15 ; $i++)
<?php
$ot = 0;
$ot = 8;
$ac = 0;
$totalcbyday = 0;
// $totalncbyday = 0;
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
......@@ -508,21 +507,21 @@
$ot = ($totalcbyday + $totaloverheadbyday)-8;
if($ot >= 0)
// if($ot >= 0)
$totalot += $ot;
?>
<td style="width: 4%;">
@if($ot > 0)
{{ $ot }}
@else
0
({{ abs($ot) }})
@endif
</td>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$ot = 0;
$ot = 8;
$totalcbyday = 0;
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
......@@ -545,25 +544,32 @@
$ot = ($totalcbyday + $totaloverheadbyday)-8;
if($ot >= 0) $totalot += $ot;
$totalot += $ot;
?>
<td style="width: 4%;">
@if($ot > 0)
{{ $ot }}
@else
0
({{ abs($ot) }})
@endif
</td>
@endfor
@endif
<td>
@if($check)
{{ $totalot }}
@if($totalot >= 0)
{{ number_format($totalot, 1, '.', '') }}
@else
({{ abs(number_format($totalot, 1, '.', '')) }})
@endif
</td>
<td>
@if($totalot/8 >= 0)
{{ number_format($totalot/8, 1, '.', '') }}
@else
0
({{ abs(number_format($totalot/8, 1, '.', '')) }})
@endif
<!-- {{ number_format($totalot/8, 1, '.', '') }} -->
</td>
<td>{{ number_format($totalot/8, 1, '.', '') }}</td>
</tr>
</tbody>
</table>
......
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