Extend the shipment database schema to support additional tracking fields, state information, and financial data. This update also transitions shipment documentation from RTL/Persian to LTR/English layouts and integrates barcode generation for AWB and labels. - feat(db): add migration for missing shipment fields (state, cod_amount, declared_value, etc.) - feat(shipment): update Shipment model with new casts and helper methods - feat(ui): refactor Filament resource to use ShipmentStatus enum and add new input fields - feat(pdf): implement barcode generation using picqer/php-barcode-generator - feat(pdf): redesign AWB, Invoice, and Label templates for LTR/English support - refactor(enum): simplify ShipmentStatus enum and update labels/colors - chore(deps): add picqer/php-barcode-generator dependency
166 lines
8.6 KiB
PHP
166 lines
8.6 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en" dir="ltr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body { font-family: DejaVu Sans, sans-serif; font-size: 11px; direction: ltr; text-align: left; color: #333; }
|
|
.container { width: 190mm; min-height: 277mm; padding: 10mm; margin: 0 auto; }
|
|
|
|
.header { text-align: center; margin-bottom: 12px; border-bottom: 2px solid #f37021; padding-bottom: 8px; position: relative; }
|
|
.header h1 { color: #f37021; font-size: 24px; font-weight: bold; }
|
|
.header .meta { display: flex; justify-content: space-between; font-size: 10px; color: #666; margin-top: 5px; }
|
|
|
|
.section { border: 1px solid #ccc; padding: 8px; margin-bottom: 10px; }
|
|
.section-title { font-weight: bold; color: #f37021; margin-bottom: 6px; font-size: 12px; border-bottom: 1px solid #eee; padding-bottom: 3px; }
|
|
|
|
.two-col { display: flex; gap: 10px; margin-bottom: 10px; }
|
|
.col { flex: 1; }
|
|
|
|
.row { margin-bottom: 3px; }
|
|
.label { font-weight: bold; color: #555; display: inline-block; width: 110px; }
|
|
.value { display: inline-block; }
|
|
|
|
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
|
|
th, td { border: 1px solid #ddd; padding: 5px; text-align: left; font-size: 10px; }
|
|
th { background-color: #f5f5f5; font-weight: bold; color: #333; }
|
|
|
|
.content-box { border: 1px solid #ccc; padding: 8px; margin-bottom: 10px; }
|
|
.content-title { font-weight: bold; color: #f37021; margin-bottom: 6px; font-size: 12px; }
|
|
|
|
.info-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
|
|
.info-box { flex: 1; border: 1px solid #ccc; padding: 8px; }
|
|
|
|
.declaration { border: 1px solid #ddd; padding: 10px; margin-bottom: 10px; font-size: 10px; color: #555; text-align: center; line-height: 1.5; }
|
|
.signature-line { margin-top: 15px; display: flex; justify-content: space-between; }
|
|
.signature-box { width: 45%; border-top: 1px solid #333; padding-top: 5px; text-align: center; font-size: 10px; }
|
|
|
|
.label-section { border: 2px solid #000; padding: 10px; margin-bottom: 10px; }
|
|
.label-title { font-weight: bold; font-size: 12px; margin-bottom: 6px; }
|
|
.label-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
|
|
.barcode { text-align: center; margin-top: 8px; }
|
|
|
|
.footer { margin-top: 10px; text-align: center; font-size: 10px; color: #999; border-top: 1px solid #ddd; padding-top: 8px; }
|
|
|
|
.total-row { font-weight: bold; color: #f37021; font-size: 12px; border-top: 1px solid #ddd; padding-top: 4px; margin-top: 4px; text-align: right; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<h1>INVOICE</h1>
|
|
<div class="meta">
|
|
<span>DATE: {{ $shipment->created_at?->format('Y-m-d') }}</span>
|
|
<span>INVOICE NO: {{ $shipment->awb_no }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="two-col">
|
|
<div class="col section">
|
|
<div class="section-title">SHIPPER</div>
|
|
<div class="row"><span class="label">Name:</span><span class="value">{{ $shipper['name'] }}</span></div>
|
|
<div class="row"><span class="label">Company Name:</span><span class="value">{{ $shipper['company'] }}</span></div>
|
|
<div class="row"><span class="label">Contact Person:</span><span class="value">{{ $shipper['name'] }}</span></div>
|
|
<div class="row"><span class="label">Address:</span><span class="value">{{ $shipper['address'] }}</span></div>
|
|
<div class="row"><span class="label">Phone:</span><span class="value">{{ $shipper['phone'] }}</span></div>
|
|
<div class="row"><span class="label">Email:</span><span class="value">{{ $shipper['email'] }}</span></div>
|
|
</div>
|
|
|
|
<div class="col section">
|
|
<div class="section-title">CONSIGNEE</div>
|
|
<div class="row"><span class="label">Name:</span><span class="value">{{ $receiver['name'] }}</span></div>
|
|
<div class="row"><span class="label">Company Name:</span><span class="value">{{ $receiver['company'] }}</span></div>
|
|
<div class="row"><span class="label">Contact Person:</span><span class="value">{{ $receiver['name'] }}</span></div>
|
|
<div class="row"><span class="label">Address:</span><span class="value">{{ $receiver['address'] }}</span></div>
|
|
<div class="row"><span class="label">Zip Code & City:</span><span class="value">{{ $receiver['zip'] }} {{ $receiver['city'] }}</span></div>
|
|
<div class="row"><span class="label">Phone:</span><span class="value">{{ $receiver['phone'] }}</span></div>
|
|
<div class="row"><span class="label">Email:</span><span class="value">{{ $receiver['email'] }}</span></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content-box">
|
|
<div class="content-title">CONTENT</div>
|
|
<p>{{ $shipment->content_description ?: 'General Goods' }}</p>
|
|
</div>
|
|
|
|
@if($shipment->isParcel() && $items->count() > 0)
|
|
<div class="section">
|
|
<div class="section-title">SHIPMENT ITEMS</div>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 40px;">NO</th>
|
|
<th>DESCRIPTION</th>
|
|
<th style="width: 100px;">H.S. CODE</th>
|
|
<th style="width: 70px;">QUANTITY</th>
|
|
<th style="width: 90px;">UNIT PRICE (USD)</th>
|
|
<th style="width: 100px;">TOTAL IN USD</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($items as $item)
|
|
<tr>
|
|
<td style="text-align: center;">{{ $item->row_number }}</td>
|
|
<td>{{ $item->description }}</td>
|
|
<td style="text-align: center;">{{ $item->hs_code }}</td>
|
|
<td style="text-align: center;">{{ $item->quantity }}</td>
|
|
<td style="text-align: center;">{{ number_format($item->unit_price, 2) }}</td>
|
|
<td style="text-align: center;">{{ number_format($item->total_usd, 2) }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
<div class="total-row">
|
|
TOTAL INVOICE AMOUNT IN USD: {{ number_format($invoice_total_usd, 2) }}
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="info-row">
|
|
<div class="info-box">
|
|
<div class="row"><span class="label">WEIGHT:</span><span class="value">{{ $shipment->weight }} KG</span></div>
|
|
<div class="row"><span class="label">DIMENSION:</span><span class="value">{{ $shipment->dimensions }} CM</span></div>
|
|
</div>
|
|
<div class="info-box">
|
|
<div class="row"><span class="label">REASON FOR EXPORT:</span><span class="value">{{ $shipment->reason_for_export ?: 'N/A' }}</span></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="declaration">
|
|
I HEREBY STATE THAT THE ABOVE INFORMATION IS TRUE AND I, THE UNDERSIGNED, AM LIABLE FOR ANY CONSEQUENCES THAT MAY ARISE DUE TO NON-DISCLOSURE OF FACTS
|
|
</div>
|
|
|
|
<div class="signature-line">
|
|
<div class="signature-box">
|
|
NAME - SIGNATURE
|
|
</div>
|
|
<div class="signature-box">
|
|
NAME - SIGNATURE
|
|
</div>
|
|
</div>
|
|
|
|
<div class="label-section">
|
|
<div class="label-title">LABEL</div>
|
|
<div class="label-row">
|
|
<span><strong>AWB:</strong> {{ $shipment->awb_no }}</span>
|
|
<span><strong>Weight:</strong> {{ $shipment->weight }} KG</span>
|
|
</div>
|
|
<div class="label-row">
|
|
<span><strong>Gross Weight:</strong> {{ $shipment->weight }} KG</span>
|
|
<span><strong>Volumetric Weight:</strong> {{ $shipment->volumetric_weight }} KG</span>
|
|
</div>
|
|
<div class="label-row">
|
|
<span><strong>W*L*H:</strong> {{ $shipment->dimensions }}</span>
|
|
</div>
|
|
<div class="barcode">
|
|
{!! $barcode !!}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer">
|
|
IFNEX Logistics — We Deliver Value | Generated on {{ now()->format('Y-m-d H:i') }}
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|