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.
26 lines
936 B
PHP
26 lines
936 B
PHP
<?php
|
|
require 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
|
$file = 'storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx';
|
|
$spreadsheet = IOFactory::load($file);
|
|
|
|
// Check Export Rate sheet more thoroughly
|
|
$sheet = $spreadsheet->getSheetByName('Export Rate');
|
|
echo "=== Export Rate full structure ===" . PHP_EOL;
|
|
for ($row = 1; $row <= 15; $row++) {
|
|
$rowData = $sheet->rangeToArray("A{$row}:L{$row}")[0];
|
|
echo "Row $row: " . implode(' | ', array_map(function($cell) {
|
|
return $cell === null ? '(null)' : $cell;
|
|
}, $rowData)) . PHP_EOL;
|
|
}
|
|
|
|
echo PHP_EOL . "=== Import Rate full structure ===" . PHP_EOL;
|
|
$sheet = $spreadsheet->getSheetByName('Import Rate');
|
|
for ($row = 1; $row <= 15; $row++) {
|
|
$rowData = $sheet->rangeToArray("A{$row}:K{$row}")[0];
|
|
echo "Row $row: " . implode(' | ', array_map(function($cell) {
|
|
return $cell === null ? '(null)' : $cell;
|
|
}, $rowData)) . PHP_EOL;
|
|
}
|