Commit caa22b74 by Azhan Hannan

log kak hasni, deduct cuti daripada total working days.

parent 97cd3d25
...@@ -88,15 +88,30 @@ ...@@ -88,15 +88,30 @@
<td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td>
@endif @endif
<?php $totalnc = 0; ?> <?php $totalnc = $ocuti = 0; ?>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<td class="center aligned"> <td class="center aligned">
<?php $monthly_hours = 0; ?> <?php $monthly_hours = 0; ?>
@foreach($ovhours as $key => $hours) @foreach($ovhours as $key => $hours)
@if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid')) @if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid'))
<!-- {{data_get($hours,'hours')}} --> <!-- {{data_get($hours,'hours')}} -->
<?php $monthly_hours += data_get($hours,'hours') ?> <?php
<!-- <?php $totalnc += data_get($hours,'hours'); ?> --> $monthly_hours += data_get($hours,'hours');
if (data_get($hours,'oid') == 6) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 7) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 8) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 10) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 15) {
$ocuti += data_get($hours,'hours');
}else{
}
$totalnc += data_get($hours,'hours');
?>
@endif @endif
@endforeach @endforeach
...@@ -108,7 +123,9 @@ ...@@ -108,7 +123,9 @@
@endforeach @endforeach
<td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td>
<td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td>
<?php $totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?> <?php
$totalnc -= $ocuti;
$totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?>
<td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td>
</tr> </tr>
</tbody> </tbody>
...@@ -141,13 +158,25 @@ ...@@ -141,13 +158,25 @@
<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 @endif
<?php $totaloverhead = 0; ?> <?php $totaloverhead = 0;$cuti = 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 => $val) { foreach ($ov as $key => $val) {
if (data_get($val,'oid') == 6) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 7) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 8) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 10) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 15) {
$cuti += data_get($val,'hours');
}else{
}
$monthly_ov += data_get($val,'hours'); $monthly_ov += data_get($val,'hours');
} }
?> ?>
......
...@@ -145,15 +145,30 @@ ...@@ -145,15 +145,30 @@
<td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td>
@endif @endif
<?php $totalnc = 0; ?> <?php $totalnc = $ocuti = 0; ?>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<td class="center aligned"> <td class="center aligned">
<?php $monthly_hours = 0; ?> <?php $monthly_hours = 0; ?>
@foreach($ovhours as $key => $hours) @foreach($ovhours as $key => $hours)
@if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid')) @if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid'))
<!-- {{data_get($hours,'hours')}} --> <!-- {{data_get($hours,'hours')}} -->
<?php $monthly_hours += data_get($hours,'hours') ?> <?php
<!-- <?php $totalnc += data_get($hours,'hours'); ?> --> $monthly_hours += data_get($hours,'hours');
if (data_get($hours,'oid') == 6) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 7) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 8) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 10) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 15) {
$ocuti += data_get($hours,'hours');
}else{
}
$totalnc += data_get($hours,'hours');
?>
@endif @endif
@endforeach @endforeach
...@@ -165,7 +180,9 @@ ...@@ -165,7 +180,9 @@
@endforeach @endforeach
<td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td>
<td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td>
<?php $totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?> <?php
$totalnc -= $ocuti;
$totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?>
<td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td>
</tr> </tr>
</tbody> </tbody>
...@@ -198,14 +215,26 @@ ...@@ -198,14 +215,26 @@
<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 @endif
<?php $totaloverhead = 0; ?> <?php $totaloverhead = 0;$cuti = 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 => $val) { foreach ($ov as $key => $val) {
$monthly_ov += data_get($val,'hours'); if (data_get($val,'oid') == 6) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 7) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 8) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 10) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 15) {
$cuti += data_get($val,'hours');
}else{
}
$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>
......
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