Commit 6c66ce05 authored by pshinde's avatar pshinde

Changes in Automatic Payment scheduler code


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98497 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cd13ee15
...@@ -786,7 +786,7 @@ System.out.println("Getting winName============"+windowName); ...@@ -786,7 +786,7 @@ System.out.println("Getting winName============"+windowName);
pstmt = null; pstmt = null;
System.out.println("currCodeBc=========="+currCodeBc); System.out.println("currCodeBc=========="+currCodeBc);
sql="select std_exrt from currency where curr_code =? "; /*sql="select std_exrt from currency where curr_code =? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,currCodeBc); pstmt.setString(1,currCodeBc);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -799,12 +799,15 @@ System.out.println("Getting winName============"+windowName); ...@@ -799,12 +799,15 @@ System.out.println("Getting winName============"+windowName);
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("excRateBc=========="+excRateBc); System.out.println("excRateBc=========="+excRateBc);*/
mexrate=fin.getDailyExchRateSellBuy(currCode, "", siteCode, payDate, "B", conn);//through itemchange mexrate=fin.getDailyExchRateSellBuy(currCode, "", siteCode, payDate, "B", conn);//through itemchange
System.out.println("ExcRate from getDailyExchRateSellBuy========="+mexrate); System.out.println("ExcRate from getDailyExchRateSellBuy========="+mexrate);
excRateBc=fin.getDailyExchRateSellBuy(currCodeBc, "", siteCode, payDate, "B", conn);//through itemchange
System.out.println("excRateBc from getDailyExchRateSellBuy========="+excRateBc);
//changes for grouping on 25/05/15 //changes for grouping on 25/05/15
...@@ -1230,6 +1233,9 @@ System.out.println("Getting winName============"+windowName); ...@@ -1230,6 +1233,9 @@ System.out.println("Getting winName============"+windowName);
System.out.println("cctr_code__ap========="+cctrCode); System.out.println("cctr_code__ap========="+cctrCode);
double payAmount=Double.parseDouble(payAmt); double payAmount=Double.parseDouble(payAmt);
double exchRate1=Double.parseDouble(exchRate); double exchRate1=Double.parseDouble(exchRate);
System.out.println("payAmount==="+payAmount);
System.out.println("exchRate1==="+exchRate1);
System.out.println("mexrate==="+mexrate);
diffAmt=((payAmount * exchRate1)-(payAmount*mexrate)); diffAmt=((payAmount * exchRate1)-(payAmount*mexrate));
System.out.println("diff_amt__exch========="+diffAmt); System.out.println("diff_amt__exch========="+diffAmt);
...@@ -1247,7 +1253,7 @@ System.out.println("Getting winName============"+windowName); ...@@ -1247,7 +1253,7 @@ System.out.println("Getting winName============"+windowName);
tempMap.put("curr_code", currCode); tempMap.put("curr_code", currCode);
tempMap.put("exch_rate__vouch", exchRate); tempMap.put("exch_rate__vouch", exchRate);
tempMap.put("diff_amt__exch", payAmt); tempMap.put("diff_amt__exch", diffAmt);
tempMap.put("acct_code__ap", acctCode); tempMap.put("acct_code__ap", acctCode);
tempMap.put("cctr_code__ap", cctrCode); tempMap.put("cctr_code__ap", cctrCode);
...@@ -1309,7 +1315,8 @@ System.out.println("Getting winName============"+windowName); ...@@ -1309,7 +1315,8 @@ System.out.println("Getting winName============"+windowName);
sql+=" curr_code= ? " + sql+=" curr_code= ? " +
"and site_code= ? " + "and site_code= ? " +
"and misc_payables.tot_amt - (case when misc_payables.adj_amt is null then 0 else misc_payables.adj_amt end) - (case when misc_payables.hold_amt is null then 0 else misc_payables.hold_amt end) < 0 order by due_date"; "and misc_payables.tot_amt - (case when misc_payables.adj_amt is null then 0 else misc_payables.adj_amt end) - (case when misc_payables.hold_amt is null then 0 else misc_payables.hold_amt end) < 0" +
"AND tran_ser NOT in('P-ADV','M-ADV') order by due_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1337,7 +1344,8 @@ System.out.println("Getting winName============"+windowName); ...@@ -1337,7 +1344,8 @@ System.out.println("Getting winName============"+windowName);
unAppNegativeAmt=0; unAppNegativeAmt=0;
System.out.println("1465Sundry Code===="+sundryCode+"Refr No===="+refNo+"Due Date===="+dueDatediff+"pay_amt==="+pay_amt); System.out.println("1465Sundry Code===="+sundryCode+"Refr No===="+refNo+"Due Date===="+dueDatediff+"pay_amt==="+pay_amt);
sql= " select sum(b.net_amt) as unconfirm_amt from misc_payment a,misc_paydet b "+
sql= " select sum(b.net_amt) as unconfirm_amt1 from misc_payment a,misc_paydet b "+
" where a.tran_id=b.tran_id and "+ " where a.tran_id=b.tran_id and "+
" b.tran_ser=? and "+ " b.tran_ser=? and "+
" b.vouch_no= ? "+ " b.vouch_no= ? "+
...@@ -1350,21 +1358,25 @@ System.out.println("Getting winName============"+windowName); ...@@ -1350,21 +1358,25 @@ System.out.println("Getting winName============"+windowName);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next())
{ {
unAppNegativeAmt = rs1.getDouble("unconfirm_amt"); unAppNegativeAmt = rs1.getDouble("unconfirm_amt1");
System.out.println("Unconfirmed Negative Amt**==="+unAppNegativeAmt+"Ref No**===="+refNo);
} }
else /* else
{ {
unAppNegativeAmt = 0d; unAppNegativeAmt = 0d;
} }*/
pstmt1.close(); pstmt1.close();
pstmt1=null; pstmt1=null;
rs1.close(); rs1.close();
rs1=null; rs1=null;
System.out.println("Unconfirmed Negative Amt==="+unAppNegativeAmt+"Ref No===="+refNo); System.out.println("Unconfirmed Negative Amt==="+unAppNegativeAmt+"Ref No===="+refNo);
//pay_amt = pay_amt - unAppNegativeAmt;
//totamount=totamount-unAppNegativeAmt;
pay_amt = pay_amt - unAppNegativeAmt; pay_amt = pay_amt - unAppNegativeAmt;
totamount=totamount-unAppNegativeAmt; totamount=totamount- unAppNegativeAmt;
System.out.println("pay amt===="+pay_amt);
System.out.println("totamount===="+totamount);
//sundryCdSpilt=sundryCodeNeg; //sundryCdSpilt=sundryCodeNeg;
//System.out.println("Getting sundryCdSpilt===== "+sundryCdSpilt); //System.out.println("Getting sundryCdSpilt===== "+sundryCdSpilt);
...@@ -1551,7 +1563,7 @@ System.out.println("Getting winName============"+windowName); ...@@ -1551,7 +1563,7 @@ System.out.println("Getting winName============"+windowName);
tempMapNeg.put("curr_code", currCode); tempMapNeg.put("curr_code", currCode);
tempMapNeg.put("exch_rate__vouch", exchRate); tempMapNeg.put("exch_rate__vouch", exchRate);
tempMapNeg.put("diff_amt__exch", pay_amt); tempMapNeg.put("diff_amt__exch", diffAmt);
tempMapNeg.put("acct_code__ap", acctCode); tempMapNeg.put("acct_code__ap", acctCode);
tempMapNeg.put("cctr_code__ap", cctrCode); tempMapNeg.put("cctr_code__ap", cctrCode);
...@@ -1675,8 +1687,8 @@ System.out.println("Getting winName============"+windowName); ...@@ -1675,8 +1687,8 @@ System.out.println("Getting winName============"+windowName);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
chq1= checkNull(rs.getString(1)); chq1= checkNull(rs.getString(1)).trim();
chq2= checkNull(rs.getString(2)); chq2= checkNull(rs.getString(2)).trim();
} }
rs.close(); rs.close();
...@@ -1691,7 +1703,7 @@ System.out.println("Getting winName============"+windowName); ...@@ -1691,7 +1703,7 @@ System.out.println("Getting winName============"+windowName);
{ {
if(Integer.parseInt(chq1)>Integer.parseInt(chq2)) if(Integer.parseInt(chq1)>Integer.parseInt(chq2))
{ {
maxRefNo=""+Integer.parseInt(chq1)+1; maxRefNo=""+(Integer.parseInt(chq1)+1);
} }
} }
...@@ -1850,7 +1862,7 @@ System.out.println("Getting winName============"+windowName); ...@@ -1850,7 +1862,7 @@ System.out.println("Getting winName============"+windowName);
System.out.println("temp pay_amt========"+(String)tempMap.get("pay_amt")); System.out.println("temp pay_amt========"+(String)tempMap.get("pay_amt"));
System.out.println("temp curr_code========"+(String)tempMap.get("curr_code")); System.out.println("temp curr_code========"+(String)tempMap.get("curr_code"));
System.out.println("temp exch_rate__vouch========"+(String)tempMap.get("exch_rate__vouch")); System.out.println("temp exch_rate__vouch========"+(String)tempMap.get("exch_rate__vouch"));
System.out.println("temp diff_amt__exch========"+(String)tempMap.get("diff_amt__exch")); System.out.println("temp diff_amt__exch========"+(Double)tempMap.get("diff_amt__exch"));
System.out.println("temp acct_code__ap========"+(String)tempMap.get("acct_code__ap")); System.out.println("temp acct_code__ap========"+(String)tempMap.get("acct_code__ap"));
...@@ -1883,9 +1895,10 @@ System.out.println("Getting winName============"+windowName); ...@@ -1883,9 +1895,10 @@ System.out.println("Getting winName============"+windowName);
xmlString.append("<net_amt><![CDATA["+ tempMap.get("net_amt") +"]]></net_amt>"); xmlString.append("<net_amt><![CDATA["+ tempMap.get("net_amt") +"]]></net_amt>");
xmlString.append("<pay_amt><![CDATA["+ tempMap.get("pay_amt") +"]]></pay_amt>"); xmlString.append("<pay_amt><![CDATA["+ tempMap.get("pay_amt") +"]]></pay_amt>");
xmlString.append("<curr_code><![CDATA["+ tempMap.get("curr_code") +"]]></curr_code>"); xmlString.append("<curr_code><![CDATA["+ tempMap.get("curr_code") +"]]></curr_code>");
xmlString.append("<exch_rate__vouch><![CDATA["+ tempMap.get("exch_rate__vouch") +"]]></exch_rate__vouch>"); xmlString.append("<exch_rate__vouch><![CDATA["+ tempMap.get("exch_rate") +"]]></exch_rate__vouch>");
//xmlString.append("<exch_rate__vouch><![CDATA["+ mexrate +"]]></exch_rate__vouch>");
//xmlString.append("<diff_amt__exch><![CDATA["+ tempMap.get("diff_amt__exch") +"]]></diff_amt__exch>"); xmlString.append("<diff_amt__exch><![CDATA["+ tempMap.get("diff_amt__exch") +"]]></diff_amt__exch>");
xmlString.append("<acct_code__ap><![CDATA["+ tempMap.get("acct_code__ap") +"]]></acct_code__ap>"); xmlString.append("<acct_code__ap><![CDATA["+ tempMap.get("acct_code__ap") +"]]></acct_code__ap>");
xmlString.append("<cctr_code__ap><![CDATA["+ tempMap.get("cctr_code__ap") +"]]></cctr_code__ap>"); xmlString.append("<cctr_code__ap><![CDATA["+ tempMap.get("cctr_code__ap") +"]]></cctr_code__ap>");
xmlString.append("<sundry_type><![CDATA["+ tempMap.get("sundry_type") +"]]></sundry_type>"); xmlString.append("<sundry_type><![CDATA["+ tempMap.get("sundry_type") +"]]></sundry_type>");
...@@ -1903,7 +1916,7 @@ System.out.println("Getting winName============"+windowName); ...@@ -1903,7 +1916,7 @@ System.out.println("Getting winName============"+windowName);
xmlString.append("<bill_no><![CDATA["+ tempMap.get("bill_no") +"]]></bill_no>"); xmlString.append("<bill_no><![CDATA["+ tempMap.get("bill_no") +"]]></bill_no>");
xmlString.append("<bill_date><![CDATA["+ tempMap.get("bill_date") +"]]></bill_date>"); xmlString.append("<bill_date><![CDATA["+ tempMap.get("bill_date") +"]]></bill_date>");
xmlString.append("<exch_rate><![CDATA["+ tempMap.get("exch_rate") +"]]></exch_rate>"); xmlString.append("<exch_rate><![CDATA["+ mexrate +"]]></exch_rate>");
xmlString.append("<discount_amt><![CDATA["+ tempMap.get("discount_amt") +"]]></discount_amt>"); xmlString.append("<discount_amt><![CDATA["+ tempMap.get("discount_amt") +"]]></discount_amt>");
xmlString.append("<discount><![CDATA["+ tempMap.get("discount") +"]]></discount>"); xmlString.append("<discount><![CDATA["+ tempMap.get("discount") +"]]></discount>");
xmlString.append("<tot_amt><![CDATA["+ tempMap.get("tot_amt") +"]]></tot_amt>"); xmlString.append("<tot_amt><![CDATA["+ tempMap.get("tot_amt") +"]]></tot_amt>");
...@@ -2001,24 +2014,27 @@ System.out.println("Getting winName============"+windowName); ...@@ -2001,24 +2014,27 @@ System.out.println("Getting winName============"+windowName);
tempListNeg.set(itemCtr1, tempMapNegNew); tempListNeg.set(itemCtr1, tempMapNegNew);
System.out.println("tempListNeg.size() after==== "+tempListNeg); System.out.println("tempListNeg.size() after==== "+tempListNeg);
xmlString.append("<curr_code><![CDATA["+ tempMapNeg.get("curr_code") +"]]></curr_code>"); xmlString.append("<curr_code><![CDATA["+ tempMapNeg.get("curr_code") +"]]></curr_code>");
xmlString.append("<exch_rate__vouch><![CDATA["+ tempMap.get("exch_rate__vouch") +"]]></exch_rate__vouch>"); //xmlString.append("<exch_rate__vouch><![CDATA["+ tempMapNeg.get("exch_rate__vouch") +"]]></exch_rate__vouch>");
xmlString.append("<exch_rate__vouch><![CDATA["+ tempMapNeg.get("exch_rate") +"]]></exch_rate__vouch>");
xmlString.append("<diff_amt__exch><![CDATA["+ tempMapNeg.get("diff_amt__exch") +"]]></diff_amt__exch>");
//xmlString.append("<diff_amt__exch><![CDATA["+ tempMap.get("diff_amt__exch") +"]]></diff_amt__exch>"); //xmlString.append("<diff_amt__exch><![CDATA["+ tempMap.get("diff_amt__exch") +"]]></diff_amt__exch>");
xmlString.append("<acct_code__ap><![CDATA["+ tempMap.get("acct_code__ap") +"]]></acct_code__ap>"); xmlString.append("<acct_code__ap><![CDATA["+ tempMapNeg.get("acct_code__ap") +"]]></acct_code__ap>");
xmlString.append("<cctr_code__ap><![CDATA["+ tempMap.get("cctr_code__ap") +"]]></cctr_code__ap>"); xmlString.append("<cctr_code__ap><![CDATA["+ tempMapNeg.get("cctr_code__ap") +"]]></cctr_code__ap>");
xmlString.append("<sundry_type><![CDATA["+ tempMapNeg.get("sundry_type") +"]]></sundry_type>"); xmlString.append("<sundry_type><![CDATA["+ tempMapNeg.get("sundry_type") +"]]></sundry_type>");
xmlString.append("<sundry_code><![CDATA["+ tempMapNeg.get("sundry_code") +"]]></sundry_code>"); xmlString.append("<sundry_code><![CDATA["+ tempMapNeg.get("sundry_code") +"]]></sundry_code>");
xmlString.append("<bank_charges><![CDATA["+ tempMapNeg.get("bank_charges") +"]]></bank_charges>"); xmlString.append("<bank_charges><![CDATA["+ tempMapNeg.get("bank_charges") +"]]></bank_charges>");
xmlString.append("<stan_code><![CDATA["+ tempMap.get("stan_code") +"]]></stan_code>"); xmlString.append("<stan_code><![CDATA["+ tempMapNeg.get("stan_code") +"]]></stan_code>");
xmlString.append("<drawn_at><![CDATA["+ tempMapNeg.get("drawn_at") +"]]></drawn_at>"); xmlString.append("<drawn_at><![CDATA["+ tempMapNeg.get("drawn_at") +"]]></drawn_at>");
//xmlString.append("<tax_amt><![CDATA["+ tempMapNeg.get("tax_amt") +"]]></tax_amt>"); //xmlString.append("<tax_amt><![CDATA["+ tempMapNeg.get("tax_amt") +"]]></tax_amt>");
xmlString.append("<acct_code__disc><![CDATA["+ tempMap.get("acct_code__disc") +"]]></acct_code__disc>"); xmlString.append("<acct_code__disc><![CDATA["+ tempMapNeg.get("acct_code__disc") +"]]></acct_code__disc>");
xmlString.append("<cctr_code__disc><![CDATA["+ tempMap.get("cctr_code__disc") +"]]></cctr_code__disc>"); xmlString.append("<cctr_code__disc><![CDATA["+ tempMapNeg.get("cctr_code__disc") +"]]></cctr_code__disc>");
xmlString.append("<tax_env><![CDATA["+ checkNull(tempMap.get("tax_env")==null ? "":tempMap.get("tax_env").toString())+"]]></tax_env>"); xmlString.append("<tax_env><![CDATA["+ checkNull(tempMap.get("tax_env")==null ? "":tempMap.get("tax_env").toString())+"]]></tax_env>");
xmlString.append("<bill_no><![CDATA["+ tempMap.get("bill_no") +"]]></bill_no>"); xmlString.append("<bill_no><![CDATA["+ tempMapNeg.get("bill_no") +"]]></bill_no>");
xmlString.append("<bill_date><![CDATA["+ tempMap.get("bill_date") +"]]></bill_date>"); xmlString.append("<bill_date><![CDATA["+ tempMapNeg.get("bill_date") +"]]></bill_date>");
xmlString.append("<exch_rate><![CDATA["+ tempMapNeg.get("exch_rate") +"]]></exch_rate>"); xmlString.append("<exch_rate><![CDATA["+ tempMapNeg.get("exch_rate") +"]]></exch_rate>");
//xmlString.append("<discount_amt><![CDATA["+ tempMapNeg.get("discount_amt") +"]]></discount_amt>"); //xmlString.append("<discount_amt><![CDATA["+ tempMapNeg.get("discount_amt") +"]]></discount_amt>");
...@@ -2099,6 +2115,27 @@ System.out.println("Getting winName============"+windowName); ...@@ -2099,6 +2115,27 @@ System.out.println("Getting winName============"+windowName);
System.out.println("tranId before commit--"+tranId); System.out.println("tranId before commit--"+tranId);
if (retString.indexOf("Success") > -1 ) if (retString.indexOf("Success") > -1 )
{ {
System.out.println("After Save======"+retString.toString());
String[] arrayForTranId = retString.split("<TranID>");
System.out.println(">>>In AutoPmtGenPrc arrayForTranId:["+arrayForTranId.toString()+"]arrayForTranId.length["+arrayForTranId.length+"]");
if( arrayForTranId.length > 1 )
{
int endIndex = arrayForTranId[1].indexOf("</TranID>");
autoPaymTranId = arrayForTranId[1].substring(0,endIndex);
}
System.out.println(">>>In autoPaym Generated new Tran ID:"+autoPaymTranId);
sql="UPDATE MISC_PAYMENT SET WF_STATUS= ? WHERE TRAN_ID=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,wfStatus);
pstmt.setString(2,autoPaymTranId);
pstmt.executeUpdate();
//conn.commit();
pstmt.close();
pstmt = null;
conn.commit(); conn.commit();
System.out.println("--transaction commited--"); System.out.println("--transaction commited--");
} }
...@@ -2114,15 +2151,6 @@ System.out.println("Getting winName============"+windowName); ...@@ -2114,15 +2151,6 @@ System.out.println("Getting winName============"+windowName);
} }
} }
cntXml++; cntXml++;
System.out.println("After Save======"+retString.toString());
String[] arrayForTranId = retString.split("<TranID>");
System.out.println(">>>In AutoPmtGenPrc arrayForTranId:["+arrayForTranId.toString()+"]arrayForTranId.length["+arrayForTranId.length+"]");
if( arrayForTranId.length > 1 )
{
int endIndex = arrayForTranId[1].indexOf("</TranID>");
autoPaymTranId = arrayForTranId[1].substring(0,endIndex);
}
System.out.println(">>>In autoPaym Generated new Tran ID:"+autoPaymTranId);
System.out.println("**********SUCCESS***********"); System.out.println("**********SUCCESS***********");
endDate = new java.util.Date(System.currentTimeMillis()); endDate = new java.util.Date(System.currentTimeMillis());
......
...@@ -12,6 +12,8 @@ import java.io.File; ...@@ -12,6 +12,8 @@ import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.sql.*; import java.sql.*;
import org.w3c.dom.*; import org.w3c.dom.*;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.system.config.*; import ibase.system.config.*;
...@@ -199,14 +201,20 @@ public class AutoPmtPrcSch implements Schedule ...@@ -199,14 +201,20 @@ public class AutoPmtPrcSch implements Schedule
String strToWrite = ""; String strToWrite = "";
String endDateStr = null; String endDateStr = null;
String errString =""; String errString ="";
int cnt=0;
String errorType = "";
String childNodeName = null;
boolean flag=false; boolean flag=false;
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
String errCode="";
java.util.Date startDate = new java.util.Date(System.currentTimeMillis()); java.util.Date startDate = new java.util.Date(System.currentTimeMillis());
java.util.Date endDate = new java.util.Date(System.currentTimeMillis()); java.util.Date endDate = new java.util.Date(System.currentTimeMillis());
ArrayList<String> sundryCodeList = new ArrayList<String>(); ArrayList<String> sundryCodeList = new ArrayList<String>();
AutoPmtGenPrc aPayPrc=new AutoPmtGenPrc(); AutoPmtGenPrc aPayPrc=new AutoPmtGenPrc();
FinCommon fin =new FinCommon(); FinCommon fin =new FinCommon();
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
try try
{ {
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
...@@ -236,19 +244,43 @@ public class AutoPmtPrcSch implements Schedule ...@@ -236,19 +244,43 @@ public class AutoPmtPrcSch implements Schedule
System.out.println("XTRAPARAMS@@@@@@@@@@@######:"+xtraParams); System.out.println("XTRAPARAMS@@@@@@@@@@@######:"+xtraParams);
sql="select bank_code from site where site_code = ? ";
sql="select count(1) from bank where site_code = ? and bank_code=? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode); pstmt.setString(1,siteCode);
pstmt.setString(2,bankCod);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
bankCode=rs.getString("bank_code"); cnt=rs.getInt(1);
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(cnt==0)
{
/*errCode = "VMBANKMIS1 ";
errList.add(errCode);
errFields.add("bank_code".toLowerCase());*/
errString = itmDBAccessLocal.getErrorString("","VMBANKMIS1","");
return errString;
}
/* sql="select bank_code from site where site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
bankCode=rs.getString("bank_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;*/
bankCode=bankCod;
sql = "SELECT BANK_NAME,chq1,chq3 FROM BANK WHERE BANK_CODE = ?"; sql = "SELECT BANK_NAME,chq1,chq3 FROM BANK WHERE BANK_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -521,6 +553,47 @@ public class AutoPmtPrcSch implements Schedule ...@@ -521,6 +553,47 @@ public class AutoPmtPrcSch implements Schedule
} }
private String errorType(Connection conn , String errorCode)
{
String msgType = "";
PreparedStatement pstmt = null ;
ResultSet rs = null;
try
{
String sql = " SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
while(rs.next())
{
msgType = rs.getString("MSG_TYPE");
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
return msgType;
}
} }
...@@ -1489,6 +1489,9 @@ public class FinCommon ...@@ -1489,6 +1489,9 @@ public class FinCommon
if (rs.next()) if (rs.next())
{ {
lc_exch_rate = rs.getDouble(1); lc_exch_rate = rs.getDouble(1);
}
rs.close(); rs = null;
pstmt.close(); pstmt = null; // ADDED BY ALKA
if (lc_exch_rate == 0) if (lc_exch_rate == 0)
{ {
sql = "SELECT EXCH_RATE FROM DAILY_EXCH_RATE_SELL_BUY WHERE CURR_CODE = '"+ls_curr_code__to.trim()+"' AND CURR_CODE__TO = '"+as_curr_code.trim()+"' AND ? BETWEEN FROM_DATE AND TO_DATE"; sql = "SELECT EXCH_RATE FROM DAILY_EXCH_RATE_SELL_BUY WHERE CURR_CODE = '"+ls_curr_code__to.trim()+"' AND CURR_CODE__TO = '"+as_curr_code.trim()+"' AND ? BETWEEN FROM_DATE AND TO_DATE";
...@@ -1506,9 +1509,7 @@ public class FinCommon ...@@ -1506,9 +1509,7 @@ public class FinCommon
rs1.close(); rs1 = null; rs1.close(); rs1 = null;
pstmt1.close(); pstmt1 = null; pstmt1.close(); pstmt1 = null;
} }
}
rs.close(); rs = null;
pstmt.close(); pstmt = null; // ADDED BY ALKA
} }
catch(SQLException e) catch(SQLException e)
{ {
...@@ -1558,6 +1559,9 @@ public class FinCommon ...@@ -1558,6 +1559,9 @@ public class FinCommon
if (rs.next()) if (rs.next())
{ {
lc_exch_rate = rs.getDouble(1); lc_exch_rate = rs.getDouble(1);
}
rs.close(); rs = null;
pstmt.close(); pstmt = null; // ADDED BY ALKA
if (lc_exch_rate == 0) if (lc_exch_rate == 0)
{ {
sql = "SELECT EXCH_RATE FROM DAILY_EXCH_RATE_SELL_BUY WHERE CURR_CODE = '"+ls_curr_code__to.trim()+"' AND CURR_CODE__TO = '"+as_curr_code.trim()+"' AND ? BETWEEN FROM_DATE AND TO_DATE"; sql = "SELECT EXCH_RATE FROM DAILY_EXCH_RATE_SELL_BUY WHERE CURR_CODE = '"+ls_curr_code__to.trim()+"' AND CURR_CODE__TO = '"+as_curr_code.trim()+"' AND ? BETWEEN FROM_DATE AND TO_DATE";
...@@ -1575,9 +1579,7 @@ public class FinCommon ...@@ -1575,9 +1579,7 @@ public class FinCommon
rs1.close(); rs1 = null; rs1.close(); rs1 = null;
pstmt1.close(); pstmt1 = null; pstmt1.close(); pstmt1 = null;
} }
}
rs.close(); rs = null;
pstmt.close(); pstmt = null; // ADDED BY ALKA
} }
catch(SQLException e) catch(SQLException e)
{ {
......
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