Commit 300b0109 authored by kmandhre's avatar kmandhre

change validation for qty


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94017 ce508802-f39f-4f6c-b175-0d175dae99d5
parent de228fba
/* /*
Window Name : w_sord_dealloc Window Name : w_sord_dealloc
Dharmendra Debata Dharmendra Debata
*/ */
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
...@@ -484,7 +484,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -484,7 +484,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
//gtin_unit //gtin_unit
retTabSepStrBuff.append("<gtin_unit>").append("<![CDATA[" + (rs.getString(14)== null ?"": rs.getString(14)) +"]]>").append("</gtin_unit>"); retTabSepStrBuff.append("<gtin_unit>").append("<![CDATA[" + (rs.getString(14)== null ?"": rs.getString(14)) +"]]>").append("</gtin_unit>");
//LOT_NO //LOT_NO
retTabSepStrBuff.append("<lot_no>").append("<![CDATA[" + rs.getString(8) +"]]>").append("</lot_no>"); retTabSepStrBuff.append("<lot_no>").append("<![CDATA[" + rs.getString(8) +"]]>").append("</lot_no>");
//LOT_SL //LOT_SL
...@@ -749,7 +749,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -749,7 +749,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
String lotNo = " " ; String lotNo = " " ;
String tranId=" "; String tranId=" ";
String allocLineno=" "; String allocLineno=" ";
double DeallocQty = 0; double DeallocQty = 0 ,totDeallocQty = 0;
double quantity = 0; double quantity = 0;
String errString = " "; String errString = " ";
//Changed by sumit on 27/11/12 //Changed by sumit on 27/11/12
...@@ -880,6 +880,11 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -880,6 +880,11 @@ 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 );
}
}//inner for loop }//inner for loop
...@@ -896,7 +901,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -896,7 +901,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
if("N".equalsIgnoreCase(activeAllow)) if("N".equalsIgnoreCase(activeAllow))
{ {
String sql1 = ""; String sql1 = "";
double shipperSize = 0; double shipperSize = 0 ,qtyDiff = 0;
sql1 = "select shipper_size from item_lot_packsize where item_code = ? "; sql1 = "select shipper_size from item_lot_packsize where item_code = ? ";
pstmt = conn.prepareStatement(sql1); pstmt = conn.prepareStatement(sql1);
pstmt.setString(1,itemCode); pstmt.setString(1,itemCode);
...@@ -907,13 +912,28 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -907,13 +912,28 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
rs.close();rs = null; rs.close();rs = null;
qtyDiff = totDeallocQty -DeallocQty;
System.out.println("qtyDiff:::"+qtyDiff);
try{ try{
if(DeallocQty % shipperSize != 0) /*if(DeallocQty % shipperSize != 0)
{ {
flag = true; flag = true;
errString = itmDBAccessEJB.getErrorString("","VTACTALW2","","",conn); errString = itmDBAccessEJB.getErrorString("","VTACTALW2","","",conn);
System.out.println("==activeAllow validate 4 N =="+errString); System.out.println("==activeAllow validate 4 N =="+errString);
}*/
if(qtyDiff < 0)
{
System.out.println("skip");
continue;
}
if(qtyDiff % shipperSize != 0) //added by kunal on on 18/dec/13 check for remaining Qty
{
System.out.println("error..");
flag = true;
errString = itmDBAccessEJB.getErrorString("","VTACTALW2","","",conn);
} }
} }
catch(Exception ex) catch(Exception ex)
...@@ -932,10 +952,11 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -932,10 +952,11 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
elements ++; elements ++;
} }
} //added by ritesh on 10/10/13 for request DI3GSUN017 END } //added by ritesh on 10/10/13 for request DI3GSUN017 END
// added by cpatil on 27/11/13 as per manoj sir instruction start // added by cpatil on 27/11/13 as per manoj sir instruction start
if( saleOrder != null && saleOrder.trim().length() > 0 ) if( saleOrder != null && saleOrder.trim().length() > 0 )
{ {
...@@ -1078,7 +1099,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat ...@@ -1078,7 +1099,7 @@ public class StockDeallocationPrc extends ProcessEJB implements StockDeallocat
String mainStr = begPart + "Following error has occured\n" ; String mainStr = begPart + "Following error has occured\n" ;
if(elements > 0 ) if(elements > 0 )
{ {
mainStr = mainStr + "Invalid quantity,Entered quantity is not in multiple of Case/shipper Quantity.\n"; mainStr = mainStr + "Invalid quantity,Remaining quantity after deallocation is not in multiple of Case/shipper Quantity.\n";
} }
for(int i = 0; i < elements * 4;i++) for(int i = 0; i < elements * 4;i++)
{ {
......
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