Skip to content

Align calibration date fields with string schema#375

Merged
bastelix merged 1 commit intomainfrom
calhelp/check-database-schema-for-c2301-and-c2303
Feb 4, 2026
Merged

Align calibration date fields with string schema#375
bastelix merged 1 commit intomainfrom
calhelp/check-database-schema-for-c2301-and-c2303

Conversation

@bastelix
Copy link
Copy Markdown
Contributor

@bastelix bastelix commented Feb 4, 2026

Motivation

  • The reports include C2301/C2303 values coming from the calibration table which are stored as ISO strings in some installs, so DB-side DATE casts break non-date values and cause type mismatches.
  • To support the string-backed schema while preserving existing human-friendly output, keep the report-side formatting logic that accepts ISO-strings and Date objects and treat the source fields as java.lang.String.

Description

  • Remove DB-side casts for calibration dates in the CAL-INV sticker query by replacing CAST(cal.�C2301� AS DATE) / CAST(cal.�C2303� AS DATE) with cal.�C2301� / cal.�C2303� in STICKERS/main_reports/CAL-INV-STICKER_Zebra-ZD621_30x15-203dpi.jrxml.
  • Change JRXML field definitions for C2301 / C2303 (and their cal_C2301 / cal_C2303 variants) from java.sql.Date / java.util.Date to java.lang.String across sticker templates and reports: STICKERS/*, INVENTORY-SAMPLE/main_reports/inventory-sample.jrxml, DCC/main_reports/dcc-sample.jrxml, and DAKKS-SAMPLE/main_reports/dakks-sample.jrxml.
  • Preserve the existing formatting variables/expressions (FormattedLastCalibration, FormattedNextCalibration, and other ISO-aware expressions) so ISO-formatted strings continue to render as dd.MM.yyyy (or month/year) where applicable.

Testing

  • No automated tests were executed for these changes.
  • Changes were validated by searching the repository to confirm the CAST(...) removals and that relevant <field> entries now use java.lang.String.

Codex Task

@bastelix bastelix merged commit bf7cef1 into main Feb 4, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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"/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant