Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Release Branch 4.0
-
None
-
SQL: PostgreSQL 8.3.5
JDBC Driver: postgresql-8.3-603.jdbc4.jar
Description
Script: [OFBIZ_HOME]/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh throws an exception:
Target exception: org.ofbiz.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT DISTINCT PROD.INTERNAL_NAME, PROD.IS_VIRTUAL, PROD.SALES_DISCONTINUATION_DATE, PROD.PRODUCT_TYPE_ID, PRFA.PRODUCT_ID, PRFA.FACILITY_ID, PRFA.MINIMUM_STOCK, PRFA.REORDER_QUANTITY, PRFA.DAYS_TO_SHIP FROM public.PRODUCT PROD INNER JOIN public.PRODUCT_FACILITY PRFA ON PROD.PRODUCT_ID = PRFA.PRODUCT_ID WHERE ((PRFA.FACILITY_ID = ? AND PROD.PRODUCT_TYPE_ID = ?) AND (PROD.IS_VIRTUAL IS NULL OR PROD.IS_VIRTUAL <> ?) AND (PROD.SALES_DISCONTINUATION_DATE IS NULL OR PROD.SALES_DISCONTINUATION_DATE > ?)) ORDER BY PRFA.PRODUCT_ID ASC (ERROR: operator does not exist: timestamp with time zone > character varying)
I fixed this error by add explicit conversion to Timestamp in line 112:
new EntityExpr("salesDiscontinuationDate", EntityOperator.GREATER_THAN, Timestamp.valueOf(productsSoldThruTimestamp)))
I tested this only on Derby and pgSQL.