ifnex/04_Laravel/app/Filament/Resources/views/rate-import.blade.php
Kazem Alghasi 513e8d8e7e feat(api): implement 4-quadrant rate import and pricing model
Implement a new pricing architecture based on a 4-quadrant model (Export/Import
x Document/Non-Document) to replace the previous 2-zone model. This includes
the ability to handle different zones for parcels and documents per country.

- Add `RateEntry` and `CountryZone` models for managing complex rate matrices.
- Implement `RateImportService` to parse Excel templates using PhpSpreadsheet.
- Add `RateImportResource` in Filament for administrative rate uploads.
- Refactor `PriceCalculatorService` to utilize the new 4-quadrant lookup logic.
- Add database migrations to extend `rate_entries` and create `country_zones`.
- Update `DEPLOYMENT.md` with new architectural details and deployment steps.
2026-10-29 07:18:52 +03:30

42 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<x-filament-panels::page>
<div class="space-y-4">
<div class="filament-card p-6">
<h2 class="text-lg font-semibold mb-2">Rate Excel Import</h2>
<p class="text-sm text-gray-600 mb-4">
Upload an Excel file matching the IFNEX Rate Template format.
The importer expects sheets named <code>Import Rate</code>, <code>Export Rate</code>, and optionally <code>Zone</code>.
Each rate sheet must contain two sections: <code>DOCUMENT</code> and <code>NON-DOCUMENT</code>.
</p>
<form wire:submit="import">
{{ $this->form }}
<div class="mt-4">
<x-filament::button type="submit" color="success" icon="heroicon-o-arrow-up-tray">
Import Rates
</x-filament::button>
</div>
</form>
</div>
<div class="filament-card p-4 bg-amber-50 border border-amber-200">
<h3 class="text-sm font-semibold text-amber-800 mb-2">📋 Quick checklist</h3>
<ul class="text-xs text-amber-700 list-disc ml-5 space-y-1">
<li>Sheet names must be exactly <code>Import Rate</code> and <code>Export Rate</code>.</li>
<li>Section markers must appear in column E (merged): <code>DOCUMENT</code> / <code>NON - DOCUMENT</code>.</li>
<li>Column headers must be <code>Weight (kg)</code> and <code>Zone 1</code>..<code>Zone 10</code> (or just integers 1..10).</li>
<li>Weights must be decimal numbers in column A (0.5, 1, 1.5, ...).</li>
<li>Empty cells are skipped (no rate stored for that weight × zone).</li>
<li>Currency defaults to AED. System converts to IRR using current exchange rate.</li>
</ul>
</div>
<div class="filament-card p-4">
<h3 class="text-sm font-semibold mb-2">Download template</h3>
<p class="text-xs text-gray-600 mb-2">
Need the blank template? <a href="/admin/rate-import/template" class="text-blue-600 underline">Download IFNEX_Rate_Template.xlsx</a>
</p>
</div>
</div>
</x-filament-panels::page>