Files
sembara/resources/views/pdf/delivery-note.blade.php
T

84 lines
3.2 KiB
PHP

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="utf-8">
<title>{{ $order['note_number'] }}</title>
<style>
body { font-family: DejaVu Sans, sans-serif; font-size: 11px; color: #111; }
h1 { font-size: 16px; margin: 0; }
.muted { color: #555; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
th { background: #eee; }
.right { text-align: right; }
.signatures { width: 100%; margin-top: 28px; }
.signatures td { text-align: center; border: none; }
.line { display: inline-block; width: 140px; border-bottom: 1px solid #000; height: 12px; }
</style>
</head>
<body>
<table style="border:none;">
<tr>
<td style="border:none;">
<h1>SURAT JALAN</h1>
<div class="muted">Sembara — Distribusi Beras & Sembako</div>
</td>
<td class="right" style="border:none;">
<strong>No. {{ $order['note_number'] }}</strong><br>
Tgl Order: {{ \Carbon\Carbon::parse($order['order_date'])->translatedFormat('d M Y') }}<br>
@if (!empty($order['delivery_date']))
Tgl Kirim: {{ \Carbon\Carbon::parse($order['delivery_date'])->translatedFormat('d M Y') }}
@endif
</td>
</tr>
</table>
<table style="margin-top:8px;">
<tr>
<th>Pelanggan</th>
<td>{{ $order['customers']['name'] ?? '-' }}{{ isset($order['customers']['address']) ? ' — ' . $order['customers']['address'] : '' }}</td>
<th>Pengemudi</th>
<td>{{ $order['drivers']['name'] ?? '-' }}</td>
</tr>
</table>
<table>
<thead>
<tr>
<th style="width:30px;">No</th>
<th>Produk</th>
<th class="right" style="width:60px;">Qty</th>
<th class="right" style="width:90px;">Harga</th>
<th class="right" style="width:110px;">Subtotal</th>
</tr>
</thead>
<tbody>
@foreach ($order['order_items'] ?? [] as $i => $item)
<tr>
<td>{{ $i + 1 }}</td>
<td>{{ data_get($item, 'products.name', '-') }}</td>
<td class="right">{{ $item['quantity'] }}</td>
<td class="right">Rp {{ number_format((int) $item['unit_price'], 0, ',', '.') }}</td>
<td class="right">Rp {{ number_format((int) $item['subtotal'], 0, ',', '.') }}</td>
</tr>
@endforeach
<tr>
<td colspan="4" class="right"><strong>Total</strong></td>
<td class="right"><strong>Rp {{ number_format($total, 0, ',', '.') }}</strong></td>
</tr>
</tbody>
</table>
@if (!empty($order['notes']))
<p><em>Catatan: {{ $order['notes'] }}</em></p>
@endif
<table class="signatures">
<tr>
<td>Penerima<br><span class="line"></span></td>
<td>Pengantar<br><span class="line"></span></td>
</tr>
</table>
</body>
</html>