Commit 1a0d47c1 authored by pchavan's avatar pchavan

Add Item Change on Invoice Ref Id.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@186649 ce508802-f39f-4f6c-b175-0d175dae99d5
parent eed884e1
......@@ -317,7 +317,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
double exchRate = 1,totFreeCost = 0,effCostFree = 0;
String analCode = null;
String itemSer = null;
String tranDate = null;
String tranDate = "";
String invDate = null;
String salesPers = null;
String saleOrder = null;
......@@ -407,6 +407,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
String minRateDocKey = "";
boolean isMinHisRateSet = false;
//Added by Santosh on 16/05/2017 [End]
String invRefId = "",invRefDate="" ; //Added By PriyankaC on 14/06/2018.
String shExpDiscAppl="";// Added by Nandkumar Gadkari on 19MAR2018
try
{
......@@ -5538,6 +5539,69 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
//dw_detedit[ii_currformno].SetItem(1,"tare_weight", lc_tare_wt)
}
// Added By PriyankaC to set Reference Date. on 14JUNE2018
else if (currentColumn.trim().equals( "invoice_ref" ))
{
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 ) )
{
sqlStr = "select tran_date from invoice where INVOICE_ID = ? "; //trim(:ls_itemcode);
pstmt = conn.prepareStatement( sqlStr );
pstmt.setString( 1, invRef );
rs = pstmt.executeQuery();
if( rs.next() )
{
tranDate = checkNull(sdf.format(rs.getTimestamp("tran_date")));
}
System.out.println("tranDate : " +tranDate);
if( rs != null )
rs.close();
rs = null;
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
{
String docKey = checkNull(genericUtility.getColumnValue( "doc_key", dom ));
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>");
}
}
}
}
// Added By PriyankaC on 14JUNE2018 [END]
valueXmlString.append("</Detail2>");
break;
......@@ -9548,6 +9612,15 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
return value;
}
private String checkNullTrim(String input)
{
System.out.println("input Date : " +input);
if (input == null)
{
input="";
}
return input;
}
private String checkNull(String input)
{
if (input == null)
......
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