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
1.0 KiB
PHP
26 lines
1.0 KiB
PHP
<?php
|
|
require 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
|
$file = 'storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx';
|
|
$spreadsheet = IOFactory::load($file);
|
|
$sheet = $spreadsheet->getSheetByName('DocEco');
|
|
|
|
echo "=== DocEco: looking for weight 2, zone 3 ===" . PHP_EOL;
|
|
for ($row = 1; $row <= $sheet->getHighestRow(); $row++) {
|
|
$rowData = $sheet->rangeToArray("A{$row}:C{$row}")[0];
|
|
if ((float) $rowData[0] == 2 && (int) $rowData[1] == 3) {
|
|
echo "Row $row: Weight={$rowData[0]}, Zone={$rowData[1]}, Value={$rowData[2]}" . PHP_EOL;
|
|
echo "Divided by 455000: " . ($rowData[2] / 455000) . PHP_EOL;
|
|
echo "Divided by 37000: " . ($rowData[2] / 37000) . PHP_EOL;
|
|
echo "Divided by 30000: " . ($rowData[2] / 30000) . PHP_EOL;
|
|
break;
|
|
}
|
|
}
|
|
|
|
echo PHP_EOL . "=== DocEco: all rows ===" . PHP_EOL;
|
|
for ($row = 2; $row <= $sheet->getHighestRow(); $row++) {
|
|
$rowData = $sheet->rangeToArray("A{$row}:C{$row}")[0];
|
|
echo "Row $row: {$rowData[0]} | {$rowData[1]} | {$rowData[2]}" . PHP_EOL;
|
|
}
|