update
parent
6c5c6ace07
commit
57b418392f
|
|
@ -43,51 +43,54 @@
|
|||
<input type="hidden" name="instansi" value="{{ $instansi }}">
|
||||
<div class="table-responsive mt-3" style="overflow-x: auto;">
|
||||
<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>
|
||||
<th>No.</th>
|
||||
<th>Tahun</th>
|
||||
<td>{{ $k+1 }}</td>
|
||||
<td>{{ $year }}</td>
|
||||
@foreach ($formDetails as $detail)
|
||||
@php
|
||||
$unitCode = $detail->unit_code;
|
||||
$unitCategory = $unitsMap[$unitCode]->category ?? null;
|
||||
$activity_value = isset($activityFormDetails[$year])
|
||||
? $activityFormDetails[$year]
|
||||
->where('activity_code', $detail->activity_code)
|
||||
->where('activity_unit_code', $detail->unit_code)
|
||||
->first()->activity_value ?? ''
|
||||
: '';
|
||||
@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>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input type="text"
|
||||
name="data[{{ $year }}][{{ $detail->activity_code }}-{{ $detail->unit_code }}]"
|
||||
value="{{ getFormattedValue($activity_value) ?? '' }}"
|
||||
class="form-control text-right" oninput="numberFormat(this)"
|
||||
{{ $isLocked || $instansi === 'all' || $limitInternal ? 'readonly' : '' }}>
|
||||
</div>
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<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>
|
||||
@endforeach
|
||||
</table>
|
||||
</form>
|
||||
{{-- @include('modules.form.table') --}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue