+
+
SHIPPER
Name:{{ $shipper['name'] }}
Company:{{ $shipper['company'] }}
Phone:{{ $shipper['phone'] }}
@@ -48,8 +61,8 @@
ID:{{ $shipper['id_number'] }}
-
-
RECEIVER / گیرنده
+
+
RECEIVER
Name:{{ $receiver['name'] }}
Company:{{ $receiver['company'] }}
Phone:{{ $receiver['phone'] }}
@@ -61,10 +74,10 @@
-
-
SHIPMENT DETAILS
-
-
+
+
SHIPMENT
+
+
Gross Weight:{{ $shipment->weight }} kg
Volumetric Weight:{{ $shipment->volumetric_weight }} kg
Chargeable Weight:{{ $shipment->chargeable_weight }} kg
@@ -72,7 +85,7 @@
Service:{{ $shipment->type?->label() }}
Direction:{{ $shipment->direction?->label() }}
-
+
From:{{ $shipment->fromCountry?->name }}
To:{{ $shipment->toCountry?->name }}
Forwarder:{{ $shipment->forwarder }}
@@ -81,8 +94,8 @@
-
-
PAYMENT / پرداخت
+
+
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) }}
@@ -90,8 +103,8 @@
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) }}
+
Total Fee (IRR):{{ number_format($shipment->total_fee ?? 0) }}
+
Net Dirham (AED):{{ number_format($shipment->net_dirham ?? 0, 2) }}
diff --git a/04_Laravel/resources/views/pdfs/label.blade.php b/04_Laravel/resources/views/pdfs/label.blade.php index 588210a..b9a29ec 100644 --- a/04_Laravel/resources/views/pdfs/label.blade.php +++ b/04_Laravel/resources/views/pdfs/label.blade.php @@ -4,53 +4,85 @@ -
-
- -
{{ $shipment->awb_no }}
-
+
+
+
+ +
+
IFNEX LOGISTICS
+
{{ $shipment->awb_no }}
+
+
-
-
SHIPPER / فرستنده
-
Name:{{ $shipper['name'] }}
-
Company:{{ $shipper['company'] }}
-
Phone:{{ $shipper['phone'] }}
-
Address:{{ $shipper['address'] }}
-
+
+
+
SHIPPER / فرستنده
+
Name:{{ $shipper['name'] }}
+
Company:{{ $shipper['company'] }}
+
Phone:{{ $shipper['phone'] }}
+
Address:{{ $shipper['address'] }}
+
+
+
RECEIVER / گیرنده
+
Name:{{ $receiver['name'] }}
+
Company:{{ $receiver['company'] }}
+
Phone:{{ $receiver['phone'] }}
+
Address:{{ $receiver['address'] }}
+
+
-
-
RECEIVER / گیرنده
-
Name:{{ $receiver['name'] }}
-
Company:{{ $receiver['company'] }}
-
Phone:{{ $receiver['phone'] }}
-
Address:{{ $receiver['address'] }}
-
+
+
SHIPMENT DETAILS
+
+
+
Gross Weight:{{ $shipment->weight }} kg
+
Volumetric:{{ $shipment->volumetric_weight }} kg
+
Dimensions:{{ $shipment->dimensions }}
+
+
+
From:{{ $shipment->fromCountry?->name }}
+
To:{{ $shipment->toCountry?->name }}
+
Service:{{ $shipment->type?->label() }}
+
+
+
-
-
SHIPMENT
-
Gross Weight:{{ $shipment->weight }} kg
-
Volumetric:{{ $shipment->volumetric_weight }} kg
-
Dimensions:{{ $shipment->dimensions }}
-
From:{{ $shipment->fromCountry?->name }}
-
To:{{ $shipment->toCountry?->name }}
-
- -
diff --git a/04_Laravel/resources/views/pricing/index.blade.php b/04_Laravel/resources/views/pricing/index.blade.php new file mode 100644 index 0000000..3a0fe5d --- /dev/null +++ b/04_Laravel/resources/views/pricing/index.blade.php @@ -0,0 +1,142 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

استعلام قیمت

+

قیمت تقریبی حمل مرسوله خود را محاسبه کنید

+
+ +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+
+ + +
+
+@endsection + +@push('scripts') + +@endpush diff --git a/04_Laravel/routes/web.php b/04_Laravel/routes/web.php index 99db712..c6740cb 100644 --- a/04_Laravel/routes/web.php +++ b/04_Laravel/routes/web.php @@ -1,6 +1,7 @@ name('pricing.index'); + Route::get('/order', [OrderController::class, 'create'])->name('orders.create'); Route::post('/order', [OrderController::class, 'store'])->name('orders.store'); Route::get('/order/success/{shipment}', [OrderController::class, 'success'])->name('orders.success'); diff --git a/04_Laravel/test_pricing3.php b/04_Laravel/test_pricing3.php deleted file mode 100644 index 1ff318e..0000000 --- a/04_Laravel/test_pricing3.php +++ /dev/null @@ -1,93 +0,0 @@ -make(Illuminate\Contracts\Console\Kernel::class); -$kernel->bootstrap(); - -$service = new App\Services\PriceCalculatorService(); - -$testCases = [ - [ - 'name' => 'DOC_NORMAL Export to DE 1kg', - 'data' => [ - 'type' => 'DOC_NORMAL', - 'direction' => 'Outbound', - 'country_iso' => 'DE', - 'weight' => 1, - 'volumetric_weight' => 1, - 'extra_service' => 0, - 'packing_cost' => 100000, - 'domestic_pickup' => 0, - 'domestic_delivery' => 0, - 'warehousing_cost' => 0, - 'discount' => 0, - ], - ], - [ - 'name' => 'PARCEL Export to AE 1kg', - 'data' => [ - 'type' => 'PARCEL', - 'direction' => 'Outbound', - 'country_iso' => 'AE', - 'weight' => 1, - 'volumetric_weight' => 1, - 'extra_service' => 0, - 'packing_cost' => 100000, - 'domestic_pickup' => 0, - 'domestic_delivery' => 0, - 'warehousing_cost' => 0, - 'discount' => 0, - ], - ], - [ - 'name' => 'PARCEL Import from US 5kg', - 'data' => [ - 'type' => 'PARCEL', - 'direction' => 'Inbound', - 'country_iso' => 'US', - 'weight' => 5, - 'volumetric_weight' => 5, - 'extra_service' => 50000, - 'packing_cost' => 150000, - 'domestic_pickup' => 20000, - 'domestic_delivery' => 30000, - 'warehousing_cost' => 50000, - 'discount' => 10000, - ], - ], - [ - 'name' => 'DOC_ECONOMY Export to US 2kg', - 'data' => [ - 'type' => 'DOC_ECONOMY', - 'direction' => 'Outbound', - 'country_iso' => 'US', - 'weight' => 2, - 'volumetric_weight' => 2, - 'extra_service' => 0, - 'packing_cost' => 80000, - 'domestic_pickup' => 15000, - 'domestic_delivery' => 25000, - 'warehousing_cost' => 0, - 'discount' => 0, - ], - ], -]; - -foreach ($testCases as $case) { - echo "=== {$case['name']} ===" . PHP_EOL; - try { - $result = $service->calculate($case['data']); - echo "Base Price (AED): " . $result['base_price'] . PHP_EOL; - echo "Net Dirham: " . $result['net_dirham'] . PHP_EOL; - echo "Net Rial: " . number_format($result['net_rial'], 0) . PHP_EOL; - echo "Extra Service: " . number_format($result['extra_service'], 0) . PHP_EOL; - echo "Packing Cost: " . number_format($result['packing_cost'], 0) . PHP_EOL; - echo "VAT Amount: " . number_format($result['vat_amount'], 0) . PHP_EOL; - echo "Total Fee: " . number_format($result['total_fee'], 0) . PHP_EOL; - echo "Zone: " . $result['zone'] . PHP_EOL; - echo "Chargeable Weight: " . $result['chargeable_weight'] . PHP_EOL; - } catch (Exception $e) { - echo "ERROR: " . $e->getMessage() . PHP_EOL; - } - echo PHP_EOL; -}