Commit 7ff96371 authored by msalam's avatar msalam

cust item ref validation required only if it is not null as per kb on phone - alam


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91134 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c113f53f
...@@ -1404,29 +1404,34 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF ...@@ -1404,29 +1404,34 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
custItemRef = genericUtility.getColumnValue("cust_item__ref",dom); custItemRef = genericUtility.getColumnValue("cust_item__ref",dom);
itemCode = genericUtility.getColumnValue("item_code",dom); itemCode = genericUtility.getColumnValue("item_code",dom);
custCode = genericUtility.getColumnValue("cust_code",dom1); custCode = genericUtility.getColumnValue("cust_code",dom1);
sql = " select count(*) " //msalam - as per kandarp sir on phone - 080809
+ " from customeritem" //Validation required if custItemRef is not null only
+ " where cust_code = ?" if( custItemRef != null && custItemRef.trim().length() > 0 )
+ " and item_code = ?"
+ " and item_code__ref = ?" ;
//System.out.println("select custItemRef var_value.." + sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode);
pstmt.setString(2,itemCode);
pstmt.setString(3,custItemRef);
rs = pstmt.executeQuery();
if(rs.next())
{ {
cnt = rs.getInt(1) ; sql = " select count(*) "
} + " from customeritem"
rs.close(); + " where cust_code = ?"
pstmt.close(); + " and item_code = ?"
pstmt = null; + " and item_code__ref = ?" ;
if( cnt == 0) //System.out.println("select custItemRef var_value.." + sql);
{ pstmt = conn.prepareStatement(sql);
errCode = "VTCUSTITM"; pstmt.setString(1,custCode);
errString = getErrorString("cust_item__ref",errCode,userId); pstmt.setString(2,itemCode);
break; pstmt.setString(3,custItemRef);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1) ;
}
rs.close();
pstmt.close();
pstmt = null;
if( cnt == 0)
{
errCode = "VTCUSTITM";
errString = getErrorString("cust_item__ref",errCode,userId);
break;
}
} }
} //end totqty } //end totqty
}// end for }// end for
......
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