Fixed error with execute transaction out the context and some issue to run MRP
This commit is contained in:
parent
e01ca930d2
commit
e0605a3553
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue