@vite(['resources/css/app.css'])
@php use Carbon\Carbon; $invoiceNumber = 'INV/' . Carbon::parse($sale->report_date)->format('Y/m/') . str_pad($sale->id, 4, '0', STR_PAD_LEFT); $companyName = 'PT GRACE INDO PRATAMA'; $companyAddress = 'Jl. Industri No. 12, Medan, Sumatera Utara'; $companyPhone = '(061) 12345678'; $companyEmail = 'sales@graceindopratama.co.id'; $bankName = 'Transfer Bank'; $bankAccountName = 'A/N PT Grace Indo Pratama'; $invoiceDate = Carbon::parse($sale->report_date)->translatedFormat('d F Y'); $saleDate = Carbon::parse($sale->sale_date)->translatedFormat('d F Y'); $statusText = strtoupper($sale->status); $statusColor = $sale->status === 'Terhutang' ? 'text-red-700' : 'text-green-700'; $customerDisplay = $sale->customer_name ?: '-'; $customerRegion = trim( ($sale->customer_city ? $sale->customer_city . ', ' : '') . ($sale->customer_province ?: ''), ); $paymentHistories = $sale->paymentHistories->sortBy([['payment_date', 'asc'], ['id', 'asc']])->values(); $totalPaid = $paymentHistories->sum('amount'); $isPo = $sale->stock_type === 'po'; $stockTypeLabel = $isPo ? 'Pre-Order (PO)' : 'Ready Stock'; $totalFulfilled = $sale->items->sum('fulfilled_quantity'); $totalOrdered = $sale->items->sum('quantity'); @endphp {{-- top tools --}}
| Invoice No : | {{ $invoiceNumber }} |
| Tanggal Invoice : | {{ $invoiceDate }} |
| Tanggal Penjualan : | {{ $saleDate }} |
| Tipe Stok : | {{ $stockTypeLabel }} |
| SKU | Nama Produk | Qty | @if ($isPo)Dipenuhi | Sisa | @endifUnit | Harga Satuan | Diskon | Subtotal |
|---|---|---|---|---|---|---|---|---|
| {{ $item->productStock?->productVariant?->sku ?? '-' }} | {{ $item->productStock?->productVariant?->name ?? '-' }} | {{ $item->quantity }} | @if ($isPo){{ $item->fulfilled_quantity }} | {{ $remaining }} | @endif{{ $item->productStock?->productVariant?->unit ?? '-' }} | Rp {{ number_format($item->price, 0, ',', '.') }} | Rp {{ number_format($item->discount, 0, ',', '.') }} | Rp {{ number_format($item->subtotal, 0, ',', '.') }} |
( )