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.
20 lines
874 B
PHP
20 lines
874 B
PHP
<?php
|
|
require 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
|
$file = 'storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx';
|
|
$spreadsheet = IOFactory::load($file);
|
|
|
|
// Search all sheets for exchange rate or currency info
|
|
foreach ($spreadsheet->getSheetNames() as $sheetName) {
|
|
$sheet = $spreadsheet->getSheetByName($sheetName);
|
|
echo "=== $sheetName ===" . PHP_EOL;
|
|
|
|
foreach ($sheet->getCellCollection() as $cell) {
|
|
$value = $sheet->getCell($cell)->getValue();
|
|
if (is_string($value) && (stripos($value, 'rate') !== false || stripos($value, 'exchange') !== false || stripos($value, 'currency') !== false || stripos($value, 'aed') !== false || stripos($value, 'irr') !== false || stripos($value, 'rial') !== false || stripos($value, 'dirham') !== false)) {
|
|
echo " Cell {$cell}: {$value}" . PHP_EOL;
|
|
}
|
|
}
|
|
}
|