Refactor the shipping rate import process to support bidirectional data handling (import/export) and implement currency conversion using system settings. Update the price calculator to ensure valid zone data is retrieved. - Update `ShippingRatesImport` to handle both import and export directions via `SimpleRateSheetImport`. - Implement AED to IRR conversion during rate importation using `SystemSetting`. - Add validation for zone numbers and rate values during import. - Enhance `PriceCalculatorService` to filter for non-zero zone values. - Add various debug and testing scripts for pricing and data structure verification.
21 lines
778 B
PHP
21 lines
778 B
PHP
<?php
|
|
require 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
|
$file = 'storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx';
|
|
$ss = IOFactory::load($file);
|
|
|
|
echo "=== Export Rate structure ===" . PHP_EOL;
|
|
$sheet = $ss->getSheetByName('Export Rate');
|
|
for ($r = 4; $r <= 14; $r++) {
|
|
$row = $sheet->rangeToArray("A{$r}:L{$r}")[0];
|
|
echo "Row {$r}: " . implode(' | ', array_map(function($c) { return $c === null ? '(null)' : $c; }, $row)) . PHP_EOL;
|
|
}
|
|
|
|
echo PHP_EOL . "=== Import Rate structure ===" . PHP_EOL;
|
|
$sheet = $ss->getSheetByName('Import Rate');
|
|
for ($r = 4; $r <= 14; $r++) {
|
|
$row = $sheet->rangeToArray("A{$r}:K{$r}")[0];
|
|
echo "Row {$r}: " . implode(' | ', array_map(function($c) { return $c === null ? '(null)' : $c; }, $row)) . PHP_EOL;
|
|
}
|