Align calibration date fields with string schema#375
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eccbc4a983
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| WHERE c.CTAG=$P{P_CTAG}]]> | ||
| </queryString> | ||
| <field name="C2301" class="java.util.Date"/> | ||
| <field name="C2301" class="java.lang.String"/> |
There was a problem hiding this comment.
Keep date formatting for C2301 in DCC report
Changing C2301 to java.lang.String means the textField that still uses pattern="dd.MM.yyyy" will no longer apply the date pattern because JasperReports only formats Date/Number types. In environments where C2301 is stored as an ISO string (the reason for this change), or even when the DB returns a DATE but Jasper now pulls it via getString, the rendered value will be raw (e.g., 2024-01-02 or 2024-01-02T00:00:00Z) instead of the previous dd.MM.yyyy output. If the intention is to keep human-friendly formatting, this field needs a formatter expression like the other calibration fields.
Useful? React with 👍 / 👎.
| WHERE c.CTAG=$P{P_CTAG}]]> | ||
| </queryString> | ||
| <field name="C2301" class="java.util.Date"/> | ||
| <field name="C2301" class="java.lang.String"/> |
There was a problem hiding this comment.
Keep date formatting for C2301 in DAKKS report
The C2301 field is now a String, but the report still relies on a textField with pattern="dd.MM.yyyy" to format the calibration date. JasperReports won’t apply that pattern to strings, so string-backed installs will display raw ISO values, and date-backed installs will also lose the previous dd.MM.yyyy formatting because the driver now returns a string. If the report should stay human-readable, this field needs a date/ISO-aware expression instead of a pattern on a string.
Useful? React with 👍 / 👎.
Motivation
C2301/C2303values coming from thecalibrationtable which are stored as ISO strings in some installs, so DB-sideDATEcasts break non-date values and cause type mismatches.java.lang.String.Description
CAST(cal.�C2301� AS DATE)/CAST(cal.�C2303� AS DATE)withcal.�C2301�/cal.�C2303�inSTICKERS/main_reports/CAL-INV-STICKER_Zebra-ZD621_30x15-203dpi.jrxml.C2301/C2303(and theircal_C2301/cal_C2303variants) fromjava.sql.Date/java.util.Datetojava.lang.Stringacross sticker templates and reports:STICKERS/*,INVENTORY-SAMPLE/main_reports/inventory-sample.jrxml,DCC/main_reports/dcc-sample.jrxml, andDAKKS-SAMPLE/main_reports/dakks-sample.jrxml.FormattedLastCalibration,FormattedNextCalibration, and other ISO-aware expressions) so ISO-formatted strings continue to render asdd.MM.yyyy(or month/year) where applicable.Testing
CAST(...)removals and that relevant<field>entries now usejava.lang.String.Codex Task