main
Ilham Wara Nugroho 2026-06-10 15:56:57 +07:00
parent 072863cfa7
commit cc2e96ef15
2 changed files with 7 additions and 1 deletions

View File

@ -95,6 +95,7 @@ class FormController implements HasMiddleware
$allUnits = ReferenceUnit::rowActive()->get();
$unitsMap = $allUnits->keyBy('code');
$unitsByCategory = $allUnits->groupBy('category');
dd($unitsByCategory);
// For Copy data feature
// $availableYears = ActivityForm::select('inventory_year')->distinct()

View File

@ -71,7 +71,12 @@
data-current-unit="{{ $unitCode }}">
@if (@$unitsByCategory[$unitCategory])
@foreach (@$unitsByCategory[$unitCategory] as $unit)
@if($unit->code == $unitCode)
<option value="{{ $unit->code }}"
{{ $unit->code == $unitCode ? 'selected' : '' }}>
{{ $unit->code }}
</option>
@endif
@endforeach
@endif
</select>