update
parent
0b6cb5882a
commit
04c7a1d969
|
|
@ -24,7 +24,7 @@ class CrfExport implements FromView, WithStyles
|
|||
|
||||
public function view(): View
|
||||
{
|
||||
return view('reports.crf.report', [
|
||||
return view('modules.reports.crf.report', [
|
||||
'sector' => $this->sector,
|
||||
'crfData' => $this->crfData,
|
||||
'worksheets' => $this->worksheets,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ use Maatwebsite\Excel\Facades\Excel;
|
|||
|
||||
class CrfController extends Controller
|
||||
{
|
||||
protected $title = 'Common Reporting Format (CRF)';
|
||||
protected $template = 'modules.reports.crf';
|
||||
protected $route = 'modules.laporan.crf';
|
||||
protected $service;
|
||||
|
||||
public function __construct(CrfService $service)
|
||||
|
|
@ -31,8 +34,11 @@ class CrfController extends Controller
|
|||
->where('inventory_year', $inventoryYear)
|
||||
->where('activity_year', $activityYear)
|
||||
->get();
|
||||
// dd($crfData);
|
||||
|
||||
return view('reports.crf.index', [
|
||||
return view($this->template.'.index', [
|
||||
'title' => $this->title,
|
||||
'route' => $this->route,
|
||||
'inventoryYear' => $inventoryYear ?? date('Y'),
|
||||
'activityYear' => $activityYear ?? date('Y') - 1,
|
||||
'sectorCode' => $sectorCode,
|
||||
|
|
|
|||
|
|
@ -1,26 +1,11 @@
|
|||
@extends('layouts.master')
|
||||
|
||||
@section('title')
|
||||
Common Reporting Format (CRF)
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0 font-weight-bold">Common Reporting Format (CRF)</h5>
|
||||
<h5 class="mb-0 font-weight-bold">{{@$title}}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($errors->has('error'))
|
||||
<div class="alert alert-danger">
|
||||
{{ $errors->first('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form id="crfForm" method="GET">
|
||||
<div class="row">
|
||||
|
|
@ -46,32 +31,29 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 d-flex align-items-end align-items-center pt-1 pr-1">
|
||||
<div class="col-lg-12 d-flex align-items-end align-items-center pt-1 pr-1 gap-3">
|
||||
<div class="form-group mt-2 mb-0 mr-2">
|
||||
<button type="submit" class="btn btn-info">Tampilkan</button>
|
||||
</div>
|
||||
<div class="form-group mt-2 mb-0">
|
||||
<a href="{{ route('crf.export', [
|
||||
<a href="{{ route($route.'.export', [
|
||||
'inventoryYear' => $inventoryYear,
|
||||
'activityYear' => $activityYear,
|
||||
'sectorCode' => $sectorCode,
|
||||
]) }}"
|
||||
class="btn btn-info">Ekspor Excel</a>
|
||||
class="btn btn-success">Ekspor Excel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
@if ($crfData->isNotEmpty())
|
||||
@include('reports.crf.table')
|
||||
@include('modules.reports.crf.table')
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
|
@ -97,7 +79,7 @@
|
|||
const activityYear = $('#activityYear').val() || '';
|
||||
const sectorCode = $('#category').val() || '';
|
||||
|
||||
let actionUrl = `{{ url('reports/crf') }}/${inventoryYear}`;
|
||||
let actionUrl = `{{ url('laporan/crf') }}/${inventoryYear}`;
|
||||
if (activityYear) actionUrl += `/${activityYear}`;
|
||||
if (sectorCode) actionUrl += `/${sectorCode}`;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,4 +6,4 @@
|
|||
<p></p>
|
||||
</div>
|
||||
|
||||
@include('reports.crf.table')
|
||||
@include('modules.reports.crf.table')
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
</tr>
|
||||
|
||||
@foreach ($worksheet->children as $child)
|
||||
@include('reports.crf.row', ['worksheet' => $child, 'level' => $level + 1])
|
||||
@include('modules.reports.crf.row', ['worksheet' => $child, 'level' => $level + 1])
|
||||
@endforeach
|
||||
@else
|
||||
@if ($data)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
@foreach ($worksheets as $main)
|
||||
@include('reports.crf.row', ['worksheet' => $main, 'level' => 0])
|
||||
@include('modules.reports.crf.row', ['worksheet' => $main, 'level' => 0])
|
||||
@endforeach
|
||||
|
||||
<tr class="text-right font-weight-bold">
|
||||
|
|
|
|||
Loading…
Reference in New Issue