Commit a563b89f by hannan

remove nonchargeable in timesheet review, timesheet viewer, chargeable form, overhead form

parent cf4f9c07
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th colspan="3" style="width: 60%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th> <th colspan="2" style="width: 60%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 15%;" class="center aligned"> <th style="width: 15%;" class="center aligned">
@if($staff->status == 1 || $staff->status == null) In Preparation @if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 2) <i class="red attention icon"></i> Submitted @elseif($staff->status == 2) <i class="red attention icon"></i> Submitted
...@@ -38,9 +38,8 @@ ...@@ -38,9 +38,8 @@
</th> </th>
</tr> </tr>
<tr> <tr>
<td style="width: 20%;">Chargeable (A) : {{ data_get($staff,'chargeable') }}</td> <td style="width: 30%;">Chargeable (A) : {{ data_get($staff,'chargeable') }}</td>
<td style="width: 20%;">Nonchargeable (B) : {{ data_get($staff,'nonchargeable') }}</td> <td style="width: 30%;">Overhead (B) : {{ data_get($staff,'overhead') }}</td>
<td style="width: 20%;">Overhead (C) : {{ data_get($staff,'overhead') }}</td>
<td style="width: 15%;">Overtime: {{ data_get($staff,'overtime') }}</td> <td style="width: 15%;">Overtime: {{ data_get($staff,'overtime') }}</td>
<td class="right aligned">Total Hours/Days: {{ data_get($staff,'totalhrs')." hours/ ".number_format(data_get($staff,'totalhrs')/8, 1, '.', '')." days" }}</td> <td class="right aligned">Total Hours/Days: {{ data_get($staff,'totalhrs')." hours/ ".number_format(data_get($staff,'totalhrs')/8, 1, '.', '')." days" }}</td>
</tr> </tr>
...@@ -50,8 +49,7 @@ ...@@ -50,8 +49,7 @@
<?php <?php
$cptype = "A"; $cptype = "A";
$ncptype = "B"; $otype = "B";
$otype = "C";
$td = $checktd->where('tm_staff_id', $staff->staff_id); $td = $checktd->where('tm_staff_id', $staff->staff_id);
$detail = $details->where('staffid', $staff->staff_id); $detail = $details->where('staffid', $staff->staff_id);
$ts = $checkts->where('tm_staff_id', $staff->staff_id); $ts = $checkts->where('tm_staff_id', $staff->staff_id);
...@@ -82,18 +80,7 @@ ...@@ -82,18 +80,7 @@
</tr> </tr>
@endforeach @endforeach
@endif @endif
@if($detail->where('ptype', 2))
@foreach($detail->where('ptype', 2) as $key => $nonchargeable)
<tr>
<td style="width: 6%;" class="center aligned">{{ $ncptype }}</td>
<td style="width: 17%;">{{ data_get($nonchargeable, 'pcode') }}</td>
<td style="width: 26%;">{{ data_get($nonchargeable, 'pname') }}</td>
<td style="width: 26%;">{{ data_get($nonchargeable, 'pmname') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ number_format(data_get($nonchargeable, 'hours')/8, 1, '.', '') }}</td>
</tr>
@endforeach
@endif
@if($detail->where('ptype', 3)) @if($detail->where('ptype', 3))
@foreach($detail->where('ptype', 3) as $key => $chargeable) @foreach($detail->where('ptype', 3) as $key => $chargeable)
<tr> <tr>
......
...@@ -199,159 +199,6 @@ ...@@ -199,159 +199,6 @@
</div> </div>
<div class="ui segment"> <div class="ui segment">
<table id="printtable3" class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="2" rowspan="2" class="center aligned">Non-Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="2" rowspan="2" class="center aligned">Total</th>
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
<th style="width: 4%;"></th>
<th style="width: 23%;">Task</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach($nonchargeablelist as $key => $projectnonchargeable)
<?php $totalnoncharge = 0; ?>
<tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">{{ $projectnonchargeable['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$valnonchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($nonchargehour)
{
$valnonchargehour = $nonchargehour->where('td_date','=',$date)
->where('td_project',$projectnonchargeable['pid'])
->where('tm_phase',$phase)
->first();
$totalnoncharge += data_get($valnonchargehour,'td_hours');
}
?>
@if($valnonchargehour)
<td style="width: 4%;">{{ data_get($valnonchargehour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$valnonchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($nonchargehour)
{
$valnonchargehour = $nonchargehour->where('td_date','=',$date)
->where('td_project',$projectnonchargeable['pid'])
->where('tm_phase',$phase)
->first();
$totalnoncharge += data_get($valnonchargehour,'td_hours');
}
?>
@if($valnonchargehour)
<td style="width: 4%;">{{ data_get($valnonchargehour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($valnonchargehour)
<td>{{ $totalnoncharge }}</td>
<td>{{ number_format($totalnoncharge/8, 1, '.', '') }}</td>
@else
<td>0</td>
<td>0</td>
@endif
</tr>
@endforeach
</tbody>
<tfoot>
<th colspan="2">Total (B)</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$totalncbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($nonchargehour) {
$valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += data_get($value,'td_hours');
}
}
?>
<th>{{ $totalncbyday }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$totalncbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($nonchargehour) {
$valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += data_get($value,'td_hours');
}
}
?>
<th>{{ $totalncbyday }}</th>
@endfor
@endif
<th>@if($totalnonchargehrs){{ $totalnonchargehrs }}@else 0 @endif</th>
<th>@if($totalnonchargehrs){{ number_format($totalnonchargehrs/8, 1, '.', '') }}@else 0 @endif</th>
</tfoot>
</table>
</div>
<div class="ui segment">
<table id="printtable4" class="ui celled structured table unstackable"> <table id="printtable4" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
...@@ -461,7 +308,7 @@ ...@@ -461,7 +308,7 @@
@endforeach @endforeach
</tbody> </tbody>
<tfoot> <tfoot>
<th colspan="2">Total (C)</th> <th colspan="2">Total (B)</th>
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<?php <?php
...@@ -555,21 +402,21 @@ ...@@ -555,21 +402,21 @@
<tbody> <tbody>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
<td style="width: 23%;">Total (B) + (C) Non Chargeable</td> <td style="width: 23%;">Total (A) + (B)</td>
@if( $phase == 1 ) @if( $phase == 1 )
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<?php <?php
$bc = 0; $ac = 0;
$totalncbyday = 0; $totalcbyday = 0;
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($nonchargehour) { if ($chargehour) {
$valncbyday = $nonchargehour->where('td_date','=', $date) $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valcbyday as $key => $value) {
$totalncbyday += data_get($value,'td_hours'); $totalcbyday += data_get($value,'td_hours');
} }
} }
...@@ -582,25 +429,25 @@ ...@@ -582,25 +429,25 @@
} }
} }
$bc = $totalncbyday + $totaloverheadbyday; $ac = $totalcbyday + $totaloverheadbyday;
?> ?>
<td style="width: 4%;">{{ $bc }}</td> <td style="width: 4%;">{{ $ac }}</td>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php <?php
$bc = 0; $ac = 0;
$totalncbyday = 0; $totalcbyday = 0;
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($nonchargehour) { if ($chargehour) {
$valncbyday = $nonchargehour->where('td_date','=', $date) $valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) { foreach($valcbyday as $key => $value) {
$totalncbyday += data_get($value,'td_hours'); $totalcbyday += data_get($value,'td_hours');
} }
} }
...@@ -613,27 +460,27 @@ ...@@ -613,27 +460,27 @@
} }
} }
$bc = $totalncbyday + $totaloverheadbyday; $ac = $totalcbyday + $totaloverheadbyday;
?> ?>
<td style="width: 4%;">{{ $bc }}</td> <td style="width: 4%;">{{ $ac }}</td>
@endfor @endfor
@endif @endif
<td> @if($check) {{ ($totalnonchargehrs + $totaloverheadhrs) }} @else 0 @endif </td> <td> @if($check) {{ ($totalchargehrs + $totaloverheadhrs) }} @else 0 @endif </td>
<td> {{ number_format(($totalnonchargehrs + $totaloverheadhrs)/8, 1, '.', '') }} </td> <td> {{ number_format(($totalchargehrs + $totaloverheadhrs)/8, 1, '.', '') }} </td>
</tr> </tr>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 4%;"></td>
<td style="width: 23%;">Total (A+B+C) - 8 Overtime</td> <td style="width: 23%;">Total (A+B) - 8 Overtime</td>
<?php $totalot = 0; ?> <?php $totalot = 0; ?>
@if( $phase == 1 ) @if( $phase == 1 )
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<?php <?php
$ot = 0; $ot = 0;
$bc = 0; $ac = 0;
$totalcbyday = 0; $totalcbyday = 0;
$totalncbyday = 0; // $totalncbyday = 0;
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
...@@ -645,14 +492,6 @@ ...@@ -645,14 +492,6 @@
} }
} }
if ($nonchargehour) {
$valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += data_get($value,'td_hours');
}
}
if ($overheadhour) { if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date) $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
...@@ -661,7 +500,7 @@ ...@@ -661,7 +500,7 @@
} }
} }
$ot = ($totalcbyday + $totalncbyday + $totaloverheadbyday)-8; $ot = ($totalcbyday + $totaloverheadbyday)-8;
if($ot >= 0) if($ot >= 0)
$totalot += $ot; $totalot += $ot;
...@@ -678,9 +517,7 @@ ...@@ -678,9 +517,7 @@
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php <?php
$ot = 0; $ot = 0;
$bc = 0;
$totalcbyday = 0; $totalcbyday = 0;
$totalncbyday = 0;
$totaloverheadbyday = 0; $totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
...@@ -692,14 +529,6 @@ ...@@ -692,14 +529,6 @@
} }
} }
if ($nonchargehour) {
$valncbyday = $nonchargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valncbyday as $key => $value) {
$totalncbyday += data_get($value,'td_hours');
}
}
if ($overheadhour) { if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date) $valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase); ->where('tm_phase',$phase);
...@@ -708,7 +537,7 @@ ...@@ -708,7 +537,7 @@
} }
} }
$ot = ($totalcbyday + $totalncbyday + $totaloverheadbyday)-8; $ot = ($totalcbyday + $totaloverheadbyday)-8;
if($ot >= 0) $totalot += $ot; if($ot >= 0) $totalot += $ot;
?> ?>
...@@ -769,7 +598,7 @@ ...@@ -769,7 +598,7 @@
@else @else
@if($check != null) @if($check != null)
<button type="button" class="ui green button" onclick="window.location.href='{{ route('timesheet::dashboard.tsubmit',[ 'tid'=> $check->id, 'totalot'=> $totalot, 'totalchargehrs'=>$totalchargehrs, 'totalnonchargehrs'=> $totalnonchargehrs, 'totaloverheadhrs'=>$totaloverheadhrs ]) }}';">Submit</button> <button type="button" class="ui green button" onclick="window.location.href='{{ route('timesheet::dashboard.tsubmit',[ 'tid'=> $check->id, 'totalot'=> $totalot, 'totalchargehrs'=>$totalchargehrs,'totaloverheadhrs'=>$totaloverheadhrs ]) }}';">Submit</button>
@else @else
<button type="button" class="ui disabled green button">Submit</button> <button type="button" class="ui disabled green button">Submit</button>
@endif @endif
......
...@@ -22,10 +22,6 @@ input[type=number] { ...@@ -22,10 +22,6 @@ input[type=number] {
<br> <br>
<br> <br>
<!-- <button class="center aligned ui violet compact right labeled icon button" onclick="window.location.href='{ route('timesheet::form.nonChargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }';">
<i class="angle double right icon"></i>
Non-Chargeable Form
</button> -->
<button class="center aligned ui purple compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';"> <button class="center aligned ui purple compact right labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Overhead Form Overhead Form
......
...@@ -24,45 +24,12 @@ input[type=number] { ...@@ -24,45 +24,12 @@ input[type=number] {
<div class="ui segment"> <div class="ui segment">
<a class="ui purple left ribbon label">Overhead Form</a> <a class="ui purple left ribbon label">Overhead Form</a>
<br> <br>
<!-- <form class="ui form">
<div class="field">
<div class="three fields">
<div class="one wide field">
<label>Phase</label>
<input type="text" placeholder="Year" value="{{$phase}}" readonly="readonly">
</div>
<div class="one wide field">
<label>Month</label>
<input type="text" placeholder="Month" value="{{$month}}" readonly="readonly">
</div>
<div class="two wide field">
<label>Year</label>
<input type="text" placeholder="Year" value="{{$year}}" readonly="readonly">
</div>
</div>
</div>
</form> -->
<br> <br>
<!-- @if($phase == 1)
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 2, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double right icon"></i>
Phase 2
</button>
@else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 1, 'month' => $month,'year' => $year]) }}';">
<i class="angle double left icon"></i>
Phase 1
</button>
@endif -->
<button class="center aligned ui blue compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';"> <button class="center aligned ui blue compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Chargeable Form Chargeable Form
</button> </button>
<!-- <button class="center aligned ui violet compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double left icon"></i>
Non-Chargeable Form
</button> -->
@if($checkoverhead) @if($checkoverhead)
<button class="right floated aligned ui yellow compact labeled icon button" id="notes" onclick="window.location.href='{{ route('timesheet::form.notelist', ['year'=> $year, 'month'=> $month, 'phase'=> $phase, 'fk_tm_id'=> $fk_tm_id] ) }} ';"> <button class="right floated aligned ui yellow compact labeled icon button" id="notes" onclick="window.location.href='{{ route('timesheet::form.notelist', ['year'=> $year, 'month'=> $month, 'phase'=> $phase, 'fk_tm_id'=> $fk_tm_id] ) }} ';">
......
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