@php $vendorName = $transaksi->vendor->name ?? ($transaksi->vendor->nama_vendor ?? 'Grafika Digital Printing'); $vendorAddress = $transaksi->vendor->address ?? ($transaksi->vendor->alamat ?? 'Alamat Vendor'); $vendorPhone = $transaksi->vendor->phone ?? ($transaksi->vendor->telepon ?? 'Telepon Vendor'); $vendorEmail = $transaksi->vendor->email ?? 'email@vendor.com'; @endphp
@if(isset($logoBase64) && $logoBase64) Logo @else @php $logoPath = $transaksi->vendor && $transaksi->vendor->logo ? asset('vendors_logo/' . $transaksi->vendor->logo) : asset('images/logo.png'); @endphp Logo @endif

{{ $vendorName }}

{{ $vendorAddress }}

{{ $vendorPhone }} | {{ $vendorEmail }}

No. Invoice : {{ $transaksi->kode }}
Tanggal : {{ $transaksi->tanggal_dibuat->format('d/m/Y') }}
Customer : {{ $transaksi->pelanggan->nama }}
Pembayaran : {{ ucfirst($transaksi->payment_method ?? 'Transfer') }}
Status : {{ ucfirst($transaksi->status ?? 'Processing') }}
@foreach ($transaksi->transaksiItem as $item)
{{ $item->produk->nama_produk }}
Quantity {{ $item->kuantitas }} pcs
@if ($item->transaksiItemSpecifications && count($item->transaksiItemSpecifications) > 0)
@foreach ($item->transaksiItemSpecifications as $spec) @if ($spec->spesifikasiProduk && $spec->spesifikasiProduk->spesifikasi)
{{ $spec->spesifikasiProduk->spesifikasi->nama_spesifikasi }} @php $hargaSatuan = 0; $totalHarga = $spec->price ?? 0; $nilai = $spec->nilai_spesifikasi ?? null; // If nilai_spesifikasi is empty, check value field if (empty($nilai) && isset($spec->value)) { $nilai = $spec->value; } if ($spec->input_type == 'select' && $spec->bahan) { // For select type (material selection) echo $spec->bahan->nama_bahan . ': ' . $item->kuantitas . ' x Rp ' . number_format($totalHarga / $item->kuantitas, 0, ',', '.') . ' = Rp ' . number_format($totalHarga, 0, ',', '.'); } elseif ($nilai && $spec->spesifikasiProduk->spesifikasi) { // For numeric type (size, etc) if ($totalHarga > 0 && $nilai > 0) { $hargaSatuan = $totalHarga / $nilai; } echo number_format($nilai, 2, ',', '.') . ' ' . ($spec->spesifikasiProduk->spesifikasi->satuan ?? '') . ' x Rp ' . number_format($hargaSatuan, 0, ',', '.') . ' = Rp ' . number_format($totalHarga, 0, ',', '.'); } else { echo 'Rp ' . number_format($totalHarga, 0, ',', '.'); } @endphp
@endif @endforeach
@endif
Total Item Rp {{ number_format($item->harga_satuan * $item->kuantitas, 0, ',', '.') }}
@if (!$loop->last)
@endif
@endforeach
Total Rp {{ number_format($transaksi->total_harga, 0, ',', '.') }}
Terbayar Rp {{ number_format($transaksi->terbayar ?? $transaksi->total_harga, 0, ',', '.') }}
Kembali Rp {{ number_format($transaksi->kembali ?? 0, 0, ',', '.') }}