main
Ilham Wara Nugroho 2026-06-12 14:42:06 +07:00
parent 6c5c6ace07
commit 57b418392f
1 changed files with 42 additions and 39 deletions

View File

@ -43,51 +43,54 @@
<input type="hidden" name="instansi" value="{{ $instansi }}"> <input type="hidden" name="instansi" value="{{ $instansi }}">
<div class="table-responsive mt-3" style="overflow-x: auto;"> <div class="table-responsive mt-3" style="overflow-x: auto;">
<table class="table table-bordered table-detail"> <table class="table table-bordered table-detail">
<thead class="table-info text-white">
<tr>
<th>No.</th>
<th>Tahun</th>
@foreach ($formDetails as $detail)
@php
$unitCode = $detail->unit_code;
$unitCategory = $unitsMap[$unitCode]->category ?? null;
@endphp
<th style="min-width: 150px; text-decoration:normal">
{{ $detail->activity ? $detail->activity->name : 'N/A' }} - ({{ $detail->unit_code }})
@if ($unitCategory)
@else
{{ $unitCode }}
@endif
</th>
@endforeach
</tr>
@php
$years = activityYearRange($inventoryYear);
@endphp
@foreach ($years as $k => $year)
<tr> <tr>
<th>No.</th> <td>{{ $k+1 }}</td>
<th>Tahun</th> <td>{{ $year }}</td>
@foreach ($formDetails as $detail) @foreach ($formDetails as $detail)
@php @php
$unitCode = $detail->unit_code; $activity_value = isset($activityFormDetails[$year])
$unitCategory = $unitsMap[$unitCode]->category ?? null; ? $activityFormDetails[$year]
->where('activity_code', $detail->activity_code)
->where('activity_unit_code', $detail->unit_code)
->first()->activity_value ?? ''
: '';
@endphp @endphp
<th style="min-width: 150px; text-decoration:normal"> <td>
{{ $detail->activity ? $detail->activity->name : 'N/A' }} - ({{ $detail->unit_code }}) <div class="input-group">
<input type="text"
@if ($unitCategory) name="data[{{ $year }}][{{ $detail->activity_code }}-{{ $detail->unit_code }}]"
value="{{ getFormattedValue($activity_value) ?? '' }}"
@else class="form-control text-right" oninput="numberFormat(this)"
{{ $unitCode }} {{ $isLocked || $instansi === 'all' || $limitInternal ? 'readonly' : '' }}>
@endif </div>
</th> </td>
@endforeach @endforeach
</tr> </tr>
</thead> @endforeach
<tbody>
@php
$years = activityYearRange($inventoryYear);
@endphp
@foreach ($years as $k => $year)
<tr>
<td>{{ $k+1 }}</td>
<td>{{ $year }}</td>
@foreach ($formDetails as $detail)
@php
$activity_value = isset($activityFormDetails[$year])
? $activityFormDetails[$year]
->where('activity_code', $detail->activity_code)
->where('activity_unit_code', $detail->unit_code)
->first()->activity_value ?? ''
: '';
@endphp
<td>
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table> </table>
</form> </form>
{{-- @include('modules.form.table') --}} {{-- @include('modules.form.table') --}}