Commit 3759b910 authored by manohar's avatar manohar

Validation for null tran_date added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93772 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 25f2c393
......@@ -5120,50 +5120,59 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
if( childNodeName.equalsIgnoreCase( "tran_date" ) )
{
String mdateStr = genericUtility.getColumnValue( "tran_date", dom );// dw_edit.getitemdatetime(1,fldname)
mdate1 = Timestamp.valueOf(genericUtility.getValidDateString( mdateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");//getDateInAppFormat( mdateStr );
siteCode = genericUtility.getColumnValue( "site_code", dom ); //dw_edit.getitemstring(1,"site_code")
lsInvoiceId = genericUtility.getColumnValue( "invoice_id", dom ); //dw_edit.getitemstring(1,"invoice_id")
errCode = SysCommon.nfCheckPeriod( "SAL", mdate1, siteCode, conn );
if( errCode != null && errCode.trim().length() > 0 )
{
errList.add( "VMPRD1" );
errFields.add( childNodeName.toLowerCase() );
//errString = getErrorString( childNodeName, errCode, userId );
//break;
}
else
String mdateStr = genericUtility.getColumnValue( "tran_date", dom );// dw_edit.getitemdatetime(1,fldname)
// 14/10/13 manoharan check for null tran_date
if (mdateStr == null)
{
errList.add( "VTTRNDTNUL" );
errFields.add( childNodeName.toLowerCase() );
}
else
{
if( lsInvoiceId != null && lsInvoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( lsInvoiceId.trim() ) )
mdate1 = Timestamp.valueOf(genericUtility.getValidDateString( mdateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");//getDateInAppFormat( mdateStr );
siteCode = genericUtility.getColumnValue( "site_code", dom ); //dw_edit.getitemstring(1,"site_code")
lsInvoiceId = genericUtility.getColumnValue( "invoice_id", dom ); //dw_edit.getitemstring(1,"invoice_id")
errCode = SysCommon.nfCheckPeriod( "SAL", mdate1, siteCode, conn );
if( errCode != null && errCode.trim().length() > 0 )
{
sqlStr = " select tran_date ld_invoice_date "
+" from invoice "
+" where invoice_id = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, lsInvoiceId );
rs = pstmt.executeQuery();
if( rs.next() )
errList.add( "VMPRD1" );
errFields.add( childNodeName.toLowerCase() );
//errString = getErrorString( childNodeName, errCode, userId );
//break;
}
else
{
if( lsInvoiceId != null && lsInvoiceId.trim().length() > 0 && !"null".equalsIgnoreCase( lsInvoiceId.trim() ) )
{
ldInvoiceDate = rs.getTimestamp( "ld_invoice_date" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sqlStr = " select tran_date ld_invoice_date "
+" from invoice "
+" where invoice_id = ? ";
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, lsInvoiceId );
rs = pstmt.executeQuery();
if( rs.next() )
{
ldInvoiceDate = rs.getTimestamp( "ld_invoice_date" );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( ldInvoiceDate != null && mdate1 != null && mdate1.before( ldInvoiceDate ) )
{
errCode = "VTISRDT";
//errString = getErrorString( childNodeName, errCode, userId );
//break;
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
if( ldInvoiceDate != null && mdate1 != null && mdate1.before( ldInvoiceDate ) )
{
errCode = "VTISRDT";
//errString = getErrorString( childNodeName, errCode, userId );
//break;
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}
}
}
if( childNodeName.equalsIgnoreCase( "cust_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