Commit bf951ed0 authored by kmandhre's avatar kmandhre

validation added for Allocated quantity more than Pending quantity.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94068 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d7bd2170
......@@ -926,7 +926,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
String lotNo = null;
String locDescr = null;
String itemShDescr = null;
double allocQty = 0;
double allocQty = 0 , pendingQty = 0;
double quantity = 0;
double qtyAvailAlloc = 0;
String stockQuantity = "";
......@@ -954,10 +954,12 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
PreparedStatement pstmt = null;
Statement st = null;
int elements = 0,elements1 = 0,cnt=0,elements2 = 0;
int elements = 0,elements1 = 0,cnt=0,elements2 = 0,elements3 = 0,elements4 = 0;
ArrayList list = new ArrayList();
ArrayList list1 = new ArrayList();
ArrayList list2 = new ArrayList();
ArrayList list3 = new ArrayList();
ArrayList list4 = new ArrayList();
boolean flag = false,isFlag = true,allocqtyflag = false,pendingOrderFlag=false;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String sql = "",shipStatus="";
......@@ -1029,15 +1031,38 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
}
} //added by ritesh 0n 7/8/13 for request DI3ESUN009 END
if (childNodeName.equals("pending_quantity"))
{
pendingQty = Double.parseDouble(childNode.getFirstChild().getNodeValue());
}
}//inner for loop
System.out.println("Pending Qty="+pendingQty+" alloc Qty="+allocQty);
if(allocQty > pendingQty) ///added by kunal on 27/dec/13
{
errString = itmDBAccessEJB.getErrorString("","ALLCQTY01","","",conn);
flag = true;
isFlag = false;
list3.add(saleOrder);
list3.add(lineNo);
list3.add(itemCode);
list3.add(allocQty);
elements3 ++;
}
if(!"Y".equalsIgnoreCase(activeAllow) )
{
if(!"N".equalsIgnoreCase(activeAllow))
{
System.out.println("==activeAllow validate==");
errString = itmDBAccessEJB.getErrorString("","VTACTALW","","",conn);
return errString;
flag = true;
isFlag = false;
list4.add(saleOrder);
list4.add(lineNo);
list4.add(itemCode);
list4.add(allocQty);
elements4 ++;
//return errString;
}
} //added by ritesh on 07/10/13 for request DI3ESUN009
if("N".equalsIgnoreCase(activeAllow))
......@@ -1188,7 +1213,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
{
allocqtyflag = true;
}
}else if(allocQty == 0) //added by kunal on 27/12/12 as per manoj instruction
}else if(allocQty == 0 && flag == false) //added by kunal on 27/12/12 as per manoj instruction
{
updateSql = "UPDATE SORDDET SET HOLD_FLAG ='"+holdFlag+"'"
+ " WHERE SALE_ORDER = '" + saleOrder + " ' "
......@@ -1224,8 +1249,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
String begPart = errString.substring( 0, errString.indexOf("<trace>") + 7 );
String endPart = errString.substring( errString.indexOf("</trace>"));
String mainStr = "";
System.out.println("error check =="+elements+" "+elements1+" "+elements2);
if(elements > 0 || elements1 > 0 || elements2 > 0)
System.out.println("error check =="+elements+" "+elements1+" "+elements2+" "+elements3+" "+elements4);
if(elements > 0 || elements1 > 0 || elements2 > 0 || elements3 > 0 || elements4 > 0)
{
mainStr = begPart + "Following error has occured\n" ;
}
......@@ -1271,6 +1296,34 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
mainStr = mainStr +
"sale order :"+list2.get(i++)+ ",line no :"+ list2.get(i++) + ",item code :"+list2.get(i++)+",quantity :"+list2.get(i++)+"\n" ;
}
//added by kunal on 27/dec/13
if( elements3 > 0 )
{
mainStr = mainStr + "\n Allocated quantity more than Pending quantity.\n";
}
for(int i = 0; i < elements3 * 4 ; i++ )
{
if( i > 0)
{
i -= 1;
}
mainStr = mainStr +
"sale order :"+list3.get(i++)+ ",line no :"+ list3.get(i++) + ",item code :"+list3.get(i++)+",quantity :"+list3.get(i++)+"\n" ;
}
if( elements4 > 0 )
{
mainStr = mainStr + "\n Active allow should be either Y or N.\n";
}
for(int i = 0; i < elements4 * 4 ; i++ )
{
if( i > 0)
{
i -= 1;
}
mainStr = mainStr +
"sale order :"+list4.get(i++)+ ",line no :"+ list4.get(i++) + ",item code :"+list4.get(i++)+",quantity :"+list4.get(i++)+"\n" ;
}
//added by kunal on 27/dec/13 end
......
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