From e0605a3553f2ee280c6d0ed95cd5d89a6f232dc4 Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Thu, 7 Aug 2008 19:15:04 +0000 Subject: [PATCH] Fixed error with execute transaction out the context and some issue to run MRP --- base/src/org/eevolution/model/MPPMRP.java | 2 +- base/src/org/eevolution/process/MRP.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/base/src/org/eevolution/model/MPPMRP.java b/base/src/org/eevolution/model/MPPMRP.java index 4822e10ee1..acf458bc4f 100644 --- a/base/src/org/eevolution/model/MPPMRP.java +++ b/base/src/org/eevolution/model/MPPMRP.java @@ -692,7 +692,7 @@ public class MPPMRP extends X_PP_MRP } sql = new String("SELECT * FROM PP_MRP mrp WHERE mrp.M_RequisitionLine_ID = ? "); - MRequisition r = new MRequisition(Env.getCtx(), rl.getM_Requisition_ID(),"M_Requisition"); + MRequisition r = new MRequisition(Env.getCtx(), rl.getM_Requisition_ID(),trxName); MPPMRP mrp = null; PreparedStatement pstmt = null; diff --git a/base/src/org/eevolution/process/MRP.java b/base/src/org/eevolution/process/MRP.java index e15f11758e..02c73582fb 100644 --- a/base/src/org/eevolution/process/MRP.java +++ b/base/src/org/eevolution/process/MRP.java @@ -857,14 +857,12 @@ public class MRP extends SvrProcess note.save(); continue; } - // 4Layers - end + MRequisition req = new MRequisition(getCtx(),0, get_TrxName()); req.setAD_User_ID(m_product_planning.getPlanner_ID()); req.setDateRequired(TimeUtil.addDays(DemandDateStartSchedule , (m_product_planning.getDeliveryTime_Promised().add(m_product_planning.getTransfertTime())).negate().intValue())); - //req.setDateRequired(BeforeDateStartSchedule); - req.setDescription("Generate from MRP"); req.setM_Warehouse_ID(m_product_planning.getM_Warehouse_ID()); req.setDocumentNo(MSequence.getDocumentNo(DocTypeReq , get_TrxName() ,false)); @@ -893,7 +891,7 @@ public class MRP extends SvrProcess log.info("Set Correct Dates for Plan"); MPPMRP mrp = new MPPMRP(getCtx(),rs,get_TrxName()); mrp.setDateOrdered(Today); - mrp.setDatePromised(DemandDateStartSchedule); + mrp.setDatePromised(req.getDateRequired()); mrp.setDateStartSchedule(TimeUtil.addDays(DemandDateStartSchedule, (m_product_planning.getDeliveryTime_Promised().add(m_product_planning.getTransfertTime())).negate().intValue())); mrp.setDateFinishSchedule(DemandDateStartSchedule); mrp.save();