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.
38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?php
|
|
require 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
|
$file = 'storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx';
|
|
$spreadsheet = IOFactory::load($file);
|
|
|
|
// Check all sheet names
|
|
echo "Sheet names:" . PHP_EOL;
|
|
foreach ($spreadsheet->getSheetNames() as $name) {
|
|
echo " - $name" . PHP_EOL;
|
|
}
|
|
|
|
// Check DocNor for any notes
|
|
$sheet = $spreadsheet->getSheetByName('DocNor');
|
|
echo PHP_EOL . "=== DocNor notes/comments ===" . PHP_EOL;
|
|
$comments = $sheet->getComments();
|
|
foreach ($comments as $cell => $comment) {
|
|
echo "Cell $cell: " . $comment->getText() . PHP_EOL;
|
|
}
|
|
|
|
// Check for any cells with formulas
|
|
echo PHP_EOL . "=== DocNor formulas ===" . PHP_EOL;
|
|
for ($row = 1; $row <= 5; $row++) {
|
|
for ($col = 1; $col <= 3; $col++) {
|
|
$cell = $sheet->getCellByColumnAndRow($col, $row);
|
|
if ($cell->getDataType() == \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA) {
|
|
echo "Cell " . $cell->getCoordinate() . ": " . $cell->getValue() . " = " . $cell->getCalculatedValue() . PHP_EOL;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Check if there's any metadata
|
|
echo PHP_EOL . "=== DocNor first cell values ===" . PHP_EOL;
|
|
echo "A1: " . $sheet->getCell('A1')->getValue() . PHP_EOL;
|
|
echo "B1: " . $sheet->getCell('B1')->getValue() . PHP_EOL;
|
|
echo "C1: " . $sheet->getCell('C1')->getValue() . PHP_EOL;
|