Commit 90fd3b10 authored by steurwadkar's avatar steurwadkar

Added by Santosh for DDUK exchange rate


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101083 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 22d3731e
......@@ -12,6 +12,7 @@ import ibase.webitm.ejb.MasterStatefulLocal;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.dis.InvAllocTraceBean;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.reports.utility.XSDParser;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
......@@ -17555,7 +17556,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String dlvAdd3 = "";
String stateCodeDlv = "", countCodeDlv = "";
String exchRate = "";
//Added by Santosh on 01-04-2016 [Start]
String finEntity = "",finCurrCode = "";
ResultSet rs = null;
FinCommon finCommon = new FinCommon();
DistCommon discommon = new DistCommon();
//Added by Santosh on 01-04-2016 [End]
PreparedStatement pstmt = null;
ResultSet rSet = null ;
......@@ -17646,17 +17652,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
status = rSet.getString(14);
dlvAdd3 = rSet.getString(15);
stateCodeDlv = rSet.getString(16);
exchRate = rSet.getString(17);
//Commented by Santosh on 01-04-2016 for Exchange rate
//exchRate = rSet.getString(17);
//Changes made by gulzar on 12/28/2011
dlvCity = rSet.getString("DLV_CITY");
dlvPin = rSet.getString("DLV_PIN");
//tranCode = rSet.getString("TRAN_CODE");
currCodeFrt = rSet.getString("CURR_CODE__FRT");
exchRateFrt = rSet.getDouble("EXCH_RATE__FRT");
//Commented by Santosh on 01-04-2016 for Exchange rate
//exchRateFrt = rSet.getDouble("EXCH_RATE__FRT");
frtAmt = rSet.getDouble("FRT_AMT");
currCodeIns = rSet.getString("CURR_CODE__INS");
exchRateIns = rSet.getDouble("EXCH_RATE__INS");
//Commented by Santosh on 01-04-2016 for Exchange rate
//exchRateIns = rSet.getDouble("EXCH_RATE__INS");
insAmt = rSet.getDouble("INS_AMT");
currCode = rSet.getString("CURR_CODE");
//end changes by gulzar on 12/28/2011
......@@ -17671,6 +17680,79 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmt.close();
pstmt = null;
}
//Added by Santosh on 01-04-2016 for Exchage Rate [Start]
sql = " SELECT FIN_ENTITY FROM SITE WHERE SITE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
rs = pstmt.executeQuery();
while (rs.next())
{
finEntity = checkNull(rs.getString("FIN_ENTITY"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " SELECT CURR_CODE FROM FINENT WHERE FIN_ENTITY = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,finEntity);
rs = pstmt.executeQuery();
while (rs.next())
{
finCurrCode = checkNull(rs.getString("CURR_CODE"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(currCode.equals(finCurrCode))
{
exchRate = "1";
}
else
{
System.out.println("TODAY IS="+currDateStr);
System.out.println("Order Site="+siteCode);
Double exchRateFinn = finCommon.getDailyExchRateSellBuy(currCode.trim(),"",siteCode.trim(),currDateStr.trim(),"S", conn);
if(exchRateFinn != null)
{
exchRateFinn = discommon.getRndamt(exchRateFinn, "R", 0.000001);
}
exchRate = String.valueOf(exchRateFinn);
System.out.println("Exch Rate from FinnCommon="+exchRate);
if(exchRate != null && exchRate.equals(""))
{
sql = "SELECT EXCH_RATE FROM CURRENCY WHERE CURR_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,currCode);
rs = pstmt.executeQuery();
if(rs.next())
{
exchRate = checkNull(rs.getString(1));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
exchRateIns = Double.parseDouble(exchRate);
exchRateFrt = Double.parseDouble(exchRate);
//Added by Santosh on 01-04-2016 for Exchage Rate [End]
/*--Commented and changes below by gulzar on 12/28/2011
insertSql="INSERT INTO DESPATCH(DESP_ID,DESP_DATE, SITE_CODE, SORD_NO, SORD_DATE,"
+"CUST_CODE, CUST_CODE__DLV, DLV_ADD1, DLV_ADD2, COUNT_CODE__DLV, "
......
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