Commit e1fdda4a by Azhan Hannan

report ringkasan, display timesheet yg approved shj. fix error calculation.…

report ringkasan, display timesheet yg approved shj. fix error calculation. update sekali export excel.
dashboard staff, redirect untuk resubmit kalau project rejected.
parent 28f2e7b3
......@@ -64,12 +64,14 @@ class RingkasanExport implements ShouldAutoSize, FromView, WithColumnWidths
'overhead' => Overhead::where('o_overhead_sts', 1)->get(),
'ringkasan' => VwRingkasanLaporan::where('month', $month)
->where('year', $year)
->where('status', 4)
->get(),
'projectnc' => VwNonchargeSummary::where('month', $month)
->where('year', $year)
->get(),
// 'projectnc' => VwNonchargeSummary::where('month', $month)
// ->where('year', $year)
// ->get(),
'ovhours' => VwOverheadSummary::where('month', $month)
->where('year', $year)
->where('status', 4)
->get()
]);
......
......@@ -40,6 +40,9 @@
<br>
<br>
@foreach($timesheet as $key => $value)
<!-- <?php
// dd($value->tm_timesheet_master_sts);
?> -->
<div class="ui styled fluid accordion">
<?php $page = 1; ?>
<div class="title">
......@@ -112,9 +115,11 @@
</td>
<td style="width: 12%;" class="text-center">
@if(data_get($tpcharge,'tp_timesheet_sts') == 5|| data_get($tpcharge,'tp_timesheet_sts') == 6)
<button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::form.rejected', ['tpid' => data_get($tpcharge,'id')]) }}';">Resubmit</button>
@else
<button class="center aligned ui red icon button disabled">Resubmit</button>
<button class="center aligned ui red icon button" onclick="window.location.href='{{ route('timesheet::form.rejected', ['tpid' => data_get($tpcharge,'id')]) }}';">Resubmit</button>
@elseif(data_get($value,'tm_timesheet_master_sts') == 1)
<!-- <button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['year' => data_get($tpcharge,'tp_year'), 'month' => data_get($tpcharge,'tp_month'), 'phase' => data_get($tpcharge,'tp_phase')]) }}';">Edit Draft</button> -->
@else
<!-- <button class="center aligned ui red icon button disabled">Resubmit</button> -->
@endif
</td>
</tr>
......@@ -156,9 +161,11 @@
</td>
<td style="width: 12%;" class="text-center">
@if(data_get($tpoverhead,'tp_timesheet_sts') == 5 || data_get($tpoverhead,'tp_timesheet_sts') == 6)
<button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::form.rejected', ['tpid' => data_get($tpoverhead,'id')]) }}';">Resubmit</button>
<button class="center aligned ui red icon button" onclick="window.location.href='{{ route('timesheet::form.rejected', ['tpid' => data_get($tpoverhead,'id')]) }}';">Resubmit</button>
@elseif(data_get($value,'tm_timesheet_master_sts') == 1)
return ke edit overhead
@else
<button class="center aligned ui red icon button disabled">Resubmit</button>
<!-- <button class="center aligned ui red icon button disabled">Resubmit</button> -->
@endif
</td>
</tr>
......
......@@ -37,37 +37,41 @@
<td class="single line">{{data_get($staff,'name')}}</td>
<td></td>
<?php $totalc = 0; ?>
@foreach($chargeproject as $key => $chargeable)
<td>
@foreach($ringkasan as $key => $value)
@if(data_get($value,'staffid') == data_get($staff,'staffid') && data_get($chargeable,'id') == data_get($value,'c_pid'))
{{data_get($value,'total_c_hours')}}
<?php $totalc += data_get($value,'total_c_hours'); ?>
@endif
@endforeach
</td>
@endforeach
@foreach($chargeproject as $key => $chargeable)
<td>
<?php $monthly_hours = 0; ?>
@foreach($ringkasan as $key => $value)
@if(data_get($value,'staffid') == data_get($staff,'staffid') && data_get($chargeable,'id') == data_get($value,'c_pid'))
<!-- {{data_get($value,'total_c_hours')}} -->
<?php $monthly_hours += data_get($value,'total_c_hours'); ?>
<?php $totalc += data_get($value,'total_c_hours'); ?>
@endif
@endforeach
@if($monthly_hours == 0)
@else
{{$monthly_hours}}
@endif
</td>
@endforeach
<td class="center aligned">{{$totalc}}</td>
<td class="center aligned">{{number_format($totalc/8, 1, '.', '')}}</td>
<td class="center aligned">
<?php $totalnc = 0; ?>
@foreach($projectnc as $key => $project)
@if(data_get($project,'staffid') == data_get($staff,'staffid'))
{{data_get($project,'nonchargehours')}}
<?php $totalnc += data_get($project,'nonchargehours'); ?>
@endif
@endforeach
</td>
@foreach($overhead as $key => $value)
<td>
@foreach($ovhours as $key => $hours)
@if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid'))
{{data_get($hours,'hours')}}
<?php $totalnc += data_get($hours,'hours'); ?>
@endif
@endforeach
</td>
@endforeach
<?php $totalnc = 0; ?>
@foreach($overhead as $key => $value)
<td>
<?php $monthly_hours = 0; ?>
@foreach($ovhours as $key => $hours)
@if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid'))
<!-- {{data_get($hours,'hours')}} -->
<?php $monthly_hours += data_get($hours,'hours') ?>
<?php $totalnc += data_get($hours,'hours'); ?>
@endif
@endforeach
@if($monthly_hours == 0)
@else
{{$monthly_hours}}
@endif
</td>
@endforeach
<td class="center aligned">{{$totalnc}}</td>
<td class="center aligned">{{number_format($totalnc/8, 1, '.', '')}}</td>
<?php $totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?>
......
......@@ -66,12 +66,18 @@
<?php $totalc = 0; ?>
@foreach($chargeproject as $key => $chargeable)
<td>
@foreach($ringkasan as $key => $value)
@if(data_get($value,'staffid') == data_get($staff,'staffid') && data_get($chargeable,'id') == data_get($value,'c_pid'))
{{data_get($value,'total_c_hours')}}
<?php $totalc += data_get($value,'total_c_hours'); ?>
@endif
@endforeach
<?php $monthly_hours = 0; ?>
@foreach($ringkasan as $key => $value)
@if(data_get($value,'staffid') == data_get($staff,'staffid') && data_get($chargeable,'id') == data_get($value,'c_pid'))
<!-- {{data_get($value,'total_c_hours')}} -->
<?php $monthly_hours += data_get($value,'total_c_hours'); ?>
<?php $totalc += data_get($value,'total_c_hours'); ?>
@endif
@endforeach
@if($monthly_hours == 0)
@else
{{$monthly_hours}}
@endif
</td>
@endforeach
<td class="center aligned">{{$totalc}}</td>
......@@ -80,12 +86,18 @@
<?php $totalnc = 0; ?>
@foreach($overhead as $key => $value)
<td>
<?php $monthly_hours = 0; ?>
@foreach($ovhours as $key => $hours)
@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 $totalnc += data_get($hours,'hours'); ?>
@endif
@endforeach
@if($monthly_hours == 0)
@else
{{$monthly_hours}}
@endif
</td>
@endforeach
<td class="center aligned">{{$totalnc}}</td>
......
......@@ -54,6 +54,7 @@ class ReportController extends Controller
$year = Ts_master::select('tm_year')
->distinct('tm_year')
->orderby('tm_year','DESC')
->where('tm_timesheet_master_sts', 4)
->get();
return view('timesheet::report.ringkasanLaporan', compact('dept', 'month', 'year'));
......@@ -63,8 +64,9 @@ class ReportController extends Controller
{
$ringkasan = VwRingkasanLaporan::where('month', $request->month)
->where('year', $request->year)
->where('status', 4)
->get();
// dd($ringkasan);
// $projectnc = VwNonchargeSummary::where('month', $request->month)
// ->where('year', $request->year)
// ->get();
......@@ -74,6 +76,7 @@ class ReportController extends Controller
$ovhours = VwOverheadSummary::where('month', $request->month)
->where('year', $request->year)
->where('status', 4)
->get();
// dd($ovhours);
......
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