Commit cc0703b7 authored by dsawant's avatar dsawant

quantity validation added for greater quantity


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95937 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3d6b4990
...@@ -107,7 +107,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -107,7 +107,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
String workOrder = "",squantity="",wotatus="",itemCode=""; String workOrder = "",squantity="",wotatus="",itemCode="";
double quantity = 0,noOfArt=0; double quantity = 0,noOfArt=0,woquantity=0,detquantity=0,totanquan=0;
...@@ -457,7 +457,8 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -457,7 +457,8 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
else if(childNodeName.equalsIgnoreCase("quantity")) else if(childNodeName.equalsIgnoreCase("quantity"))
{ {
squantity = genericUtility.getColumnValue("quantity",dom2); squantity = genericUtility.getColumnValue("quantity",dom2);
workOrder = genericUtility.getColumnValue("work_order",dom2);
System.out.println("squantity"+squantity+"workOrder<><><>"+workOrder);
if (squantity == null || squantity.trim().length() == 0) if (squantity == null || squantity.trim().length() == 0)
{ {
quantity = 0; quantity = 0;
...@@ -472,6 +473,45 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -472,6 +473,45 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
errCode = "WORDWIQANU"; errCode = "WORDWIQANU";
errString = getErrorString("quantity",errCode,userId); errString = getErrorString("quantity",errCode,userId);
break; break;
}else
{
System.out.println("squantity"+squantity+"workOrder<><><>"+workOrder);
sql = "select quantity from workorder where work_order = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,workOrder);
rs = pstmt.executeQuery();
if(rs.next())
{
woquantity = rs.getDouble(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
sql = "select sum(quantity) from workorder_rcp_det where work_order = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,workOrder);
rs = pstmt.executeQuery();
if(rs.next())
{
detquantity = rs.getDouble(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
totanquan = detquantity + quantity;
System.out.println(">>>>>>>>>>>totanquan"+totanquan);
if(totanquan > woquantity)
{
errCode = "WORDWIQCNG";
errString = getErrorString("quantity",errCode,userId);
break;
}
} }
} }
else if(childNodeName.equalsIgnoreCase("item_code")) else if(childNodeName.equalsIgnoreCase("item_code"))
......
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