Commit 460b7e2f by Azhan Hannan

Sabtu Ahad appear di overtime - ( if sabtu bekerja - 4 jam) dan rasanya yg ni…

Sabtu Ahad appear di overtime - ( if sabtu bekerja - 4 jam) dan  rasanya yg ni nk cek hari bekerja boleh cek dgn l_attendance
parent 9b2b22b9
......@@ -518,10 +518,19 @@
<?php
$ot = 8;
$ac = 0;
$sabtu = 4;
$cuti = 0;
$totalcbyday = 0;
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$haribekerja = $statushari->where('DATE',$date);
if (count($haribekerja) > 0)
{
foreach ($haribekerja as $key => $hari) {
if (data_get($hari,'day_type') == 2)
{
if ($chargehour) {
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
......@@ -538,23 +547,112 @@
}
}
$ot = ($totalcbyday + $totaloverheadbyday)-8;
$cuti = ($totalcbyday + $totaloverheadbyday);
// dump(data_get($hari,'DATE').' : '.$cuti);
$totalot += $cuti;
}
if (date('D', strtotime(data_get($hari,'DATE'))) == 'Sat' && data_get($hari,'day_type') == 1)
{
if ($chargehour) {
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += data_get($value,'td_hours');
}
}
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
}
$sabtu = ($totalcbyday + $totaloverheadbyday)-4;
// dump(data_get($hari,'DATE').' : '.$sabtu);
$totalot += $sabtu;
}
if (date('D', strtotime(data_get($hari,'DATE'))) != 'Sat' && date('D', strtotime(data_get($hari,'DATE'))) != 'Sun' && data_get($hari,'day_type') == 1)
{
if ($chargehour) {
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += data_get($value,'td_hours');
}
}
// if($ot >= 0)
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
}
$ot = ($totalcbyday + $totaloverheadbyday)-8;
// dump(data_get($hari,'DATE').' : '.$ot);
$totalot += $ot;
}
}
}
// dump('totalot: '.$totalot);
?>
<th style="width: 4%;">
<?php
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$haribekerja = $statushari->where('DATE',$date);
?>
@if(count($haribekerja) > 0)
@foreach ($haribekerja as $key => $hari)
<?php
// dump(data_get($hari,'day_type'));
?>
@if(data_get($hari,'day_type') == '2')
@if($cuti > 0)
{{ number_format($cuti, '1', '.', '') }}
@else
<!-- ({{ number_format(abs($cuti), '1', '.', '') }}) -->
-
@endif
@endif
@if(date('D', strtotime(data_get($hari,'DATE'))) == 'Sat' && data_get($hari,'day_type') == '1')
@if($sabtu > 0)
{{ number_format($sabtu, '1', '.', '') }}
@elseif($sabtu == 0) -
@else
({{ number_format(abs($sabtu), '1', '.', '') }})
@endif
@endif
@if(date('D', strtotime(data_get($hari,'DATE'))) != 'Sat' && data_get($hari,'day_type') == '1')
@if($ot > 0)
{{ number_format($ot, '1', '.', '') }}
@elseif($ot == 0) -
@else
({{ number_format(abs($ot), '1', '.', '') }})
@endif
@endif
@endforeach
@else
0.0
@endif
</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$ot = 8;
$workingsaturday = 4;
$totalcbyday = 0;
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
......@@ -576,7 +674,6 @@
}
$ot = ($totalcbyday + $totaloverheadbyday)-8;
$totalot += $ot;
?>
<th style="width: 4%;">
......
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