From 07054fdaf51fbabbf6e2003c5d0d44019669c7b8 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Tue, 23 Feb 2021 12:59:46 +0100 Subject: [PATCH] Fixed: Error while running MRP (OFBIZ-12187) I tried running MRP for Sales Forecast option and it returned the following error. Error running the initMrpEvents service: Service [initMrpEvents] target threw an unexpected exception (java.sql.Timestamp cannot be cast to java.sql.Date) Thanks: Nameet Jain --- .../java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java index 58b064e284..53234cd58f 100644 --- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java +++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java @@ -488,7 +488,7 @@ public class MrpServices { continue; } eventQuantityTmp = eventQuantityTmp.negate(); - parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", customTimePeriod.getDate("fromDate"), + parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", customTimePeriod.getTimestamp("fromDate"), "mrpEventTypeId", "SALES_FORECAST"); try { InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, eventQuantityTmp, null, sfd.getString(