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