IDEMPIERE-5783 Support date and number in jasper column lookup (#1915)

This commit is contained in:
Carlos Ruiz 2023-06-28 04:20:06 +02:00 committed by GitHub
parent b4dcfa11d9
commit 2dbdeb6f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,7 @@ package org.adempiere.report.jasper;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import org.adempiere.apps.graph.ChartBuilder; import org.adempiere.apps.graph.ChartBuilder;
@ -97,6 +98,10 @@ public class ColumnLookup implements BiFunction<String, Object, Object> {
return getLocator((Number) key); return getLocator((Number) key);
} else if (DisplayType.PAttribute == column.getAD_Reference_ID() && (key instanceof Number)) { } else if (DisplayType.PAttribute == column.getAD_Reference_ID() && (key instanceof Number)) {
return getAttributeSetInstance((Number) key); return getAttributeSetInstance((Number) key);
} else if (DisplayType.isNumeric(column.getAD_Reference_ID())) {
return DisplayType.getNumberFormat(column.getAD_Reference_ID(), language).format((Number) key);
} else if (DisplayType.isDate(column.getAD_Reference_ID())) {
return DisplayType.getDateFormat(column.getAD_Reference_ID(), language).format((Date) key);
} }
} }
} }