Eyad-Sharkawy commented on PR #6714:
URL: https://github.com/apache/fineract/pull/6714#issuecomment-6488167029

   Hi @adamsaghy,
   
   Thank you for the detailed review! I've addressed all three points in the 
latest push:
   
   1. **Date format & locale passthrough**: 
      - Passed `dateFormat` and `locale` through to `readAsDate(...)` across 
`ClientPersonImportHandler`, `ClientEntityImportHandler`, and 
`OfficeImportHandler`.
      - Removed the pattern-guessing loop in `ImportHandlerUtils`. Dates are 
now parsed strictly according to the sheet's `dateFormat` (with standard 
ISO-8601 fallback), eliminating ambiguity for values like `"05/06/2023"`. Added 
unit test coverage verifying US vs UK pattern parsing.
   
   2. **Cached formula results & 1900/1904 date system**:
      - `readAsDate` now inspects `c.getCachedFormulaResultType()` first:
        - For `NUMERIC`, it calls `c.getDateCellValue()` directly, which 
natively honours the workbook's 1900 vs 1904 date windowing without 
re-evaluation and keeps Excel's saved result (e.g. for `=TODAY()`).
        - For `STRING`, it reads the cached string result and parses it.
        - For `BLANK`, it returns `null`.
      - Dynamic evaluation is retained only as a fallback and now passes 
`isDate1904(workbook)` to avoid the 4-year/1-day shift.
      - Similar cached-result fallback logic has been applied to 
`readAsString`, `readAsLong`, `readAsInt`, `readAsDouble`, and `readAsBoolean` 
to prevent returning `null` when POI cannot evaluate a formula.
   
   3. **Row-level error reporting**:
      - Rather than returning `null` and silently dropping optional dates like 
DOB, `readAsDate` throws an informative `IllegalArgumentException` on 
unparseable values.
      - Handlers catch per-row parsing errors in `readExcelFile(...)`, record 
them in the row's `Status` cell in red, and increment the batch error count in 
`process(...)`. Added a unit test verifying this behavior.
   
   Also rebased on latest `develop` and verified that `./gradlew test` and 
`./gradlew spotlessCheck` pass cleanly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to