@extends('layouts.app') @section('title', 'RAB ' . ucfirst($type) . ' — ' . $project->nama_proyek) @section('page-style') @endsection @section('content') @include('admin.projects.tabs', ['activeTab' => 'rab_'.$type])
{{-- 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
@foreach($categorySuggestions as $suggestion) {{-- Form Tambah Item RAB --}}
Tambah {{ $type === 'material' ? 'Material' : 'Item Pekerjaan' }}
@csrf
@error('kategori_nama')
{{ $message }}
@enderror
@error('uraian_pekerjaan')
{{ $message }}
@enderror
@error('satuan')
{{ $message }}
@enderror
{{-- 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 ?? ''); @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 }} {{ $d->satuan }} {{ number_format($d->volume, 2, ',', '.') }} {{ number_format($d->harga_satuan, 0, ',', '.') }} {{ number_format($d->total_harga, 0, ',', '.') }}
@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, ',', '.') }}
{{-- Modal Edit Item RAB --}} @endsection @section('page-script') @endsection