Fixed error with execute transaction out the context and some issue to run MRP

This commit is contained in:
vpj-cd 2008-08-07 19:15:04 +00:00
parent e01ca930d2
commit e0605a3553
2 changed files with 3 additions and 5 deletions

View File

@ -692,7 +692,7 @@ public class MPPMRP extends X_PP_MRP
} }
sql = new String("SELECT * FROM PP_MRP mrp WHERE mrp.M_RequisitionLine_ID = ? "); 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; MPPMRP mrp = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;

View File

@ -857,14 +857,12 @@ public class MRP extends SvrProcess
note.save(); note.save();
continue; continue;
} }
// 4Layers - end
MRequisition req = new MRequisition(getCtx(),0, get_TrxName()); MRequisition req = new MRequisition(getCtx(),0, get_TrxName());
req.setAD_User_ID(m_product_planning.getPlanner_ID()); 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(TimeUtil.addDays(DemandDateStartSchedule , (m_product_planning.getDeliveryTime_Promised().add(m_product_planning.getTransfertTime())).negate().intValue()));
//req.setDateRequired(BeforeDateStartSchedule);
req.setDescription("Generate from MRP"); req.setDescription("Generate from MRP");
req.setM_Warehouse_ID(m_product_planning.getM_Warehouse_ID()); req.setM_Warehouse_ID(m_product_planning.getM_Warehouse_ID());
req.setDocumentNo(MSequence.getDocumentNo(DocTypeReq , get_TrxName() ,false)); req.setDocumentNo(MSequence.getDocumentNo(DocTypeReq , get_TrxName() ,false));
@ -893,7 +891,7 @@ public class MRP extends SvrProcess
log.info("Set Correct Dates for Plan"); log.info("Set Correct Dates for Plan");
MPPMRP mrp = new MPPMRP(getCtx(),rs,get_TrxName()); MPPMRP mrp = new MPPMRP(getCtx(),rs,get_TrxName());
mrp.setDateOrdered(Today); 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.setDateStartSchedule(TimeUtil.addDays(DemandDateStartSchedule, (m_product_planning.getDeliveryTime_Promised().add(m_product_planning.getTransfertTime())).negate().intValue()));
mrp.setDateFinishSchedule(DemandDateStartSchedule); mrp.setDateFinishSchedule(DemandDateStartSchedule);
mrp.save(); mrp.save();