Commit 5013ef9e authored by kmandhre's avatar kmandhre

add validation and handal multiple line error message : 182-N point


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94089 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c4d884da
......@@ -770,9 +770,10 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
String activeAllow = "";
ArrayList list = new ArrayList();
ArrayList list1 = new ArrayList();
ArrayList list2 = new ArrayList();
boolean flag = false,isFlag = true,allocqtyflag = false,pendingOrderFlag=false;
double qtyAvailAlloc = 0;
int elements = 0,elements1 = 0,cnt=0;
int elements = 0,elements1 = 0,cnt=0,elements2 = 0 ;
ConnDriver connDriver = new ConnDriver(); //added by rajendra on 02/11/07
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String sql = "",shipStatus="";
......@@ -883,10 +884,20 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
if (childNodeName.equals("tot_alloc_qty"))
{
totDeallocQty = Double.parseDouble(childNode.getFirstChild().getNodeValue());
System.out.print("Total DeallocQty::::"+ totDeallocQty );
System.out.print("Total DeallocQty::::"+ totDeallocQty +" "+DeallocQty);
}
}//inner for loop
System.out.println("Tot DeallocQty"+totDeallocQty+" "+DeallocQty);
if(DeallocQty > totDeallocQty) //added by kunaal on 04/jan/14
{
isFlag = false;
list2.add(saleOrder);
list2.add(lineNo);
list2.add(itemCode);
list2.add(DeallocQty);
elements2 ++;
}
if(!"Y".equalsIgnoreCase(activeAllow) )
{
......@@ -950,6 +961,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
list.add(itemCode);
list.add(DeallocQty);
elements ++;
errString = "";
}
......@@ -1028,6 +1040,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
list1.add(itemCode);
list1.add(DeallocQty);
elements1 ++;
errString = "";
}
}
}
......@@ -1087,16 +1100,22 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
}// out for loop
if (isFlag == false)
{
if(allocqtyflag = true)
/*if(allocqtyflag = true)
{
System.out.println("@@@@@ inside if["+errString+"]");
// errString = "VTACTALW2";
errString = "PROCSUCC";
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
}
}*/
errString = "PROCSUCC"; //added by kunal on 04/JAN/13
errString = itmDBAccessEJB.getErrorString("",errString,"","",conn);
String begPart = errString.substring( 0, errString.indexOf("<trace>") + 7 );
String endPart = errString.substring( errString.indexOf("</trace>"));
String mainStr = begPart + "Following error has occured\n" ;
String mainStr = "" ;
if(elements > 0 || elements1 > 0 || elements2 > 0 )
{
mainStr = begPart + "Following error has occured\n" ;
}
if(elements > 0 )
{
mainStr = mainStr + "Invalid quantity,Remaining quantity after deallocation is not in multiple of Case/shipper Quantity.\n";
......@@ -1124,6 +1143,21 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
mainStr = mainStr +
"sale order :"+list1.get(i++)+ ",line no :"+ list1.get(i++) + ",item code :"+list1.get(i++)+",quantity :"+list1.get(i++)+"\n" ;
}
//added by kunal on 04/jan/13
if(elements2 > 0 )
{
mainStr = mainStr + "\n Deallocate quantity more than Total Allocated Quantity. \n";
}
for(int i = 0; i < elements2 * 4 ;i++)
{
if( i > 0)
{
i -= 1;
}
mainStr = mainStr +
"sale order :"+list2.get(i++)+ ",line no :"+ list2.get(i++) + ",item code :"+list2.get(i++)+",quantity :"+list2.get(i++)+"\n" ;
}
mainStr = mainStr + endPart;
errString = mainStr;
......
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