Commit 546537d1 by Azhan Hannan

Display overhead description bila approve

parent 6f84d8c8
...@@ -341,6 +341,25 @@ ...@@ -341,6 +341,25 @@
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th> <th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> --> </tfoot> -->
</table> </table>
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach(data_get($profile,'notes') as $key => $value)
@if(data_get($profile,'fk_o_id') == data_get($value, 'fk_o_id'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
</table>
@endif @endif
</div> </div>
......
...@@ -339,7 +339,26 @@ ...@@ -339,7 +339,26 @@
</tfoot> --> </tfoot> -->
</table> </table>
@endif @endif
@if(count($notes) > 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($notes as $key => $value)
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endforeach
</table>
@endif
</div> </div>
<div class="ui segment"> <div class="ui segment">
......
...@@ -338,6 +338,25 @@ ...@@ -338,6 +338,25 @@
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th> <th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> --> </tfoot> -->
</table> </table>
@if(count($notes) > 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($notes as $key => $value)
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endforeach
</table>
@endif
@endif @endif
<div class="ui segment"> <div class="ui segment">
......
...@@ -2242,6 +2242,7 @@ class DashboardController extends Controller ...@@ -2242,6 +2242,7 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
...@@ -2270,6 +2271,8 @@ class DashboardController extends Controller ...@@ -2270,6 +2271,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
// dd($overheadlist); // dd($overheadlist);
...@@ -2287,11 +2290,13 @@ class DashboardController extends Controller ...@@ -2287,11 +2290,13 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
->orderby('td_date') ->orderby('td_date')
->get(); ->get();
// dd($notes);
} }
else else
{ {
...@@ -2303,7 +2308,7 @@ class DashboardController extends Controller ...@@ -2303,7 +2308,7 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.selectapprovalpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'bod', 'daymonth')); return view('timesheet::dashboard.selectapprovalpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'bod', 'daymonth', 'notes'));
} }
public function selectapprovalpage(Request $request) public function selectapprovalpage(Request $request)
...@@ -2936,7 +2941,8 @@ class DashboardController extends Controller ...@@ -2936,7 +2941,8 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
// dd('sini ke?'); // dd('sini ke?');
...@@ -2964,6 +2970,8 @@ class DashboardController extends Controller ...@@ -2964,6 +2970,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
} }
...@@ -2980,6 +2988,7 @@ class DashboardController extends Controller ...@@ -2980,6 +2988,7 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
...@@ -2996,7 +3005,7 @@ class DashboardController extends Controller ...@@ -2996,7 +3005,7 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.approveallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'bod')); return view('timesheet::dashboard.approveallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'bod', 'notes'));
} }
public function approvalall(Request $request) public function approvalall(Request $request)
......
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