The created PR is not backward compatible (source and binary) but is backward compatible with existing print format. I didn’t find a way to address the issue raise in this ticket without breaking source level backward compatibility.
If we don’t want to address this since there’s a pretty straightforward workaround (create a virtual column), we should close this ticket and implement https://idempiere.atlassian.net/browse/IDEMPIERE-3402 instead (i.e prevent > 1 printformatitem created for 1 AD_Column_ID since it doesn’t work in current code).
Steps to reproduce:
1 - Choose Invoice Detail & Margin and run
2 - Edit the print format item as follows:
Column: DateInvoiced, FormatPattern: MM/dd
Column: DateInvoiced, FormatPattern: yyyy
3 - Refresh the report and see the wrong result:
Looking into the code, this happens because on PrintData java class we have:
Ttrusting only on AD_Column_ID the wrong index is returned and the value is not the expected.