Commit 5cfb27d6 authored by pchavan's avatar pchavan

SET INVOICE REFERENCE AND REFERENCE DATE FROM DOC KEY.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187053 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1922a8b1
......@@ -3355,6 +3355,37 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
isMinHisRateSet = true;
valueXmlString.append("<rate>").append("<![CDATA[" + rate + "]]>").append("</rate>");
valueXmlString.append("<doc_key>").append("<![CDATA[" + minRateDocKey + "]]>").append("</doc_key>");
//Set inv_ref and date [STart]...PriyankaC on 26JUNE2018.
setNodeValue( dom, "doc_key", minRateDocKey );
String docKey = checkNull(genericUtility.getColumnValue( "doc_key", dom ));
System.out.println("dokkk key : " +docKey);
System.out.println("docKey " +docKey);
if(docKey.trim().length() > 0 || docKey != null )
{
System.out.println("inside dok key1 : " +docKey);
sqlStr = " select INVOICE_ID , INVOICE_DATE from MIN_RATE_HISTORY where DOC_KEY = ? "; //trim(:ls_itemcode);
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, docKey );
rs = pstmt.executeQuery();
if( rs.next() )
{
invRefId = checkNull(rs.getString( "INVOICE_ID" ));
invRefDate = checkNull(sdf.format( rs.getTimestamp( "INVOICE_DATE" )));
}
if( rs != null )
rs.close();
rs = null;
if( pstmt != null )
pstmt.close();
pstmt = null;
valueXmlString.append("<invoice_ref>").append("<![CDATA["+ invRefId +"]]>").append("</invoice_ref>");
if(invRefDate != null && invRefDate.trim().length() >0)
{
valueXmlString.append("<inv_ref_date>").append("<![CDATA["+ invRefDate+"]]>").append("</inv_ref_date>");
}
}
//Set inv_ref and date [End] PriyankaC on 26 June2018
invoiceId = null;
//Commented and changed by Santosh on 16/05/2017 to set invoice id in docKey only [End]
}
......@@ -3385,6 +3416,36 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
isMinHisRateSet = true;
valueXmlString.append("<rate>").append("<![CDATA[" + rate + "]]>").append("</rate>");
valueXmlString.append("<doc_key>").append("<![CDATA[" + minRateDocKey + "]]>").append("</doc_key>");
//Set inv_ref and date [Start]...PriyankaC on 26JUNE2018.
setNodeValue( dom, "doc_key", minRateDocKey );
String docKey = checkNull(genericUtility.getColumnValue( "doc_key", dom ));
System.out.println(" dok key : " +docKey);
if(docKey.trim().length() > 0 || docKey != null )
{
System.out.println("inside dok key : " +docKey);
sqlStr = " select INVOICE_ID , INVOICE_DATE from MIN_RATE_HISTORY where DOC_KEY = ? "; //trim(:ls_itemcode);
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, docKey );
rs = pstmt.executeQuery();
if( rs.next() )
{
invRefId = checkNull(rs.getString( "INVOICE_ID" ));
invRefDate = checkNull(sdf.format( rs.getTimestamp( "INVOICE_DATE" )));
}
if( rs != null )
rs.close();
rs = null;
if( pstmt != null )
pstmt.close();
pstmt = null;
valueXmlString.append("<invoice_ref>").append("<![CDATA["+ invRefId +"]]>").append("</invoice_ref>");
if(invRefDate != null && invRefDate.trim().length() >0)
{
valueXmlString.append("<inv_ref_date>").append("<![CDATA["+ invRefDate+"]]>").append("</inv_ref_date>");
}
}
//Set inv_ref and date [End] PriyankaC on 26 June2018
invoiceId = null;
}
//Added by Santosh on 23/05/2017 to check if invoice_id reference is available in Min_rate_history [End]
......@@ -5546,7 +5607,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
System.out.println("inside invoice ref : " );
String invRef = checkNull(genericUtility.getColumnValue( "invoice_ref", dom ));
invoiceId = genericUtility.getColumnValue("invoice_id", dom1);
if((invoiceId == null || invoiceId.equals("null") || invoiceId.trim().length() == 0 )&& (invRef.trim().length() > 0 || invRef != null ) )
if((invoiceId == null || "null".equals(invoiceId)|| invoiceId.trim().length() == 0 )&& (invRef.trim().length() > 0 || invRef != null ) )
{
sqlStr = "select tran_date from invoice where INVOICE_ID = ? "; //trim(:ls_itemcode);
pstmt = conn.prepareStatement( sqlStr );
......@@ -5564,13 +5625,17 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
if( pstmt != null )
pstmt.close();
pstmt = null;
if((tranDate != null) && tranDate.trim().length() >0 )
{
valueXmlString.append("<inv_ref_date>").append("<![CDATA["+ checkNullTrim(tranDate)+"]]>").append("</inv_ref_date>");
}
else
{
valueXmlString.append("<inv_ref_date>").append("<![CDATA[]]>").append("</inv_ref_date>");
}
}
else
/* else
{
String docKey = checkNull(genericUtility.getColumnValue( "doc_key", dom ));
if(docKey.trim().length() > 0 || docKey != null )
......@@ -5598,7 +5663,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
valueXmlString.append("<inv_ref_date>").append("<![CDATA["+ invRefDate+"]]>").append("</inv_ref_date>");
}
}
}
}*/
}
// Added By PriyankaC on 14JUNE2018 [END]
......
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