[ofbiz-framework] branch release17.12 updated: Fixed: Error while running MRP (OFBIZ-12187)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release17.12 updated: Fixed: Error while running MRP (OFBIZ-12187)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release17.12 by this push:
     new 1cf9d91  Fixed: Error while running MRP (OFBIZ-12187)
1cf9d91 is described below

commit 1cf9d9110b007df20c77b38dfbff2d9ee0cc1aff
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Tue Feb 23 12:59:46 2021 +0100

    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
   
    Conflict handled by hand
---
 .../src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java  | 3 ++-
 1 file changed, 2 insertions(+), 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 9915675..db04e34 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
@@ -475,7 +475,8 @@ public class MrpServices {
                             continue;
                         }
                         eventQuantityTmp = eventQuantityTmp.negate();
-                        parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", customTimePeriod.getDate("fromDate"), "mrpEventTypeId", "SALES_FORECAST");
+                        parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", customTimePeriod.getTimestamp("fromDate"),
+                                "mrpEventTypeId", "SALES_FORECAST");
                         try {
                             InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, eventQuantityTmp, null, sfd.getString("salesForecastDetailId"), false, delegator);
                         } catch (GenericEntityException e) {