ifnex/04_Laravel/debug_start.php
Kazem Alghasi 3aaa9a5481 refactor(api): improve shipping rate import and pricing logic
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.
2026-08-04 07:24:23 +03:30

20 lines
674 B
PHP

<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
$file = 'storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx';
$spreadsheet = IOFactory::load($file);
foreach (['Start', 'Form', 'DATES'] as $sheetName) {
$sheet = $spreadsheet->getSheetByName($sheetName);
if (!$sheet) continue;
echo "=== $sheetName ===" . PHP_EOL;
for ($row = 1; $row <= min(10, $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;
}