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
custItemRef = genericUtility.getColumnValue("cust_item__ref",dom);
itemCode = genericUtility.getColumnValue("item_code",dom);
custCode = genericUtility.getColumnValue("cust_code",dom1);
sql = " select count(*) "
+ " from customeritem"
+ " where cust_code = ?"
+ " 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())
//msalam - as per kandarp sir on phone - 080809
//Validation required if custItemRef is not null only
if( custItemRef != null && custItemRef.trim().length() > 0 )
{
cnt = rs.getInt(1) ;
}
rs.close();
pstmt.close();
pstmt = null;
if( cnt == 0)
{
errCode = "VTCUSTITM";
errString = getErrorString("cust_item__ref",errCode,userId);
break;
sql = " select count(*) "
+ " from customeritem"
+ " where cust_code = ?"
+ " 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) ;
}
rs.close();
pstmt.close();
pstmt = null;
if( cnt == 0)
{
errCode = "VTCUSTITM";
errString = getErrorString("cust_item__ref",errCode,userId);
break;
}
}
} //end totqty
}// 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