{{-- Tabs Navigation --}}
{{-- Header Page --}}
@if($activeTab === 'products')

Daftar Menu & Harga

Atur seluruh katalog menu, varian rasa, barcode scanner, dan harga standar Bebek Mba Reina.

@else

🏷️ Kategori Menu

Kelola kategori hidangan untuk mempermudah navigasi POS kasir dan pelaporan menu terlaris.

@endif
@if($activeTab === 'products') @else @endif
{{-- Feedback Messages --}} @if (session()->has('message'))
✅ {{ session('message') }}
@endif @if (session()->has('error'))
⚠️ {{ session('error') }}
@endif {{-- TAB 1: DAFTAR MENU --}} @if($activeTab === 'products') {{-- Filtering & Search Bar --}}
{{-- Search --}}
🔍
{{-- Category Filter --}} {{-- Row Limit Filter --}}
Tampilkan:
{{-- Product Table Grid --}}
@forelse($products as $p) @empty @endforelse
Nama Menu Kategori Barcode Varian Harga Status Aksi
{{ $p->name }} {{ $p->category->name }} {{ $p->barcode }} @if($p->variants->count() > 0)
@foreach($p->variants as $var) {{ $var->name }} (Rp {{ number_format($var->base_price, 0, ',', '.') }}) @endforeach
@else Tanpa varian @endif
Rp {{ number_format($p->price, 0, ',', '.') }} @if($p->is_active) AKTIF @else NON-AKTIF @endif
Belum ada data menu.
{{-- Pagination Links --}} @if($products->hasPages())
{{ $products->links() }}
@endif
@endif {{-- TAB 2: KATEGORI MENU --}} @if($activeTab === 'categories') {{-- Search Categories & Row Limit --}}
🔍
{{ $categoriesPaginated->total() }} Kategori
Tampilkan:
{{-- Category Table --}}
@forelse($categoriesPaginated as $cat) @empty @endforelse
# Nama Kategori Jumlah Menu Aksi
{{ $categoriesPaginated->firstItem() + $loop->index }}
{{ $cat->name }}
{{ $cat->products_count }} Menu
🏷️ Belum ada kategori terdaftar.
{{-- Category Pagination --}} @if($categoriesPaginated->hasPages())
{{ $categoriesPaginated->links() }}
@endif
@endif {{-- PRODUCT CRUD MODAL --}} @if($isModalOpen)

{{ $productId ? '✍️ Edit Menu' : '➕ Tambah Menu Baru' }}

{{-- Name --}}
@error('name') {{ $message }} @enderror
{{-- Category --}}
@error('category_id') {{ $message }} @enderror
{{-- Toggle Varian --}}

Produk Memiliki Varian?

Contoh: Paha, Dada, Sayap — dengan harga berbeda

{{-- Harga Tunggal (jika TIDAK ada varian) --}} @if(!$hasVariants)
@error('price') {{ $message }} @enderror
@endif {{-- Tabel Varian (jika ADA varian) --}} @if($hasVariants)
@foreach($variantRows as $index => $row) @endforeach
No Nama Varian Harga (Rp) Hapus
{{ $index + 1 }} @error('variantRows.' . $index . '.name') {{ $message }} @enderror @error('variantRows.' . $index . '.base_price') {{ $message }} @enderror
@error('variantRows') {{ $message }} @enderror
@endif {{-- Barcode --}}
@error('barcode') {{ $message }} @enderror
{{-- Active Switch --}}
{{-- Buttons --}}
@endif {{-- CATEGORY CRUD MODAL --}} @if($isCategoryModalOpen)

{{ $categoryId ? '✍️ Edit Kategori' : '🏷️ Tambah Kategori Baru' }}

@error('categoryName') {{ $message }} @enderror
@endif {{-- PRODUCT DETAIL MODAL --}} @if($isDetailModalOpen && $detailProduct)
{{-- Modal Header --}}

👁️ Detail Menu & Spesifikasi

{{-- Specifications Grid --}}
NAMA MENU {{ $detailProduct->name }}
KATEGORI {{ $detailProduct->category?->name ?? '-' }}
BARCODE / SKU {{ $detailProduct->barcode }}
STATUS MENU {{ $detailProduct->is_active ? 'AKTIF & DAPAT DIORDER' : 'NON-AKTIF' }}
HARGA JUAL POS KASIR Rp {{ number_format($detailProduct->price, 0, ',', '.') }}
{{-- Variants list --}} @if($detailProduct->variants->isNotEmpty())
DAFTAR VARIAN HARGA
@foreach($detailProduct->variants as $var) {{ $var->name }} Rp {{ number_format($var->base_price, 0, ',', '.') }} @endforeach
@endif {{-- Purchase History Section --}}

🛒 Riwayat Pembelian & Harga Beli

@forelse($purchaseHistory as $item) @empty @endforelse
Tanggal No. Pembelian Cabang Supplier Qty Harga Beli Total
{{ $item->purchase?->created_at?->format('d/m/Y H:i') ?? '-' }} {{ $item->purchase?->purchase_number ?? '-' }} {{ $item->purchase?->branch?->name ?? '-' }} {{ $item->purchase?->supplier?->name ?? '-' }} {{ number_format($item->quantity, 0) }} Rp {{ number_format($item->price, 0, ',', '.') }} Rp {{ number_format($item->total, 0, ',', '.') }}
Belum ada riwayat pembelian untuk menu ini.
{{-- Close Button --}}
@endif