{{-- HEADER --}}

{{ $company->nama_company }}

{!! $company->alamat !!}

SALES ORDER

No: {{ $data->so_number }}
{{-- QR Code (otomatis di-generate) --}}
{{-- --}}

{{-- INFORMASI PO --}}
Kode SO: {{ $data->so_number }} Tanggal SO: {{ date('d/m/Y', strtotime($data->so_date)) }}
Pelanggan: {{ $data->customers->nama_customer ?? '-' }} Keterangan: {{ $data->remarks ?? '-' }} Channel Outlet: {{ $data->customers->channel_outlet ?? '-' }}

Detail Barang

@foreach ($data->items as $i => $item) @php $taxRate = $ppn_val ?? 11; $subtotalBeforeTax = $item->subtotal; // sudah include PPN $dpp = $subtotalBeforeTax / (1 + $taxRate / 100); // harga exclude PPN $ppn = $subtotalBeforeTax - $dpp; $hargaExcl = $item->unit_price / (1 + $taxRate / 100); // Cari promo item untuk produk ini $promoItems = $promo_item->where('sales_order_detail_id', $item->id); $harga_channel = ""; if($item->has_channel_price == 1){ $harga_channel = " (Disc. Cnl)"; } if($item->has_customer_product == 1){ $harga_channel = " (Disc. Cust)"; } @endphp @endforeach @foreach($promo as $v) @endforeach @php $subtotalAfterPromo = $data->total_amount - $data->discount_amount; $taxAmount = $subtotalAfterPromo - ($subtotalAfterPromo / (1 + ($data->tax_base / 100))); @endphp
No Produk Satuan Qty Harga (Excl. PPN) Disc (%) Disc (Rp) Keterangan PPN Subtotal (Incl. PPN)
{{ $i + 1 }} {{ $item->products->name ?? '-' }} @if($promoItems->count() > 0)
@foreach($promoItems as $pi) 🎁 {{ $pi->promo_name }} @if($pi->discount_percent > 0) ({{ $pi->discount_percent }}%) @endif @if($pi->discount_amount > 0) - Rp {{ number_format($pi->discount_amount, 0, ',', '.') }} @endif
@endforeach @endif
{{ $item->units->name ?? '-' }} {{ $item->qty }} {{ number_format($hargaExcl, 0, ',', '.') }} {{ $harga_channel }} {{ $item->discount_percent }} {{ number_format($item->discount_amount, 0, ',', '.') }} {{ $item->free_for == '' ? '' : 'FREE GOOD' }} {{ number_format($ppn, 0, ',', '.') }} {{ number_format($item->subtotal, 0, ',', '.') }}
Total {{ number_format($data->total_amount, 0, ',', '.') }}
{{ $v->promo_name }} - {{ number_format($v->total_potongan, 0, ',', '.') }}
PPN {{ $ppn_val }}% {{ number_format($taxAmount, 0, ',', '.') }}
Grand Total {{ number_format($subtotalAfterPromo, 0, ',', '.') }}





Disetujui Oleh


(__________________)



Dibuat Oleh


(__________________)