update
parent
508f59a7c3
commit
96459f29a6
|
|
@ -82,6 +82,11 @@ class FormController implements HasMiddleware
|
|||
})->get();
|
||||
|
||||
// Fetch activity form and activity form details using service
|
||||
if(request()->tahun){
|
||||
$inventoryYear = request()->tahun;
|
||||
}else{
|
||||
$inventoryYear = request()->tahun;
|
||||
}
|
||||
$activityForm = $this->formService->getActivityForm($sector, $code, $inventoryYear, $instansi);
|
||||
if ($instansi == 'all') {
|
||||
$activityFormId = $activityForm->pluck('id')->toArray();
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
</div>
|
||||
</div> --}}
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4 d-flex gap-2">
|
||||
<div class="form-group d-flex justify-content-center align-items-center gap-1">
|
||||
<div class="">
|
||||
<label for="instansi">Instansi: {{ $instansi }}</label>
|
||||
</div>
|
||||
{{-- <div class="">
|
||||
<label for="instansi">Instansi</label>
|
||||
</div> --}}
|
||||
<div class="input-group">
|
||||
<select name="instansi" id="instansi" class="form-control">
|
||||
<select name="instansi" id="instansi" class="form-control" style="width: 100px!important;">
|
||||
<option value="" selected>-- Pilih Instansi --</option>
|
||||
@if ($scope === \App\Enums\LingkupAksesData::ALL->value)
|
||||
<option value="none" @if ($instansi == 'none') selected @endif>DATA
|
||||
|
|
@ -33,11 +33,32 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group d-flex justify-content-center align-items-center gap-1">
|
||||
{{-- <div class="">
|
||||
<label for="instansi">Tahun</label>
|
||||
</div> --}}
|
||||
<div class="input-group">
|
||||
<select name="tahun" id="inventoryYear" class="form-control" style="width: 100px!important;">
|
||||
<option value="" selected>-- Pilih Tahun --</option>
|
||||
@foreach ($years as $k => $year)
|
||||
<option value="{{ $year }}" {{ request()->tahun == $year ? 'selected' : ''}}>
|
||||
{{ $year }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 order-md-2 d-flex gap-1 justify-content-end align-items-center flex-wrap">
|
||||
<div class="form-group mb-0 mr-2 d-none">
|
||||
@include('modules.form.approve')
|
||||
</div>
|
||||
<div class="form-group mb-0 mr-2">
|
||||
<a title="Tambah Data" class="btn btn-info mb-2 mb-md-0" href="{{ url($form->sector.'/'.$form->code.'/update?tahun='.request()->tahun.'&&instansi='.request()->instansi) }}"
|
||||
{{ !$activityForm || $instansi === 'all' || $limitInternal ? 'disabled' : '' }}>
|
||||
<i class="bx bx-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="form-group mb-0 mr-2">
|
||||
<a title="Tambah Data" class="btn btn-primary mb-2 mb-md-0" onclick="return showCreateModal()"
|
||||
{{ !$activityForm || $instansi === 'all' || $limitInternal ? 'disabled' : '' }}>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
$internal = $internal ?? null;
|
||||
$limitInternal = ($internal !== null) && !$agencies->isNotEmpty();
|
||||
|
||||
$years = activityYearRange($inventoryYear);
|
||||
@endphp
|
||||
|
||||
<div class="card shadow-sm" data-sector="{{ $form->sector }}" data-code="{{ $form->code }}">
|
||||
|
|
@ -46,15 +48,20 @@
|
|||
<table class="table table-bordered table-detail">
|
||||
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>No.</th>
|
||||
<th>No</th>
|
||||
<th>Tahun</th>
|
||||
@foreach ($formDetails as $detail)
|
||||
<th>Activity</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
@foreach ($formDetails as $k => $detail)
|
||||
@php
|
||||
$unitCode = $detail->unit_code;
|
||||
$unitCategory = $unitsMap[$unitCode]->category ?? null;
|
||||
@endphp
|
||||
<th style="min-width: 150px; text-decoration:normal">
|
||||
<tr>
|
||||
<td>{{$k+1}}</td>
|
||||
<td>{{request()->tahun}}</td>
|
||||
<td style="min-width: 150px; text-decoration:normal">
|
||||
{{ $detail->activity ? $detail->activity->name : 'N/A' }} - ({{ $detail->unit_code }})
|
||||
|
||||
@if ($unitCategory)
|
||||
|
|
@ -62,13 +69,23 @@
|
|||
@else
|
||||
{{ $unitCode }}
|
||||
@endif
|
||||
</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</td>
|
||||
@php
|
||||
$years = activityYearRange($inventoryYear);
|
||||
$activity_value = isset($activityFormDetails[request()->tahun])
|
||||
? $activityFormDetails[request()->tahun]
|
||||
->where('activity_code', $detail->activity_code)
|
||||
->where('activity_unit_code', $detail->unit_code)
|
||||
->first()->activity_value ?? ''
|
||||
: '';
|
||||
@endphp
|
||||
@foreach ($years as $k => $year)
|
||||
<td>
|
||||
<div class="input-group">
|
||||
{{ @$activity_value == "" ? "" : getFormattedValue($activity_value)}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
{{-- @foreach ($years as $k => $year)
|
||||
<tr>
|
||||
<td><a href="{{ url($form->sector.'/'.$form->code.'/update?tahun='.$year.'&&instansi='.$instansi) }}" class="btn btn-info btn-sm edit"><i class="bx bx-pencil"></i></a></td>
|
||||
<td>{{ $k+1 }}</td>
|
||||
|
|
@ -80,7 +97,7 @@
|
|||
->where('activity_code', $detail->activity_code)
|
||||
->where('activity_unit_code', $detail->unit_code)
|
||||
->first()->activity_value ?? ''
|
||||
: ''
|
||||
: '';
|
||||
@endphp
|
||||
<td>
|
||||
<div class="input-group">
|
||||
|
|
@ -89,7 +106,7 @@
|
|||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach --}}
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue