{{-- HEADER --}} {{-- Kiri: logo + nama company + alamat --}} {{-- Kanan: judul + kotak info --}}
{{ $company->nama_company }}
{!! $company->alamat !!}
Faktur Penjualan
Tanggal Nomor
{{ date('d M Y', strtotime($data->invoice_date)) }} {{ $data->invoice_number }}
Tgl. Jatuh Tempo {{ date('d/m/Y', strtotime($data->due_date)) }}
Syarat Pembayaran PO No
{{ $data->customers->top->remarks ?? 'CASH' }} {{ $so_number }}
Penjual: {{ $salesman_name ?? '-' }}
{{-- KEPADA --}}
Kepada : {{ $data->customers->code ?? '-' }} - {{ $data->customers->nama_customer ?? '-' }}
{{ $data->customers->address ?? '-' }}    {{ $kecamatan_name ?? '-' }}, {{ $kabupaten_name ?? '-' }}
{{-- TABEL BARANG --}} @php $totalDpp = 0; $totalPpn = 0; @endphp @foreach ($data->items as $i => $item) @php $subtotal = (float) $item->subtotal; $price = (float) $item->price; $taxRate = (float) ($ppn_val ?? 11); $dpp = $subtotal / (1 + $taxRate / 100); $ppn = $subtotal - $dpp; $hargaExcl = $price / (1 + $taxRate / 100); $harga_channel = ''; if ($item->so_detail->has_channel_price == 1) { $harga_channel = ' (Disc. Cnl)'; } if ($item->so_detail->has_customer_product == 1) { $harga_channel = ' (Disc. Cust)'; } $totalDpp += $dpp; $totalPpn += $ppn; //$isPageBreakItem = ($i + 1) % 4 == 0 && $i + 1 != count($data->items); $isPageBreakItem = false; @endphp @endforeach
No Nama Barang Satuan. Qty @Harga (Excl. PPN) PPN Diskon Total Harga
{{ $i + 1 }} {{ $item->products->name ?? '-' }} {{ $item->so_detail->units->name ?? '-' }} {{ number_format($item->qty, 0, ',', '.') }} {{ $subtotal <= 0 ? 0 : number_format($hargaExcl, 0, ',', '.') }} {{ $harga_channel }} {{ number_format($ppn, 0, ',', '.') }} {{ number_format($item->discount, 0, ',', '.') }} {{ number_format($subtotal, 0, ',', '.') }}
{{-- TERBILANG --}} @php // Fungsi terbilang tidak tersedia default, tampilkan saja angkanya // Jika punya helper terbilang, ganti ini $terbilang = '-'; if (function_exists('terbilang')) { $terbilang = ucfirst(terbilang($grandTotal)); } @endphp @if ($terbilang !== '-')
Terbilang : {{ $terbilang }}
@endif {{-- FOOTER: TTD kiri + Summary kanan --}}