{{-- Header --}} {{-- Header --}}

Batch Konsinyasi

Kelola barang titipan supplier & mahasiswa.

{{-- Stats Cards --}} {{-- Stats Cards --}}
{{-- 1. Batch Aktif --}}

Batch Aktif

{{ $stats['activeBatches'] }} Batch

{{-- 2. Perlu Dibayar --}}

Perlu Dibayar

Rp {{ number_format($stats['pendingPayment'], 0, ',', '.') }}

{{-- 3 & 4. Rangkuman Keuangan (Merged Card) --}}

Rangkuman Keuangan

Nilai Aset (Titipan)

Rp {{ number_format($stats['totalAssetValue'], 0, ',', '.') }}

Total Omzet

Rp {{ number_format($stats['totalSold'], 0, ',', '.') }}

{{-- Tab Filter --}}
{{-- Table --}}
@forelse($batches as $batch) @empty @endforelse
Batch ID / Tgl Supplier Item Progress Terjual Estimasi Omzet Status Aksi
#{{ $batch->batchCode }} {{ $batch->receivedAt?->format('d M Y') }}
{{ strtoupper(substr($batch->supplier->businessName ?? 'S', 0, 1)) }}
{{ $batch->supplier->businessName ?? '-' }}
{{ $batch->items->count() }} SKU Total {{ $batch->totalInitialQty }} Pcs @php $percent = $batch->soldPercent; $colorClass = $percent >= 70 ? 'emerald' : ($percent >= 30 ? 'amber' : 'rose'); @endphp
{{ $percent }}% Terjual {{ $batch->totalSoldQty }}/{{ $batch->totalInitialQty }}
Rp {{ number_format($batch->totalValue, 0, ',', '.') }} @if($batch->status === 'REQUESTED') DIPESAN @elseif($batch->status === 'ACTIVE') Aktif @elseif($batch->status === 'PENDING_SETTLEMENT') Siap Bayar @elseif($batch->status === 'SETTLED') Lunas @else {{ $batch->status }} @endif @if($batch->status === 'REQUESTED') @else @endif

Belum ada batch konsinyasi.

@if($batches->hasPages())
{{ $batches->links() }}
@endif
{{-- Create Modal --}} @if($showCreateModal)

Terima Barang Konsinyasi

Input data barang titipan baru dari supplier

@error('supplierId') {{ $message }} @enderror
@if($supplierId)

Pilih produk dan masukkan jumlah yang diterima.

@if($products->count() === 0)

Supplier ini belum memiliki produk yang disetujui.

Pastikan produk sudah di-approve terlebih dahulu.

@else
@foreach($items as $index => $item)
@if(count($items) > 1) @endif
@endforeach
@endif @error('items') {{ $message }} @enderror
@else

Pilih supplier terlebih dahulu untuk melihat daftar produk.

@endif
@endif {{-- Detail Modal --}} @if($showDetailModal && $selectedBatch)

Batch #{{ $selectedBatch->batchCode }}

@if($selectedBatch->status === 'REQUESTED') DIPESAN @elseif($selectedBatch->status === 'ACTIVE') Aktif @elseif($selectedBatch->status === 'PENDING_SETTLEMENT') Siap Bayar @elseif($selectedBatch->status === 'SETTLED') Lunas @endif
{{-- Left: Progress & Items --}}
{{-- Progress --}}

Status Penjualan

{{ $selectedBatch->totalSoldQty }} dari {{ $selectedBatch->totalInitialQty }} pcs terjual

{{ $selectedBatch->soldPercent }}%
{{-- Items Table --}}

Rincian Barang

{{ $selectedBatch->items->count() }} SKU
@if($selectedBatch->status === 'REQUESTED') @else @endif @if($selectedBatch->status === 'REQUESTED') @foreach($receiveItems as $index => $receiveItem) @endforeach @else @foreach($selectedBatch->items as $item) @endforeach @endif
ProdukDikirim Diterima Catatan ItemHarga Qty Awal Selisih Terjual Retur Sisa
{{ $receiveItem['productName'] }}
{{ $receiveItem['requestedQty'] }}
{{ $item->product->name ?? '-' }}
Rp {{ number_format($item->sellPrice, 0, ',', '.') }} {{ $item->initialQty }} @if($item->damagedQty > 0) {{ $item->damagedQty }} @else - @endif {{ $item->soldQty }} @if($item->returnedQty > 0) {{ $item->returnedQty }} @else - @endif {{ $item->remainingQty }}
{{-- Right: Supplier & Summary --}}
{{-- Supplier Info --}}
{{ strtoupper(substr($selectedBatch->supplier->businessName ?? 'S', 0, 1)) }}

{{ $selectedBatch->supplier->businessName ?? '-' }}

{{ $selectedBatch->supplier->supplierType ?? 'Supplier' }}

{{-- Financial Summary --}}

Ringkasan Keuangan

Total Omzet Penjualan Rp {{ number_format($selectedBatch->totalSold, 0, ',', '.') }}
Margin Koperasi Rp {{ number_format($selectedBatch->margin, 0, ',', '.') }}
Dibayar ke Supplier Rp {{ number_format($selectedBatch->payableAmount, 0, ',', '.') }}
{{-- Batch Notes (if exists) --}} @if($selectedBatch->note)

Catatan

{{ $selectedBatch->note }}

@endif @if($selectedBatch->status === 'REQUESTED')

Stok belum ditambahkan. Konfirmasi penerimaan setelah barang diterima dari supplier.

@endif @if($selectedBatch->status === 'PENDING_SETTLEMENT') @endif @if($selectedBatch->status === 'ACTIVE' && $selectedBatch->items->sum('remainingQty') > 0) @endif
@endif {{-- Retur Modal --}} @if($showReturModal && $selectedBatch)

Retur Barang Konsinyasi

Batch #{{ $selectedBatch->batchCode }} - {{ $selectedBatch->supplier->businessName ?? '-' }}

Barang yang diretur akan dikembalikan ke supplier dan stok akan dikurangi.

@foreach($returItems as $index => $item)

{{ $item['productName'] }}

Sisa: {{ $item['remainingQty'] }} pcs

pcs
@endforeach
@if(count($returItems) === 0)

Semua barang sudah terjual!

@endif
@if(count($returItems) > 0) @endif
@endif