Commit 222b4375 authored by kshinde's avatar kshinde

added validation for line_no__invtrace


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187194 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ace0bc84
......@@ -5424,6 +5424,51 @@ public class SReturnForm extends ValidatorEJB implements SReturnFormLocal, SRetu
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
//D18CKOY001 added validation on invoice_trace line no
if( childNodeName.equalsIgnoreCase( "line_no__invtrace" ) )
{
String mlineNoStr = getNumString( genericUtility.getColumnValue( "line_no__invtrace", dom ) );
if (mlineNoStr != null && mlineNoStr.indexOf(".") > 0)
{
mlineNoStr = mlineNoStr.substring(0,mlineNoStr.indexOf("."));
}
mlineNoStr = mlineNoStr == null || mlineNoStr.trim().length() == 0 ? "0" : mlineNoStr.trim();
mlineNo = Integer.parseInt( mlineNoStr.trim() );
mVal1 = genericUtility.getColumnValue( "invoice_id", dom );
if ( mlineNo != 0 )
{
if( mlineNoStr != null && mlineNoStr.trim().length() > 0 && !"null".equalsIgnoreCase( mlineNoStr.trim() ) )
{
sqlStr = " select count(*) cnt from invoice_trace "
+" where invoice_id = ? " //:mval1
+" and line_no = ? ";//:mline_no;
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, mVal1 );
pstmt.setInt( 2, mlineNo );
rs = pstmt.executeQuery();
if( rs.next() )
{
cnt = rs.getInt( "cnt" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0 )
{
errCode = "VTSRET1";
//errString = getErrorString( childNodeName, errCode, userId );
//break;
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}
if( childNodeName.equalsIgnoreCase( "line_no__inv" ) )
{
String mlineNoStr = getNumString( genericUtility.getColumnValue( "line_no__inv", dom ) );
......
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