diff --git a/04_Laravel/app/Enums/ShipmentStatus.php b/04_Laravel/app/Enums/ShipmentStatus.php
index a567aa9..5346924 100644
--- a/04_Laravel/app/Enums/ShipmentStatus.php
+++ b/04_Laravel/app/Enums/ShipmentStatus.php
@@ -4,78 +4,46 @@ namespace App\Enums;
enum ShipmentStatus: string
{
- // ─── وضعیتهای مشتری (قبل از پرداخت) ───
- case PendingPayment = 'pending_payment'; // در انتظار پرداخت
- case Cancelled = 'cancelled'; // لغو شده توسط مشتری
-
- // ─── وضعیتهای عملیاتی (بعد از پرداخت) ───
- case Processed = 'processed'; // پردازش شده (ادمین تأیید کرده)
- case PickedUp = 'picked_up'; // تحویل گرفته شده
- case InTransit = 'in_transit'; // در حال حمل
- case OutForDelivery = 'out_for_delivery'; // در مسیر تحویل
- case Delivered = 'delivered'; // تحویل داده شده
- case Failed = 'failed'; // ناموفق
- case Returned = 'returned'; // برگشتی
+ case PendingPayment = 'pending_payment';
+ case Cancelled = 'cancelled';
+ case Processed = 'processed';
+ case PickedUp = 'picked_up';
+ case InTransit = 'in_transit';
+ case OutForDelivery = 'out_for_delivery';
+ case Failed = 'failed';
+ case Delivered = 'delivered';
+ case Returned = 'returned';
+ case Archived = 'archived';
- /**
- * لیبل فارسی
- */
public function label(): string
{
- return match($this) {
+ return match ($this) {
self::PendingPayment => 'در انتظار پرداخت',
self::Cancelled => 'لغو شده',
- self::Processed => 'پردازش شده',
- self::PickedUp => 'تحویل گرفته شده',
- self::InTransit => 'در حال حمل',
- self::OutForDelivery => 'در مسیر تحویل',
- self::Delivered => 'تحویل داده شده',
- self::Failed => 'ناموفق',
- self::Returned => 'برگشتی',
+ self::Processed => 'Processed',
+ self::PickedUp => 'Picked Up',
+ self::InTransit => 'In Transit',
+ self::OutForDelivery => 'Out For Delivery',
+ self::Failed => 'Failed',
+ self::Delivered => 'Delivered',
+ self::Returned => 'Returned',
+ self::Archived => 'آرشیو',
};
}
- /**
- * رنگ badge در Filament
- */
public function color(): string
{
- return match($this) {
+ return match ($this) {
self::PendingPayment => 'warning',
- self::Cancelled => 'gray',
- self::Processed => 'info',
+ self::Cancelled => 'danger',
+ self::Processed => 'gray',
self::PickedUp => 'info',
self::InTransit => 'primary',
- self::OutForDelivery => 'purple',
- self::Delivered => 'success',
+ self::OutForDelivery => 'success',
self::Failed => 'danger',
+ self::Delivered => 'success',
self::Returned => 'warning',
+ self::Archived => 'gray',
};
}
-
- /**
- * آیا این وضعیت به معنای "پرداخت شده" است؟
- */
- public function isPaid(): bool
- {
- return in_array($this, [
- self::Processed,
- self::PickedUp,
- self::InTransit,
- self::OutForDelivery,
- self::Delivered,
- self::Failed,
- self::Returned,
- ]);
- }
-
- /**
- * آیا این وضعیت قابل لغو توسط مشتری است؟
- */
- public function canBeCancelledByCustomer(): bool
- {
- return in_array($this, [
- self::PendingPayment,
- ]);
- }
-}
\ No newline at end of file
+}
diff --git a/04_Laravel/app/Filament/Resources/ShipmentResource.php b/04_Laravel/app/Filament/Resources/ShipmentResource.php
index fa15419..e06e673 100644
--- a/04_Laravel/app/Filament/Resources/ShipmentResource.php
+++ b/04_Laravel/app/Filament/Resources/ShipmentResource.php
@@ -2,6 +2,7 @@
namespace App\Filament\Resources;
+use App\Enums\ShipmentStatus;
use App\Filament\Resources\ShipmentResource\Pages;
use App\Filament\Resources\ShipmentResource\RelationManagers;
use App\Models\Shipment;
@@ -44,40 +45,17 @@ class ShipmentResource extends Resource
'DOC_ECONOMY' => 'Doc Economy',
'PARCEL' => 'Parcel',
])
- ->required(),
-
+ ->required()
+ ->live(),
Forms\Components\Select::make('status')
- ->options([
- 'pending_payment' => 'در انتظار پرداخت',
- 'cancelled' => 'لغو شده',
- 'processed' => 'Processed',
- 'picked_up' => 'Picked Up',
- 'in_transit' => 'In Transit',
- 'out_for_delivery' => 'Out For Delivery',
- 'failed' => 'Failed',
- 'delivered' => 'Delivered',
- 'returned' => 'Returned',
- ])
- ->default('processed')
- ->required(),
- Forms\Components\Select::make('status')
- ->options([
- 'processed' => 'Processed',
- 'picked_up' => 'Picked Up',
- 'in_transit' => 'In Transit',
- 'out_for_delivery' => 'Out For Delivery',
- 'failed' => 'Failed',
- 'delivered' => 'Delivered',
- 'returned' => 'Returned',
- ])
+ ->options(collect(ShipmentStatus::cases())->mapWithKeys(fn ($case) => [
+ $case->value => $case->label(),
+ ]))
->default('processed')
->required(),
Forms\Components\TextInput::make('reason_for_export')
->nullable()
->label('Reason for Export'),
- Forms\Components\TextInput::make('forwarder')
- ->nullable()
- ->label('Forwarder'),
Forms\Components\Select::make('from_country_id')
->relationship('fromCountry', 'name')
->searchable()
@@ -88,6 +66,9 @@ class ShipmentResource extends Resource
->searchable()
->preload()
->label('To Country'),
+ Forms\Components\TextInput::make('forwarder')
+ ->nullable()
+ ->label('Forwarder'),
])->columns(3),
Forms\Components\Section::make('Weight & Dimensions')
@@ -110,6 +91,17 @@ class ShipmentResource extends Resource
Forms\Components\TextInput::make('dimensions')
->nullable()
->label('Dimensions (WxLxH)'),
+ Forms\Components\TextInput::make('declared_value')
+ ->numeric()
+ ->nullable()
+ ->prefix('USD')
+ ->label('Declared Value'),
+ Forms\Components\TextInput::make('content_description')
+ ->nullable()
+ ->label('Content Description'),
+ Forms\Components\TextInput::make('reason_for_export')
+ ->nullable()
+ ->label('Reason for Export'),
])->columns(4),
Forms\Components\Section::make('Financial Info')
@@ -169,6 +161,11 @@ class ShipmentResource extends Resource
->nullable()
->prefix('ریال')
->label('Net Rial'),
+ Forms\Components\TextInput::make('cod_amount')
+ ->numeric()
+ ->default(0)
+ ->prefix('AED')
+ ->label('Cash on Delivery'),
])->columns(4),
Forms\Components\Section::make('Sender Info')
@@ -193,6 +190,9 @@ class ShipmentResource extends Resource
Forms\Components\TextInput::make('sender_city')
->nullable()
->label('City'),
+ Forms\Components\TextInput::make('sender_state')
+ ->nullable()
+ ->label('State/Province'),
Forms\Components\TextInput::make('sender_zip')
->nullable()
->label('ZIP'),
@@ -223,6 +223,9 @@ class ShipmentResource extends Resource
Forms\Components\TextInput::make('receiver_city')
->nullable()
->label('City'),
+ Forms\Components\TextInput::make('receiver_state')
+ ->nullable()
+ ->label('State/Province'),
Forms\Components\TextInput::make('receiver_zip')
->nullable()
->label('ZIP'),
@@ -270,6 +273,10 @@ class ShipmentResource extends Resource
->reorderable()
->label('Items'),
]),
+
+ Forms\Components\Section::make('Customer Notes')->schema([
+ Forms\Components\Textarea::make('customer_notes')->nullable()->rows(3)->label('Customer Notes'),
+ ]),
]);
}
@@ -294,6 +301,8 @@ class ShipmentResource extends Resource
->label('Type'),
Tables\Columns\TextColumn::make('status')
->badge()
+ ->color(fn (ShipmentStatus $state): string => $state->color())
+ ->formatStateUsing(fn (ShipmentStatus $state): string => $state->label())
->searchable()
->label('Status'),
Tables\Columns\TextColumn::make('sender_name')
@@ -315,17 +324,9 @@ class ShipmentResource extends Resource
])
->filters([
Tables\Filters\SelectFilter::make('status')
- ->options([
- 'pending_payment' => 'در انتظار پرداخت',
- 'cancelled' => 'لغو شده',
- 'processed' => 'Processed',
- 'picked_up' => 'Picked Up',
- 'in_transit' => 'In Transit',
- 'out_for_delivery' => 'Out For Delivery',
- 'failed' => 'Failed',
- 'delivered' => 'Delivered',
- 'returned' => 'Returned',
- ]),
+ ->options(collect(ShipmentStatus::cases())->mapWithKeys(fn ($case) => [
+ $case->value => $case->label(),
+ ])),
Tables\Filters\SelectFilter::make('type')
->options([
'DOC_NORMAL' => 'Doc Normal',
diff --git a/04_Laravel/app/Models/Shipment.php b/04_Laravel/app/Models/Shipment.php
index c5ad089..ee5fd09 100644
--- a/04_Laravel/app/Models/Shipment.php
+++ b/04_Laravel/app/Models/Shipment.php
@@ -15,9 +15,10 @@ class Shipment extends Model
'warehousing_cost', 'vat_amount', 'discount', 'total_fee', 'net_dirham', 'net_rial',
'from_country_id', 'to_country_id',
'sender_name', 'sender_company', 'sender_phone', 'sender_email',
- 'sender_address', 'sender_city', 'sender_zip', 'sender_id_number',
+ 'sender_address', 'sender_city', 'sender_state', 'sender_zip', 'sender_id_number',
'receiver_name', 'receiver_company', 'receiver_phone', 'receiver_email',
- 'receiver_address', 'receiver_city', 'receiver_zip', 'receiver_id_number',
+ 'receiver_address', 'receiver_city', 'receiver_state', 'receiver_zip', 'receiver_id_number',
+ 'customer_notes', 'cod_amount', 'declared_value', 'content_description',
];
protected function casts(): array
@@ -26,6 +27,22 @@ class Shipment extends Model
'direction' => \App\Enums\ShipmentDirection::class,
'type' => \App\Enums\ShipmentType::class,
'status' => \App\Enums\ShipmentStatus::class,
+ 'weight' => 'decimal:2',
+ 'volumetric_weight' => 'decimal:2',
+ 'chargeable_weight' => 'decimal:2',
+ 'shipping_price' => 'decimal:2',
+ 'extra_service' => 'decimal:2',
+ 'packing_cost' => 'decimal:2',
+ 'domestic_pickup' => 'decimal:2',
+ 'domestic_delivery' => 'decimal:2',
+ 'warehousing_cost' => 'decimal:2',
+ 'vat_amount' => 'decimal:2',
+ 'discount' => 'decimal:2',
+ 'total_fee' => 'decimal:2',
+ 'net_dirham' => 'decimal:2',
+ 'net_rial' => 'decimal:2',
+ 'cod_amount' => 'decimal:2',
+ 'declared_value' => 'decimal:2',
];
}
@@ -58,4 +75,19 @@ class Shipment extends Model
{
return $this->hasMany(ShipmentTrackingEvent::class);
}
+
+ public function isParcel(): bool
+ {
+ return $this->type === \App\Enums\ShipmentType::Parcel;
+ }
+
+ public function isDocument(): bool
+ {
+ return $this->type !== \App\Enums\ShipmentType::Parcel;
+ }
+
+ public function getInvoiceTotalUsdAttribute(): float
+ {
+ return $this->items->sum('total_usd');
+ }
}
diff --git a/04_Laravel/app/Services/PdfService.php b/04_Laravel/app/Services/PdfService.php
index b42633b..533f680 100644
--- a/04_Laravel/app/Services/PdfService.php
+++ b/04_Laravel/app/Services/PdfService.php
@@ -3,10 +3,10 @@
namespace App\Services;
use App\Models\Shipment;
-use App\Models\ShipmentItem;
use Dompdf\Dompdf;
use Dompdf\Options;
use Illuminate\Support\Collection;
+use Picqer\Barcode\BarcodeGeneratorHTML;
class PdfService
{
@@ -19,12 +19,10 @@ class PdfService
'shipper' => $this->formatAddress($shipment, 'sender'),
'receiver' => $this->formatAddress($shipment, 'receiver'),
'items' => $shipment->items ?? collect(),
- 'invoice_total_usd' => optional($shipment->items)->sum('total_usd') ?? 0,
+ 'barcode' => $this->generateBarcode($shipment->awb_no),
];
- $html = view('pdfs.awb', $data)->render();
-
- return $this->generatePdf($html, 'A4', 'portrait');
+ return $this->generatePdf(view('pdfs.awb', $data)->render(), 'A4', 'portrait');
}
public function invoice(Shipment $shipment): string
@@ -35,13 +33,12 @@ class PdfService
'shipment' => $shipment,
'shipper' => $this->formatAddress($shipment, 'sender'),
'receiver' => $this->formatAddress($shipment, 'receiver'),
- 'items' => $shipment->items ?? collect(),
- 'invoice_total_usd' => optional($shipment->items)->sum('total_usd') ?? 0,
+ 'items' => $shipment->isParcel() ? ($shipment->items ?? collect()) : collect(),
+ 'invoice_total_usd' => $shipment->invoice_total_usd,
+ 'barcode' => $this->generateBarcode($shipment->awb_no),
];
- $html = view('pdfs.invoice', $data)->render();
-
- return $this->generatePdf($html, 'A4', 'portrait');
+ return $this->generatePdf(view('pdfs.invoice', $data)->render(), 'A4', 'portrait');
}
public function label(Shipment $shipment): string
@@ -52,14 +49,13 @@ class PdfService
'shipment' => $shipment,
'shipper' => $this->formatAddress($shipment, 'sender'),
'receiver' => $this->formatAddress($shipment, 'receiver'),
+ 'barcode' => $this->generateBarcode($shipment->awb_no),
];
- $html = view('pdfs.label', $data)->render();
-
- return $this->generatePdf($html, 'A4', 'portrait');
+ return $this->generatePdf(view('pdfs.label', $data)->render(), 'A4', 'portrait');
}
- private function generatePdf(string $html, array|string $paper, string $orientation): string
+ private function generatePdf(string $html, string $paper, string $orientation): string
{
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
@@ -68,13 +64,7 @@ class PdfService
$dompdf = new Dompdf($options);
$dompdf->loadHtml($html);
-
- if (is_array($paper)) {
- $dompdf->setPaper($paper, $orientation);
- } else {
- $dompdf->setPaper($paper, $orientation);
- }
-
+ $dompdf->setPaper($paper, $orientation);
$dompdf->render();
return $dompdf->output();
@@ -83,14 +73,25 @@ class PdfService
private function formatAddress(Shipment $shipment, string $prefix): Collection
{
return collect([
- 'name' => $shipment->{$prefix . '_name'},
- 'company' => $shipment->{$prefix . '_company'},
- 'phone' => $shipment->{$prefix . '_phone'},
- 'email' => $shipment->{$prefix . '_email'},
- 'address' => $shipment->{$prefix . '_address'},
- 'city' => $shipment->{$prefix . '_city'},
- 'zip' => $shipment->{$prefix . '_zip'},
- 'id_number' => $shipment->{$prefix . '_id_number'},
+ 'name' => $shipment->{"{$prefix}_name"},
+ 'company' => $shipment->{"{$prefix}_company"},
+ 'phone' => $shipment->{"{$prefix}_phone"},
+ 'email' => $shipment->{"{$prefix}_email"},
+ 'address' => $shipment->{"{$prefix}_address"},
+ 'city' => $shipment->{"{$prefix}_city"},
+ 'state' => $shipment->{"{$prefix}_state"},
+ 'zip' => $shipment->{"{$prefix}_zip"},
+ 'id_number' => $shipment->{"{$prefix}_id_number"},
]);
}
+
+ private function generateBarcode(string $code): string
+ {
+ try {
+ $generator = new BarcodeGeneratorHTML();
+ return $generator->getBarcode($code, $generator::TYPE_CODE_128, 2, 60);
+ } catch (\Throwable $e) {
+ return '
Barcode unavailable
';
+ }
+ }
}
diff --git a/04_Laravel/composer.json b/04_Laravel/composer.json
index 5c7f4ca..bae38c1 100644
--- a/04_Laravel/composer.json
+++ b/04_Laravel/composer.json
@@ -14,6 +14,7 @@
"laravel/tinker": "^2.10.1",
"maatwebsite/excel": "^3.1",
"morilog/jalali": "^3.0",
+ "picqer/php-barcode-generator": "^3.3",
"spatie/laravel-permission": "^6.25"
},
"require-dev": {
diff --git a/04_Laravel/composer.lock b/04_Laravel/composer.lock
index ffa59bb..0963828 100644
--- a/04_Laravel/composer.lock
+++ b/04_Laravel/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "b8dff8147ac7f29e9282deaf74979683",
+ "content-hash": "a22b2cc91f8cab3cca421c6ab381c544",
"packages": [
{
"name": "anourvalar/eloquent-serialize",
@@ -4914,6 +4914,86 @@
],
"time": "2025-12-27T19:41:33+00:00"
},
+ {
+ "name": "picqer/php-barcode-generator",
+ "version": "v3.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/picqer/php-barcode-generator.git",
+ "reference": "6beada2a30623832ff41b8c7d307c169736b8552"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/picqer/php-barcode-generator/zipball/6beada2a30623832ff41b8c7d307c169736b8552",
+ "reference": "6beada2a30623832ff41b8c7d307c169736b8552",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^8.2"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.10",
+ "phpunit/phpunit": "^9.5"
+ },
+ "suggest": {
+ "ext-bcmath": "Barcode IMB (Intelligent Mail Barcode) needs bcmath extension",
+ "ext-gd": "For JPG and PNG generators, GD or Imagick is required",
+ "ext-imagick": "For JPG and PNG generators, GD or Imagick is required"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Picqer\\Barcode\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Casper Bakker",
+ "email": "info@picqer.com",
+ "homepage": "https://picqer.com"
+ },
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "homepage": "http://nicolaasuni.tecnick.com"
+ }
+ ],
+ "description": "An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.",
+ "homepage": "https://github.com/picqer/php-barcode-generator",
+ "keywords": [
+ "CODABAR",
+ "Code11",
+ "Code93",
+ "EAN13",
+ "KIX",
+ "KIXCODE",
+ "MSI",
+ "POSTNET",
+ "Pharma",
+ "Standard 2 of 5",
+ "barcode",
+ "barcode generator",
+ "code128",
+ "code39",
+ "ean",
+ "html",
+ "jpeg",
+ "jpg",
+ "php",
+ "png",
+ "svg",
+ "upc"
+ ],
+ "support": {
+ "issues": "https://github.com/picqer/php-barcode-generator/issues",
+ "source": "https://github.com/picqer/php-barcode-generator/tree/v3.3.0"
+ },
+ "time": "2026-08-22T09:50:32+00:00"
+ },
{
"name": "psr/cache",
"version": "3.0.0",
diff --git a/04_Laravel/database/migrations/2026_08_24_000001_add_missing_fields_to_shipments_table.php b/04_Laravel/database/migrations/2026_08_24_000001_add_missing_fields_to_shipments_table.php
new file mode 100644
index 0000000..bb8e5f0
--- /dev/null
+++ b/04_Laravel/database/migrations/2026_08_24_000001_add_missing_fields_to_shipments_table.php
@@ -0,0 +1,70 @@
+string('sender_state')->nullable()->after('sender_city');
+ $table->string('receiver_state')->nullable()->after('receiver_city');
+
+ // یادداشت مشتری
+ $table->text('customer_notes')->nullable()->after('receiver_id_number');
+
+ // Cash on Delivery (AED) — از اکسل مرجع: ستون AP = COD
+ $table->decimal('cod_amount', 12, 2)->default(0)->unsigned()->after('net_rial');
+
+ // ارزش اظهار شده (USD) — از اکسل مرجع: ستون K = Value
+ $table->decimal('declared_value', 12, 2)->nullable()->unsigned()->after('dimensions');
+
+ // توضیحات محموله — از اکسل مرجع: ستون L = Content
+ $table->string('content_description')->nullable()->after('declared_value');
+ });
+
+ // بهروزرسانی enum status برای افزودن مقادیر جدید
+ DB::statement("ALTER TABLE shipments MODIFY COLUMN status ENUM(
+ 'pending_payment',
+ 'cancelled',
+ 'processed',
+ 'picked_up',
+ 'in_transit',
+ 'out_for_delivery',
+ 'failed',
+ 'delivered',
+ 'returned',
+ 'archived'
+ ) DEFAULT 'processed'");
+ }
+
+ public function down(): void
+ {
+ Schema::table('shipments', function (Blueprint $table) {
+ $table->dropColumn([
+ 'sender_state',
+ 'receiver_state',
+ 'customer_notes',
+ 'cod_amount',
+ 'declared_value',
+ 'content_description',
+ ]);
+ });
+
+ DB::statement("ALTER TABLE shipments MODIFY COLUMN status ENUM(
+ 'pending_payment',
+ 'cancelled',
+ 'processed',
+ 'picked_up',
+ 'in_transit',
+ 'out_for_delivery',
+ 'failed',
+ 'delivered',
+ 'returned'
+ ) DEFAULT 'pending_payment'");
+ }
+};
\ No newline at end of file
diff --git a/04_Laravel/resources/views/pdfs/awb.blade.php b/04_Laravel/resources/views/pdfs/awb.blade.php
index 10ad453..45201ad 100644
--- a/04_Laravel/resources/views/pdfs/awb.blade.php
+++ b/04_Laravel/resources/views/pdfs/awb.blade.php
@@ -1,69 +1,43 @@
-
-
+
@@ -72,73 +46,112 @@
Shipment Waybill
-
AWB No: {{ $shipment->awb_no }}
+
We Deliver Value
+ AWB No: {{ $shipment->awb_no }}
-
-
-
SHIPPER
-
Name:{{ $shipper['name'] }}
-
Company:{{ $shipper['company'] }}
-
Phone:{{ $shipper['phone'] }}
-
Email:{{ $shipper['email'] }}
-
Address:{{ $shipper['address'] }}
-
City:{{ $shipper['city'] }}
-
Zip:{{ $shipper['zip'] }}
-
ID:{{ $shipper['id_number'] }}
-
+
+
+
+
+ SHIPPER
+ From:{{ $shipment->fromCountry?->name }}
+ Company Name:{{ $shipper['company'] }}
+ Contact Name:{{ $shipper['name'] }}
+ Tel/Mob:{{ $shipper['phone'] }}
+ Email:{{ $shipper['email'] }}
+ Address:{{ $shipper['address'] }}
+ ID Number:{{ $shipper['id_number'] }}
+ Zip Code:{{ $shipper['zip'] }}
+
+ |
+
+
+ RECEIVER
+ To:{{ $shipment->toCountry?->name }}
+ Company Name:{{ $receiver['company'] }}
+ Contact Name:{{ $receiver['name'] }}
+ Tel/Mobile:{{ $receiver['phone'] }}
+ Email:{{ $receiver['email'] }}
+ Address:{{ $receiver['address'] }}
+ City:{{ $receiver['city'] }}
+ Zip Code:{{ $receiver['zip'] }}
+
+ |
+
+
-
-
RECEIVER
-
Name:{{ $receiver['name'] }}
-
Company:{{ $receiver['company'] }}
-
Phone:{{ $receiver['phone'] }}
-
Email:{{ $receiver['email'] }}
-
Address:{{ $receiver['address'] }}
-
City:{{ $receiver['city'] }}
-
Zip:{{ $receiver['zip'] }}
-
ID:{{ $receiver['id_number'] }}
-
-
+
+
+
+
+ SHIPMENT
+ Gross Weight:{{ $shipment->weight }} Kg
+ Dimensions:{{ $shipment->dimensions }} cm
+ Volumetric Weight:{{ $shipment->volumetric_weight }} Kg
+ Chargeable Weight:{{ $shipment->chargeable_weight }} Kg
+ Value:${{ number_format($shipment->declared_value ?? 0, 2) }} USD
+ Service:{{ $shipment->type?->label() }}
+ Type:{{ $shipment->direction?->value === 'export' ? 'Export' : 'Import' }}
+ Content:{{ $shipment->content_description ?: 'General Goods' }}
-
- SHIPMENT
-
-
- Gross Weight:{{ $shipment->weight }} kg
- Volumetric Weight:{{ $shipment->volumetric_weight }} kg
- Chargeable Weight:{{ $shipment->chargeable_weight }} kg
- Dimensions:{{ $shipment->dimensions }}
- Service:{{ $shipment->type?->label() }}
- Direction:{{ $shipment->direction?->label() }}
-
-
- From:{{ $shipment->fromCountry?->name }}
- To:{{ $shipment->toCountry?->name }}
- Forwarder:{{ $shipment->forwarder }}
- Content:{{ $shipment->reason_for_export ?: 'General Goods' }}
-
-
-
+ @if($shipment->isParcel() && $items->count() > 0)
+
+ Shipment Details
+
+
+
+ | Row |
+ Description |
+ HS Code |
+ Qty |
+ Unit Price (USD) |
+ Total (USD) |
+
+
+
+ @foreach($items as $item)
+
+ | {{ $item->row_number }} |
+ {{ $item->description }} |
+ {{ $item->hs_code }} |
+ {{ $item->quantity }} |
+ {{ number_format($item->unit_price, 2) }} |
+ {{ number_format($item->total_usd, 2) }} |
+
+ @endforeach
+
+
+
+ @endif
+
+ |
+
+
+ PAYMENT
+ Shipping Price:{{ number_format($shipment->shipping_price ?? 0, 2) }} IRR
+ Extra Service:{{ number_format($shipment->extra_service ?? 0) }} IRR
+ Domestic Pickup:{{ number_format($shipment->domestic_pickup ?? 0) }} IRR
+ Packing Cost:{{ number_format($shipment->packing_cost ?? 0) }} IRR
+ Domestic Delivery:{{ number_format($shipment->domestic_delivery ?? 0) }} IRR
+ Warehousing Cost:{{ number_format($shipment->warehousing_cost ?? 0) }} IRR
+ Discount:{{ number_format($shipment->discount ?? 0) }} IRR
+ Total Fee:{{ number_format($shipment->total_fee ?? 0) }} IRR
+ Cash on Delivery:{{ number_format($shipment->cod_amount ?? 0, 2) }} AED
+
+ |
+
+
-
-
PAYMENT
-
Shipping Price (AED):{{ number_format($shipment->shipping_price ?? 0, 2) }}
-
Extra Service (IRR):{{ number_format($shipment->extra_service ?? 0) }}
-
Packing Cost (IRR):{{ number_format($shipment->packing_cost ?? 0) }}
-
Domestic Pickup (IRR):{{ number_format($shipment->domestic_pickup ?? 0) }}
-
Domestic Delivery (IRR):{{ number_format($shipment->domestic_delivery ?? 0) }}
-
Warehousing (IRR):{{ number_format($shipment->warehousing_cost ?? 0) }}
-
Discount (IRR):{{ number_format($shipment->discount ?? 0) }}
-
Total Fee (IRR):{{ number_format($shipment->total_fee ?? 0) }}
-
Net Dirham (AED):{{ number_format($shipment->net_dirham ?? 0, 2) }}
+
+ Please note that: Door-to-door Services is only applicable when the shipment is general cargo. For special cargo, dangerous goods, or items requiring special handling, additional charges may apply. The receiver is responsible for customs clearance and any associated fees. Claims must be filed within 30 days of delivery. Shipper declares that the contents are accurately described and properly packed for transport.
Shipper Name & Signature
- Date: {{ now()->format('Y-m-d') }}
+ Date: ....../....../........
Track Your Shipment at:
diff --git a/04_Laravel/resources/views/pdfs/invoice.blade.php b/04_Laravel/resources/views/pdfs/invoice.blade.php
index ebd52dc..b35f00e 100644
--- a/04_Laravel/resources/views/pdfs/invoice.blade.php
+++ b/04_Laravel/resources/views/pdfs/invoice.blade.php
@@ -1,157 +1,164 @@
-
-
+
-
SHIPPER / فرستنده
+
SHIPPER
Name:{{ $shipper['name'] }}
-
Company:{{ $shipper['company'] }}
-
Contact:{{ $shipper['phone'] }}
+
Company Name:{{ $shipper['company'] }}
+
Contact Person:{{ $shipper['name'] }}
Address:{{ $shipper['address'] }}
-
City/Zip:{{ $shipper['city'] }} {{ $shipper['zip'] }}
+
Phone:{{ $shipper['phone'] }}
Email:{{ $shipper['email'] }}
-
CONSIGNEE / گیرنده
+
CONSIGNEE
Name:{{ $receiver['name'] }}
-
Company:{{ $receiver['company'] }}
-
Contact:{{ $receiver['phone'] }}
+
Company Name:{{ $receiver['company'] }}
+
Contact Person:{{ $receiver['name'] }}
Address:{{ $receiver['address'] }}
-
City/Zip:{{ $receiver['city'] }} {{ $receiver['zip'] }}
+
Zip Code & City:{{ $receiver['zip'] }} {{ $receiver['city'] }}
+
Phone:{{ $receiver['phone'] }}
Email:{{ $receiver['email'] }}
-
-
SHIPMENT DETAILS
-
-
-
Weight:{{ $shipment->weight }} kg
-
Volumetric:{{ $shipment->volumetric_weight }} kg
-
Dimensions:{{ $shipment->dimensions }}
-
Service:{{ $shipment->type?->label() }}
-
Direction:{{ $shipment->direction?->label() }}
-
-
-
From:{{ $shipment->fromCountry?->name }}
-
To:{{ $shipment->toCountry?->name }}
-
Forwarder:{{ $shipment->forwarder }}
-
Reason:{{ $shipment->reason_for_export ?: 'N/A' }}
-
-
+
+
CONTENT
+
{{ $shipment->content_description ?: 'General Goods' }}
+ @if($shipment->isParcel() && $items->count() > 0)
-
CONTENT / محموله
-
{{ $shipment->reason_for_export ?: 'General Goods' }}
+
SHIPMENT ITEMS
- | No |
- Description |
- H.S. Code |
- Qty |
- Unit Price (USD) |
- Total (USD) |
+ NO |
+ DESCRIPTION |
+ H.S. CODE |
+ QUANTITY |
+ UNIT PRICE (USD) |
+ TOTAL IN USD |
- @forelse($items as $item)
-
- | {{ $item->row_number }} |
- {{ $item->description }} |
- {{ $item->hs_code }} |
- {{ $item->quantity }} |
- {{ number_format($item->unit_price, 2) }} |
- {{ number_format($item->total_usd, 2) }} |
-
- @empty
- | No items |
- @endforelse
+ @foreach($items as $item)
+
+ | {{ $item->row_number }} |
+ {{ $item->description }} |
+ {{ $item->hs_code }} |
+ {{ $item->quantity }} |
+ {{ number_format($item->unit_price, 2) }} |
+ {{ number_format($item->total_usd, 2) }} |
+
+ @endforeach
-
-
TOTAL INVOICE AMOUNT IN USD: {{ number_format($invoice_total_usd, 2) }}
+
+ TOTAL INVOICE AMOUNT IN USD: {{ number_format($invoice_total_usd, 2) }}
+
+
+ @endif
+
+
+
+
WEIGHT:{{ $shipment->weight }} KG
+
DIMENSION:{{ $shipment->dimensions }} CM
+
+
+
REASON FOR EXPORT:{{ $shipment->reason_for_export ?: 'N/A' }}
- I HEREBY STATE THAT THE ABOVE INFORMATION IS TRUE AND CORRECT TO THE BEST OF MY KNOWLEDGE.
+ 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
+
+
+
+
+ NAME - SIGNATURE
+
+
+ NAME - SIGNATURE
+
+
+
+
+
LABEL
+
+ AWB: {{ $shipment->awb_no }}
+ Weight: {{ $shipment->weight }} KG
+
+
+ Gross Weight: {{ $shipment->weight }} KG
+ Volumetric Weight: {{ $shipment->volumetric_weight }} KG
+
+
+ W*L*H: {{ $shipment->dimensions }}
+
+
+ {!! $barcode !!}
+
diff --git a/04_Laravel/resources/views/pdfs/label.blade.php b/04_Laravel/resources/views/pdfs/label.blade.php
index 44bdb98..fd14cda 100644
--- a/04_Laravel/resources/views/pdfs/label.blade.php
+++ b/04_Laravel/resources/views/pdfs/label.blade.php
@@ -1,75 +1,49 @@
-
-
+
@@ -77,22 +51,27 @@
+
+
+ {{ $shipment->awb_no }}
+
+
+
+ {!! $barcode !!}
-
SHIPPER / فرستنده
+
SHIPPER
Name:{{ $shipper['name'] }}
Company:{{ $shipper['company'] }}
Phone:{{ $shipper['phone'] }}
Address:{{ $shipper['address'] }}
-
RECEIVER / گیرنده
+
RECEIVER
Name:{{ $receiver['name'] }}
Company:{{ $receiver['company'] }}
Phone:{{ $receiver['phone'] }}
@@ -104,9 +83,9 @@
SHIPMENT DETAILS
-
Gross Weight:{{ $shipment->weight }} kg
-
Volumetric:{{ $shipment->volumetric_weight }} kg
-
Dimensions:{{ $shipment->dimensions }}
+
Gross Weight:{{ $shipment->weight }} KG
+
Volumetric Weight:{{ $shipment->volumetric_weight }} KG
+
Dimensions:{{ $shipment->dimensions }} CM
From:{{ $shipment->fromCountry?->name }}
@@ -117,7 +96,7 @@