@php use App\Models\GenerationBatch; $tpl = $this->template; $totals = $this->totals; $stateLabel = ['mapped' => 'Sudah terpetakan', 'candidate' => 'Ada kandidat aset lama', 'create' => 'Akan dibuat (draft)', 'excess' => 'Melebihi standar', 'not_available' => 'Tidak tersedia']; @endphp
  1. 1. Template
  2. 2. Kamar
  3. 3. Preview & pencocokan
  4. 4. Buat kandidat
  5. 5. Cetak label & verifikasi

1 · Template published

@if ($tpl) @foreach ($tpl->items as $i) @endforeach
ItemJmlModePosisi
{{ $i->standard_name }} ({{ $i->item_key }}){{ $i->quantity }}{{ $i->mode === 'quantity' ? 'kelompok' : 'individual' }}{{ $i->positions ?: '—' }}

{{ $tpl->unitCount() }} unit individual per kamar. Seri, nilai, garansi, kondisi & foto tidak disalin — diisi saat verifikasi fisik.

@endif

2 · Kamar ({{ count($roomIds) }} dipilih)

@forelse ($this->rooms as $r) @php $same = $tpl && (int) $r->room_type_id === (int) $tpl->room_type_id; @endphp @empty
Belum ada kamar. Tambahkan di Lokasi.
@endforelse
@if ($preview)

3 · Preview — belum ada data yang dibuat

Kamar{{ $totals['rooms'] }}{{ $totals['blocked'] }} terhalang tipe
Unit standar{{ $totals['standard'] }}
Sudah terpetakan{{ $totals['mapped'] }}
Kandidat cocok{{ $totals['candidate'] }}
Akan dibuat{{ $totals['create'] }}+ {{ $totals['excess'] }} berlebih, {{ $totals['not_available'] }} n/a
@foreach ($preview as $room)
first || $room['counts']['candidate'] ? 'open' : '' }} style="margin-bottom:.6rem"> {{ $room['room_ref'] }} {{ $room['room'] }} @unless ($room['allowed'])tipe kamar berbeda — dilewati@endunless · {{ $room['counts']['create'] }} dibuat · {{ $room['counts']['candidate'] }} kandidat · {{ $room['counts']['mapped'] }} terpetakan @foreach ($room['rows'] as $r) @php $key = $room['room_id'].'|'.$r['item_key'].'|'.$r['unit_position']; @endphp @endforeach
ItemPosisiKeadaanAset / keputusanCatatan
{{ $r['name'] }} {{ $r['position_label'] ?? ($r['mode'] === 'quantity' ? $r['expected_qty'].' '.$r['unit'] : '—') }} {{ $stateLabel[$r['state']] }} @if ($r['state'] === 'mapped' || $r['state'] === 'excess') {{ $r['mapped_label'] }} @elseif ($r['state'] === 'candidate') @elseif ($r['state'] === 'create') aset draft + label baru @else — @endif {{ $r['note'] }}
@endforeach
@unless ($batchId)
memproses per kamar…

Diproses per kamar secara atomik. Bila slot kamar berubah sejak preview, kamar itu ditandai konflik dan tidak diubah. Mengirim ulang tidak membuat aset ganda.

@endunless
@endif @if ($b = $this->batch)

Hasil batch {{ $b->number }} · {{ GenerationBatch::STATUSES[$b->status] }}

{{ $b->created_assets }} kandidat dibuat · {{ $b->matched_assets }} aset lama dicocokkan · {{ $b->results->where('status', '!=', 'ok')->count() }} kamar perlu perhatian.

@endif