@extends('layouts.app') @section('title', 'RAB ' . ucfirst($type) . ' — ' . $project->nama_proyek) @section('page-style') @endsection @section('content') @include('admin.projects.tabs', ['activeTab' => 'rab_'.$type]) {{-- Flash messages for Import --}} @if(session('import_success')) @endif @if(session('import_error')) @endif
{{-- Budget Summary Bar --}}

TOTAL ANGGARAN RAB {{ strtoupper($type) }}

Rp {{ number_format($grandTotal, 0, ',', '.') }}

JUMLAH ITEM {{ $type === 'material' ? 'MATERIAL' : 'PEKERJAAN' }}

{{ $details->flatten()->count() }} item

JUMLAH KATEGORI

{{ $details->count() }} kategori
{{-- Form Tambah Item RAB (Multi-Row Input) --}}
Tambah {{ $type === 'material' ? 'Material' : 'Item Pekerjaan' }}
Anda dapat menambahkan 1 atau beberapa {{ $type === 'material' ? 'material' : 'uraian pekerjaan' }} sekaligus dalam satu kategori
@csrf {{-- Category Header Selection --}}
@error('kategori_nama')
{{ $message }}
@enderror
{{-- Container Baris Item RAB --}}
{{-- Row-row item akan dirender secara dinamis oleh JavaScript --}}
{{-- Controls & Submission Footer --}}
Total Tambahan: Rp 0
{{-- Template Baris Item RAB (Hidden) --}} {{-- Tabel RAB Detail (Hierarkis per Kategori) --}}
Rincian RAB {{ ucfirst($type) }}
@php $rowNum = 1; @endphp @forelse($details as $catName => $items) {{-- Category Header Row --}} {{-- Detail Rows for this category --}} @foreach($items as $d) @php $catDisplay = $d->kategori_nama ?: ($d->rabCategory->nama_kategori ?? ''); $rowFiles = $rabDetailFiles->get($d->id, collect()); @endphp @endforeach {{-- Sub-total Row --}} @empty @endforelse @if($details->isEmpty()) @endif
No {{ $type === 'material' ? 'Material' : 'Uraian Pekerjaan' }} Sat. Volume Harga Satuan Jumlah (Rp) Aksi
{{ $catName }}
{{ $rowNum++ }} {{ $d->uraian_pekerjaan }} {{-- [REV-4] Indikator file per baris (dapat diklik untuk melihat list file saja) --}} @if($rowFiles->isNotEmpty()) {{ $rowFiles->count() }} @endif {{ $d->satuan }} {{ number_format($d->volume, 2, ',', '.') }} {{ number_format($d->harga_satuan, 0, ',', '.') }} {{ number_format($d->total_harga, 0, ',', '.') }} {{-- [REV-4] Tombol lampiran per baris --}}
@csrf @method('DELETE')
Sub Total {{ $catName }} {{ number_format($subTotals[$catName] ?? 0, 0, ',', '.') }}

Belum ada item RAB. Gunakan form di atas untuk menambahkan.

GRAND TOTAL RAB {{ strtoupper($type) }} Rp {{ number_format($grandTotal, 0, ',', '.') }}
{{-- [REV-4] Section File Lampiran Level Modul --}} @include('admin.partials.project_files_section', [ 'project' => $project, 'files' => $files, 'modul' => 'rab_' . $type, 'sectionTitle' => 'File Lampiran RAB ' . ucfirst($type), ]) {{-- Modal Edit Item RAB --}} {{-- [REV-4] Modal Lampiran per Baris RAB --}} {{-- Modal Import Excel RAP --}} @endsection @section('page-script') @endsection