Commit 6e028ae7 authored by vjoshi's avatar vjoshi

MRP Process - 1. In case of item with stk_opt = 0 also plan to be generated

2. In case of item having supp_sour P or M (Purchased or manufactured), if site_code__supp is specified then the indent/MPS/wotkorder to be generated in the supply site

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216153 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 25230479
......@@ -3922,7 +3922,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
else
{
*/ if( isBomReplace )
*/ if( isBomReplace )
{
//continue;
......@@ -7691,7 +7691,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
return adpElement;// errString;
}
//commented By Pavan on 28MAR2018 as per manoharan Sir[Start]
/* private ADPElement mrpOptimize(ADPElement adpElement,int cycle) throws RemoteException, ITMException
/* private ADPElement mrpOptimize(ADPElement adpElement,int cycle) throws RemoteException, ITMException
{
String errString = "";
java.sql.Timestamp dueDate = null;
......@@ -9524,10 +9524,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String errString = "";
// check stk_opt
//if (getStkOpt(itemCode, siteCode).equals("0"))
if ("0".equals(getStkOpt(itemCode, siteCode)))
/*if ("0".equals(getStkOpt(itemCode, siteCode))) // commented By Vrushabh on 30-1-20 for plan to be generated start
{
return "";
}
}*/ // commented By Vrushabh on 30-1-20 for plan to be generated End
if (demand - supply <= 0)
{
return "";
......@@ -9676,7 +9676,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASEsuppSour["+suppSour+"]mfgType["+mfgType+"]"+"orderOpt["+orderOpt+"]batchQtyType["+batchQtyType+"]");
//System.out.println("Indent creation Plan Supply :" +
// reqQty + " Orderopt " + orderOpt + " Suppsour " +
// suppSour + " Mat Plan " + matPlan +" batchQty "+batchQty+" batchQtyType "+batchQtyType);
// suppSour + " Mat Plan " + matPlan +" batchQty "+batchQty+" batchQtyType "+batchQtyType);
//if ((suppSour.equals("P") || suppSour.equals("C")) && matPlan.equals("Y"))
if (("P".equals(suppSour) || "C".equals(suppSour)) && "Y".equals(matPlan))
{
......@@ -9718,7 +9718,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
indent.quantityStdUom = batchQty;
indent.unitInd = unit;
indent.unitStd = unit;
indent.siteCode = siteCode;
/* indent.siteCode = siteCode;*/ // commented By Vrushabh on 30-1-20
if(("P".equals(suppSour.trim())) && siteCodeSupp!=null && siteCodeSupp.trim().length()>0) // added By Vrushabh on 30-1-20 for when suppSour is equal to purchase and siteCodeSupp is not equal to null start
{
indent.siteCode=siteCodeSupp;
}
else
{
indent.siteCode= siteCode;
} // added By Vrushabh on 30-1-20 for when suppSour is equal to purchase and siteCodeSupp is not equal to null End
indent.siteCodeDlv = siteCode;
indent.siteCodeAcct = siteCode;
indent.aprCode = adpElement.getAprCode();
......@@ -9751,13 +9760,29 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int listCtr = indList.size() - 1; listCtr > 0; listCtr--)
{
indent = (Indent) indList.get(listCtr);
if (indent.itemCode.trim() == itemCode.trim() && indent.siteCode.trim() == siteCode.trim() && (dueDate.compareTo(horizonDate) <= 0))
/*if (indent.itemCode.trim() == itemCode.trim() && indent.siteCode.trim() == siteCode.trim() && (dueDate.compareTo(horizonDate) <= 0)
findEle = listCtr;
break;
}*/ // commented By Vrushabh on 4-2-2020
if(siteCodeSupp != null && siteCodeSupp.trim().length()>0 ||siteCodeSupp.trim()!="") // added By Vrushabh on 4-2-2020 for inserting condition of siteCodeSupp Start
{
if ((indent.itemCode.trim().equals(itemCode.trim())) && (indent.siteCode.trim().equals(siteCodeSupp.trim()))&& (dueDate.compareTo(horizonDate) <= 0)) // added By Vrushabh on 4-2-2020 for comparing siteCode and siteCodeSupp to get the list count Start
{
findEle = listCtr;
break;
} // added By Vrushabh on 4-2-2020 for comparing siteCode and siteCodeSupp to get the list count End
} // added By Vrushabh on 4-2-2020 for inserting condition of siteCodeSupp End
else
{
if ((indent.itemCode.trim().equals(itemCode.trim())) && (indent.siteCode.trim().equals(siteCode.trim())) && (dueDate.compareTo(horizonDate) <= 0))
{
findEle = listCtr;
break;
}
}
}
}
BaseLogger.log("3", null, null,"findEle-----"+findEle);
if (findEle >= 0)
{
......@@ -9777,7 +9802,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
newIndent.quantityStdUom = reqQty;
newIndent.unitInd = unit;
newIndent.unitStd = unit;
newIndent.siteCode = siteCode;
/*newIndent.siteCode = siteCode;*/ //commented By vrushabh on 30-1-20
if(("P".equals(suppSour.trim())) && siteCodeSupp!=null && siteCodeSupp.trim().length()>0) // added By Vrushabh on 30-1-20 for when suppSouris equal to purchase and siteCodeSupp is not equal to null start
{
newIndent.siteCode=siteCodeSupp;
}
else
{
newIndent.siteCode= siteCode;
} // added By Vrushabh on 30-1-20 for when suppSour is equal to purchase and siteCodeSupp is not equal to null End
newIndent.siteCodeDlv = siteCode;
newIndent.siteCodeAcct = siteCode;
newIndent.aprCode = adpElement.getAprCode();
......@@ -9788,7 +9822,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
newIndent.empCodeReq = adpElement.getEmpCodePlan();//Manoj dtd 11/03/2014 to set EmpCode Plan in Emp_code__req
newIndent.suppCodePref = adpElement.getSuppCodePref();
newIndent.purcRate = adpElement.getPurcRate();
;
newIndent.packCode = adpElement.getPackCode();
newIndent.chgDate = chgDate;
newIndent.chgUser = userId;
......@@ -9868,7 +9902,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mpsOrder.ordType = adpElement.getMfgType();
mpsOrder.itemCode = itemCode;
mpsOrder.siteCode = siteCode;
/* mpsOrder.siteCode = siteCode;*/ // commented By Vrushabh on 30-1-20
if(("M".equals(suppSour.trim())) && siteCodeSupp!=null && siteCodeSupp.trim().length()>0) // added By Vrushabh on 30-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null start
{
mpsOrder.siteCode=siteCodeSupp;
}
else
{
mpsOrder.siteCode= siteCode;
} // added By Vrushabh on 30-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null End
mpsOrder.quantity = batchQty;
mpsOrder.ordDate = curDate;
mpsOrder.planDueDate = dueDate;
......@@ -10054,7 +10097,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mpsOrder.ordType = adpElement.getMfgType();
mpsOrder.itemCode = itemCode;
mpsOrder.siteCode = siteCode;
/* mpsOrder.siteCode = siteCode;*/ // commented By Vrushabh on 30-1-20
if(("M".equals(suppSour.trim())) && siteCodeSupp!=null && siteCodeSupp.trim().length()>0) // added By Vrushabh on 30-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null start
{
mpsOrder.siteCode=siteCodeSupp;
}
else
{
mpsOrder.siteCode= siteCode;
} // added By Vrushabh on 30-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null End
mpsOrder.quantity = batchQty;
mpsOrder.ordDate = curDate;
mpsOrder.planDueDate = dueDate;
......@@ -10101,7 +10153,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mpsOrder.ordType = adpElement.getMfgType();
mpsOrder.itemCode = itemCode;
mpsOrder.siteCode = siteCode;
/* mpsOrder.siteCode = siteCode;*/ // commented By Vrushabh on 31-1-20
if(("M".equals(suppSour.trim())) && siteCodeSupp!=null && siteCodeSupp.trim().length()>0) // added By Vrushabh on 31-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null start
{
mpsOrder.siteCode=siteCodeSupp;
}
else
{
mpsOrder.siteCode= siteCode;
} // added By Vrushabh on 31-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null End
mpsOrder.quantity = batchQty;
mpsOrder.quantity = balQty;
mpsOrder.ordDate = curDate;
mpsOrder.planDueDate = dueDate;
......@@ -10214,15 +10276,26 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASEdueDate.compareTo(horizonDate)["+dueDate.compareTo(horizonDate)+"]");
//System.out.println("BASEmpsOrder.itemCode.trim()["+mpsOrder.itemCode.trim()+"]itemCode.trim()["+itemCode.trim()+"]");
//System.out.println("BASEmpsOrder.siteCode.trim()["+mpsOrder.siteCode.trim()+"]siteCode.trim()["+siteCode.trim()+"]");
if (mpsOrder.itemCode.trim().equalsIgnoreCase(itemCode.trim()) && mpsOrder.siteCode.trim().equalsIgnoreCase(siteCode.trim()) && (dueDate.compareTo(horizonDate) <= 0))
if(siteCodeSupp != null && siteCodeSupp.trim().length()>0 ||siteCodeSupp.trim()!="") // added By Vrushabh on 4-2-2020 for inserting condition of siteCodeSupp Start
{
if ((mpsOrder.itemCode.trim().equals(itemCode.trim())) && (mpsOrder.siteCode.trim().equals(siteCodeSupp.trim()))&& (dueDate.compareTo(horizonDate) <= 0)) // added By Vrushabh on 4-2-2020 for comparing siteCode and siteCodeSupp to get the list count Start
{
findEle = listCtr;
break;
} // added By Vrushabh on 4-2-2020 for comparing siteCode and siteCodeSupp to get the list count End
} // added By Vrushabh on 4-2-2020 for inserting condition of siteCodeSupp End
else
{
if ((mpsOrder.itemCode.trim().equals(itemCode.trim())) && (mpsOrder.siteCode.trim().equals(siteCode.trim())) && (dueDate.compareTo(horizonDate) <= 0))
{
findEle = listCtr;
// System.out.println("@@@@@findEle1["+findEle+"]");
break;
}
}
}
}
}
//System.out.println("@@@@@findEle2["+findEle+"]");
BaseLogger.log( "3", null, null, "@@@@@findEle2["+findEle+"]");
if (findEle >= 0)
......@@ -10236,7 +10309,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mpsOrder.ordType = adpElement.getMfgType();
mpsOrder.itemCode = itemCode;
mpsOrder.siteCode = siteCode;
/*mpsOrder.siteCode = siteCode;*/ // commented By Vrushabh on 31-1-20
if(("M".equals(suppSour.trim())) && siteCodeSupp!=null && siteCodeSupp.trim().length()>0) // added By Vrushabh on 31-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null start
{
mpsOrder.siteCode=siteCodeSupp;
}
else
{
mpsOrder.siteCode= siteCode;
} // added By Vrushabh on 31-1-20 for when suppSour is equal to manufacturing and siteCodeSupp is not equal to null End
mpsOrder.quantity = reqQty;
mpsOrder.ordDate = curDate;
mpsOrder.planDueDate = dueDate;
......@@ -12530,7 +12612,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pendIndQtySum = pendIndQtySum+pendIndQty;
pendDRQty = timeMrp.getPendingDR();
// pavan R on 28nov18 [to get return string in xml]
// pavan R on 28nov18 [to get return string in xml]
valueXmlStringDet.append("<Detail2 domID='" + browCnt + "' >\r\n");
......@@ -14396,7 +14478,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// 07-jun-2018 manoharan write the exploed demand in new sheet
if (expDemandList.size() > 0)
{
......@@ -14464,7 +14546,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
// end 07-jun-2018 manoharan
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
final String[] inputParam = { "Period From", "Period To",
"Site Code From", "Site Code To", "Item Code From",
"Item Code To", "Item Series From", "Item Series To",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment