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.
28 lines
1021 B
PHP
28 lines
1021 B
PHP
<?php
|
|
require 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
|
$file = 'storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx';
|
|
$spreadsheet = IOFactory::load($file);
|
|
|
|
$sheet = $spreadsheet->getSheetByName('Assumptions');
|
|
echo "=== Assumptions sheet ===" . PHP_EOL;
|
|
echo "Total rows: " . $sheet->getHighestRow() . PHP_EOL;
|
|
echo "Total cols: " . $sheet->getHighestColumn() . PHP_EOL;
|
|
|
|
for ($row = 1; $row <= $sheet->getHighestRow(); $row++) {
|
|
$rowData = $sheet->rangeToArray("A{$row}:Z{$row}")[0];
|
|
echo "Row $row: " . implode(' | ', array_map(function($cell) {
|
|
return $cell === null ? '(null)' : $cell;
|
|
}, $rowData)) . PHP_EOL;
|
|
}
|
|
|
|
echo PHP_EOL . "=== Zone sheet ===" . PHP_EOL;
|
|
$sheet = $spreadsheet->getSheetByName('Zone');
|
|
for ($row = 1; $row <= $sheet->getHighestRow(); $row++) {
|
|
$rowData = $sheet->rangeToArray("A{$row}:Z{$row}")[0];
|
|
echo "Row $row: " . implode(' | ', array_map(function($cell) {
|
|
return $cell === null ? '(null)' : $cell;
|
|
}, $rowData)) . PHP_EOL;
|
|
}
|