OLIVIA NOTA PENJUALAN
Kepada Yth.
{{ str_pad($salesInvoice->customers->customer_name ?? 'N/A', 35) }}No. Invoice : {{ $salesInvoice->sales_invoice_number }}
{{ str_pad($salesInvoice->customers->city?? 'N/A', 35) }}Tanggal : {{ \Carbon\Carbon::parse($salesInvoice->document_date)->format('d M Y') }}
---------------------------------------------------------------------------------------
|NO.|NAMA BARANG | QTY| HARGA | JUMLAH|
---------------------------------------------------------------------------------------
@php
$count = 0;
@endphp
@foreach($salesInvoice->details as $index => $detail)
@php
$maxLength = 35; // Max length for item name
$itemName = $detail->items->item_name;
$lines = explode("\n", wordwrap($itemName, $maxLength, "\n", false)); // Word-based wrapping
@endphp
@foreach($lines as $lineIndex => $line)
@if($lineIndex == 0)
|{{ str_pad($loop->parent->iteration . '.', 3) }}|{{ str_pad($line, 41) }}|{{ str_pad(number_format($detail->qty, 2, ',', '.') . ' ' . $detail->unit, 12, ' ', STR_PAD_LEFT) }}|{{ str_pad(number_format($detail->price, 0, ',', '.'), 12, ' ', STR_PAD_LEFT) }}|{{ str_pad(number_format(($detail->qty*$detail->price), 0, ',', '.'), 13, ' ', STR_PAD_LEFT) }}|
@else
|{{ str_pad('', 3) }}|{{ str_pad($line, 41) }}|{{ str_pad('', 12) }}|{{ str_pad('', 12) }}|{{ str_pad('', 13) }}|
@endif
@php
$count++;
@endphp
@endforeach
@endforeach
@if(14 - $count-1>0)
|---|-----------------------------------------|------------|------------|-------------|
@endif
@for($i = 0; $i < (14 - $count-1); $i++)
|{{ str_pad('', 3) }}|{{ str_pad('', 41) }}|{{ str_pad('', 12) }}|{{ str_pad('', 12) }}|{{ str_pad('', 13) }}|
@endfor
---------------------------------------------------------------------------------------
@php
$maxLength = 35; // Max length for Terbilang
$terbilang = "Terbilang: " . $totalHuruf;
$terbilangLines = explode("\n", wordwrap($terbilang, $maxLength, "\n", false));
// Ensure at least 3 lines for Terbilang, padding with empty strings if needed
while (count($terbilangLines) < 3) {
$terbilangLines[] = '';
}
@endphp
{{ str_pad($terbilangLines[0], 35) }} Sub Total : {{ str_pad(number_format($salesInvoice->subtotal+$totalDiscount, 0, ',', '.'), 15, ' ', STR_PAD_LEFT) }}
{{ str_pad($terbilangLines[1], 35) }} Discount : {{ str_pad(number_format($totalDiscount, 0, ',', '.'), 15, ' ', STR_PAD_LEFT) }}
{{ str_pad($terbilangLines[2], 35) }} PPN : {{ str_pad(number_format($salesInvoice->add_tax, 0, ',', '.'), 15, ' ', STR_PAD_LEFT) }}
@if(isset($terbilangLines[3]))
@foreach(array_slice($terbilangLines, 3) as $extraLine)
{{ str_pad($extraLine, 35) }}
@endforeach
@endif
{{ str_pad('', 35) }} Total Invoice: {{ str_pad(number_format($salesInvoice->total, 0, ',', '.'), 15, ' ', STR_PAD_LEFT) }}
OLIVIA SURAT JALAN
Kepada Yth.
{{ str_pad($customerOrigin->customer_name ?? 'N/A', 35) }}No. SJ :{{ $salesInvoice->sales_invoice_number }}
{{ str_pad($customerOrigin->city ?? 'N/A', 35) }}Tanggal : {{ \Carbon\Carbon::parse($salesInvoice->document_date)->format('d M Y') }}
---------------------------------------------------------------------------------------
|NO.|NAMA BARANG | QTY|
---------------------------------------------------------------------------------------
@php
$count=0;
@endphp
@foreach($salesInvoice->details as $index => $detail)
@php
$maxLength = 59; // Max length for item name
$itemName = $detail->items->item_name;
$lines = explode("\n", wordwrap($itemName, $maxLength, "\n", false)); // Word-based wrapping
$qtys+=$detail->qty;
@endphp
@foreach($lines as $lineIndex => $line)
@if($lineIndex == 0)
|{{ str_pad($loop->parent->iteration . '.', 3) }}|{{ str_pad($line, 66) }}|{{ str_pad(number_format( $detail->qty, 2, ',', '.') . ' ' . $detail->unit, 14, ' ', STR_PAD_LEFT) }}|
@else
|{{ str_pad('', 3) }}|{{ str_pad($line, 66) }}||{{ str_pad('', 14) }}|
@endif
@php
$count++;
@endphp
@endforeach
@endforeach
@if(14 - $count-1>0)
|---|------------------------------------------------------------------|--------------|
@endif
@for($i = 0; $i < (14 - $count-1); $i++)
|{{ str_pad('', 3) }}|{{ str_pad('', 66) }}|{{ str_pad('', 14) }}|
@endfor
---------------------------------------------------------------------------------------
Penerima, Hormat Kami,
--------------------------------------------------------
|Apabila Saat Bongkar Dibanting/Kasar Harap Divideo Dan|
|Dikirim Ke Sales Yg Bersangkutan |
|Hotline Pengaduan: - (TLP dan WA) |
--------------------------------------------------------