Commit 9b69e786 by Azhan Hannan

fixing timesheet overhead and chargeable form

parent f9fe6c4b
...@@ -369,7 +369,7 @@ input[type=number] { ...@@ -369,7 +369,7 @@ input[type=number] {
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}} {{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php @php
...@@ -450,8 +450,8 @@ input[type=number] { ...@@ -450,8 +450,8 @@ input[type=number] {
->first(); ->first();
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
@endphp @endphp
@if($filteredData->isEmpty()) @if($filteredData->isEmpty())
<td> <td>
...@@ -473,26 +473,44 @@ input[type=number] { ...@@ -473,26 +473,44 @@ input[type=number] {
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php @php
$valuehour = ''; $filteredData = $lat->filter(function ($item) use ($i) {
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); return date('d', strtotime($item['DATE'])) == $i+1;
});
if($hour) $valuehour = '';
{ $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valuehour = $hour->where('td_date','=',$date)
->where('td_project',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours'); if($hour)
} {
?> $valuehour = $hour->where('td_date','=',$date)
->where('td_project',$project['td_project'])
->where('tm_phase',$phase)
->first();
<td> $total += data_get($valuehour,'td_hours');
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> }
</td> @endphp
@if($filteredData->isEmpty())
<td class="center aligned">
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
......
...@@ -382,7 +382,7 @@ input[type=number] { ...@@ -382,7 +382,7 @@ input[type=number] {
@endif @endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
{{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}} {{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php @php
...@@ -438,6 +438,7 @@ input[type=number] { ...@@ -438,6 +438,7 @@ input[type=number] {
</td> </td>
@if(count($lat) > 0) @if(count($lat) > 0)
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
...@@ -481,24 +482,44 @@ input[type=number] { ...@@ -481,24 +482,44 @@ input[type=number] {
@endif @endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php
$valuehour = ''; @php
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
if($hour) $valuehour = '';
{ $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$valuehour = $hour->where('td_date','=',$date)
->where('fk_o_id',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours'); if($hour)
} {
?> $valuehour = $hour->where('td_date','=',$date)
<td> ->where('fk_o_id',$project['td_project'])
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> ->where('tm_phase',$phase)
</td> ->first();
$total += data_get($valuehour,'td_hours');
}
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
......
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