@php function rupiah($n) { return 'Rp ' . number_format($n, 0, ',', '.'); } $no = $faktur->nomor; $tglFmt = $faktur->tanggal_faktur->format('d-m-Y'); $namaFaskes = $faktur->nama_faskes; $namaPerusahaan = $profile->nama ?? 'PT. IDEMEDIKA'; $alamat = $profile->alamat ?? ''; $telp = $profile->telp ?? ''; @endphp
{{ $namaPerusahaan }}
{{ $alamat }}@if($telp)  •  Telp: {{ $telp }}@endif
No. Faktur:
{{ $no }}
FAKTUR PENJUALAN KSO — DETAIL PER LOT
@if($faktur->nomor_efaktur)@endif
Kepada Yth.:{{ $namaFaskes }}
Tanggal Faktur:{{ $tglFmt }}
No. eFaktur PPN:{{ $faktur->nomor_efaktur }}
@php $grandTotal = 0; @endphp @foreach($faktur->pemakaians as $pemakaian)
{{ $pemakaian->nomor_penjualan_kso }} @if($pemakaian->nama_pasien) — {{ $pemakaian->nama_pasien }} @endif ({{ $pemakaian->tgl_pemakaian->format('d-m-Y') }})
@php $no_i = 1; @endphp @foreach($pemakaian->items as $item) @php $stoks = $item->itemStoks ?? collect(); $subtotalItem = 0; @endphp @if($stoks->count() > 0) @foreach($stoks as $si => $stokItem) @php $stok = $stokItem->stok ?? null; $qtyRow = $stokItem->qty ?? 0; $subRow = $qtyRow * ($item->harga_jual ?? 0); $subtotalItem += $subRow; @endphp @if($si === 0) @endif @if($si === 0) @endif @endforeach @else @endif @php $no_i++; $grandTotal += $item->subtotal; @endphp @endforeach
No. Nama Barang No. LOT Exp. Qty Sat. Harga Jual Subtotal
{{ $no_i }} {{ $item->nama_barang }}{{ $stok->no_lot ?? '—' }} {{ $stok && $stok->tgl_exp ? $stok->tgl_exp->format('m/Y') : '—' }} {{ $qtyRow }}{{ $item->satuan ?? '-' }} {{ rupiah($item->harga_jual) }} {{ rupiah($item->subtotal) }}
{{ $no_i }} {{ $item->nama_barang }} — — {{ $item->qty }} {{ $item->satuan ?? '-' }} {{ rupiah($item->harga_jual) }} {{ rupiah($item->subtotal) }}
@endforeach
Subtotal{{ rupiah($faktur->subtotal) }}
DPP (11/12){{ rupiah($faktur->dpp) }}
PPN 12%{{ rupiah($faktur->ppn) }}
TOTAL{{ rupiah($faktur->total_harga) }}

Dibuat oleh,
{{ $faktur->dibuatOleh?->nama ?? '.....................' }}
Divalidasi oleh,
{{ $faktur->disetujuiOleh?->nama ?? '.....................' }}
Penerima,
................................