Commit 6e73ce5f authored by pgole's avatar pgole

Updated finCommon for chg_term and chg_user and exception handling changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102727 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a13358c4
...@@ -30,7 +30,6 @@ public class FinCommon ...@@ -30,7 +30,6 @@ public class FinCommon
ResultSet rs = null; ResultSet rs = null;
Statement stmt = null; Statement stmt = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
java.sql.Timestamp postdate = null;
String closePrd = "zzzzzz"; String closePrd = "zzzzzz";
String cctrCode = ""; String cctrCode = "";
String errCode = ""; String errCode = "";
...@@ -39,7 +38,6 @@ public class FinCommon ...@@ -39,7 +38,6 @@ public class FinCommon
String prdCode = "000000"; //Gulzar 30/11/06 String prdCode = "000000"; //Gulzar 30/11/06
int count =0; int count =0;
int sundrybalCnt = 0; int sundrybalCnt = 0;
double ll_cnt = 0.0;
double exchRate = 0.0; double exchRate = 0.0;
double drAmount = 0.0; double drAmount = 0.0;
double crAmount = 0.0; double crAmount = 0.0;
...@@ -49,7 +47,7 @@ public class FinCommon ...@@ -49,7 +47,7 @@ public class FinCommon
try try
{ {
System.out.println("In SUNDRY-BAL !!!!!!!!!!!!!!!!!!!!!!!!!!"); System.out.println("In SUNDRY-BAL !!!!!!!!!!!!!!!!!!!!!!!!!!"+sundrybalMap.toString());
stmt = conn.createStatement(); stmt = conn.createStatement();
java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf((sundrybalMap.get("tran_date").toString())); java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf((sundrybalMap.get("tran_date").toString()));
String finEntity = (String)sundrybalMap.get("fin_entity"); String finEntity = (String)sundrybalMap.get("fin_entity");
...@@ -59,8 +57,16 @@ public class FinCommon ...@@ -59,8 +57,16 @@ public class FinCommon
String acctCode = (String)sundrybalMap.get("acct_code"); String acctCode = (String)sundrybalMap.get("acct_code");
String acctPrd = (String)sundrybalMap.get("acct_prd"); //Gulzar 30/11/06 String acctPrd = (String)sundrybalMap.get("acct_prd"); //Gulzar 30/11/06
String userId = (String)sundrybalMap.get("user_id"); //Gulzar 30/11/06 String userId = (String)sundrybalMap.get("user_id"); //Gulzar 30/11/06
String chgTerm = (String)sundrybalMap.get("chg_term"); //Added by poonam on 28-07-16
java.sql.Timestamp chgDate = new java.sql.Timestamp(System.currentTimeMillis()); java.sql.Timestamp chgDate = new java.sql.Timestamp(System.currentTimeMillis());
System.out.println("chgTerm in sundrybalOpnUpd"+chgTerm);
if(chgTerm == null || chgTerm.trim().length() == 0)
{
chgTerm = "SYSTEM" ;
}
String sundCctrUpd = getFinparams("999999","SUND_UPD_CCTR",conn); String sundCctrUpd = getFinparams("999999","SUND_UPD_CCTR",conn);
if(sundCctrUpd.trim().equals("NULLFOUND")) if(sundCctrUpd.trim().equals("NULLFOUND"))
{ {
...@@ -122,6 +128,11 @@ public class FinCommon ...@@ -122,6 +128,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sql +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
errCode = se.getMessage();
return errCode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
if (sundrybalCnt == 0) if (sundrybalCnt == 0)
{ {
...@@ -151,7 +162,8 @@ public class FinCommon ...@@ -151,7 +162,8 @@ public class FinCommon
pstmt.setString(15,contactCode); pstmt.setString(15,contactCode);
pstmt.setTimestamp(16,chgDate); pstmt.setTimestamp(16,chgDate);
pstmt.setString(17,userId); pstmt.setString(17,userId);
pstmt.setString(18,userId); //pstmt.setString(18,userId);
pstmt.setString(18,chgTerm); //Changed by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
if(count < 1) if(count < 1)
...@@ -166,6 +178,11 @@ public class FinCommon ...@@ -166,6 +178,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlnstr +se.getMessage()); System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlnstr +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
errCode = se.getMessage();
return errCode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//if }//if
else else
...@@ -188,7 +205,8 @@ public class FinCommon ...@@ -188,7 +205,8 @@ public class FinCommon
pstmt.setDouble(5,advAmount); pstmt.setDouble(5,advAmount);
pstmt.setTimestamp(6,chgDate); pstmt.setTimestamp(6,chgDate);
pstmt.setString(7,userId); pstmt.setString(7,userId);
pstmt.setString(8,userId); //pstmt.setString(8,userId);
pstmt.setString(8,chgTerm); //Changed by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
if(count < 1) if(count < 1)
{ {
...@@ -202,6 +220,11 @@ public class FinCommon ...@@ -202,6 +220,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlUpd +se.getMessage()); System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlUpd +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
errCode = se.getMessage();
return errCode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//else }//else
try try
...@@ -227,6 +250,11 @@ public class FinCommon ...@@ -227,6 +250,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sql +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
errCode = se.getMessage();
return errCode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
if (sundrybalCnt == 0 ) if (sundrybalCnt == 0 )
{ {
...@@ -256,7 +284,8 @@ public class FinCommon ...@@ -256,7 +284,8 @@ public class FinCommon
pstmt.setString(15,contactCode); pstmt.setString(15,contactCode);
pstmt.setTimestamp(16,chgDate); pstmt.setTimestamp(16,chgDate);
pstmt.setString(17,userId); pstmt.setString(17,userId);
pstmt.setString(18,userId); //pstmt.setString(18,userId);
pstmt.setString(18,chgTerm); //Changed by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
if(count < 1) if(count < 1)
...@@ -271,6 +300,11 @@ public class FinCommon ...@@ -271,6 +300,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlnstr +se.getMessage()); System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlnstr +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
errCode = se.getMessage();
return errCode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//if }//if
else else
...@@ -293,7 +327,8 @@ public class FinCommon ...@@ -293,7 +327,8 @@ public class FinCommon
pstmt.setDouble(5,advAmount); pstmt.setDouble(5,advAmount);
pstmt.setTimestamp(6,chgDate); pstmt.setTimestamp(6,chgDate);
pstmt.setString(7,userId); pstmt.setString(7,userId);
pstmt.setString(8,userId); //pstmt.setString(8,userId);
pstmt.setString(8,chgTerm);//Changed by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
if(count < 1) if(count < 1)
{ {
...@@ -307,6 +342,11 @@ public class FinCommon ...@@ -307,6 +342,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlUpd +se.getMessage()); System.out.println("SQLException []:sundrybalOpnUpd()[Excuting Query Failed]" + sqlUpd +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
errCode = se.getMessage();
return errCode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//else }//else
break; break;
...@@ -342,7 +382,7 @@ public class FinCommon ...@@ -342,7 +382,7 @@ public class FinCommon
return (errCode); return (errCode);
}//sundrybalOpnUpd() }//sundrybalOpnUpd()
public String acctbalOpnUpd(HashMap acctbalMap, Connection conn)throws ITMException public String acctbalOpnUpd(HashMap acctbalMap, Connection conn)throws ITMException, SQLException
{ {
String retString = ""; String retString = "";
String sql=null; String sql=null;
...@@ -352,21 +392,22 @@ public class FinCommon ...@@ -352,21 +392,22 @@ public class FinCommon
String ls_errcode = ""; String ls_errcode = "";
String prdCode = "000000"; String prdCode = "000000";
String closePrd ="zzzzzz"; String closePrd ="zzzzzz";
String refSer=""; //String refSer="";
String insertSql = null; //String insertSql = null;
int q =0; int q =0;
int count = 0; int count = 0;
double lc_dramt_base = 0; //double lc_dramt_base = 0;
double lc_cramt_base =0; //double lc_cramt_base =0;
int ll_cnt = 0; int ll_cnt = 0;
double lc_dramt = 0; //double lc_dramt = 0;
double lc_cramt = 0; //double lc_cramt = 0;
double lc_advamt = 0; //double lc_advamt = 0;
double lc_cramt_b = 0; double lc_cramt_b = 0;
double lc_dramt_b = 0; double lc_dramt_b = 0;
try try
{ {
System.out.println("Inside acctbalOpnUpd...."+acctbalMap.toString());
stmt = conn.createStatement(); stmt = conn.createStatement();
String acctVar_contactcode = (String)acctbalMap.get("contact_code"); String acctVar_contactcode = (String)acctbalMap.get("contact_code");
String acctVar_finentity = (String)acctbalMap.get("fin_entity"); String acctVar_finentity = (String)acctbalMap.get("fin_entity");
...@@ -377,12 +418,21 @@ public class FinCommon ...@@ -377,12 +418,21 @@ public class FinCommon
String acctVar_empcode = (String)acctbalMap.get("emp_code"); String acctVar_empcode = (String)acctbalMap.get("emp_code");
String userId = (String)acctbalMap.get("user_id"); String userId = (String)acctbalMap.get("user_id");
String acctPrd = (String)acctbalMap.get("acct_prd"); String acctPrd = (String)acctbalMap.get("acct_prd");
String chgTerm = (String)acctbalMap.get("chg_term"); //Added by poonam on 28-07-16 for chg_term from map
System.out.println("chgTerm in sundrybalOpnUpd"+chgTerm);
if(chgTerm == null || chgTerm.trim().length() == 0)
{
chgTerm = "SYSTEM" ;
}
if (acctVar_cctrcode == null) if (acctVar_cctrcode == null)
{ {
acctVar_cctrcode = " "; acctVar_cctrcode = " ";
} }
java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString()); //java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString());
java.sql.Timestamp acctVar_trandate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString()); //java.sql.Timestamp acctVar_trandate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString());
java.sql.Timestamp acctVar_effdate = java.sql.Timestamp.valueOf(acctbalMap.get("eff_date").toString()); java.sql.Timestamp acctVar_effdate = java.sql.Timestamp.valueOf(acctbalMap.get("eff_date").toString());
java.sql.Timestamp chgDate = new java.sql.Timestamp(System.currentTimeMillis()); java.sql.Timestamp chgDate = new java.sql.Timestamp(System.currentTimeMillis());
...@@ -456,7 +506,8 @@ public class FinCommon ...@@ -456,7 +506,8 @@ public class FinCommon
//pstmt.setTimestamp(12,acctVar_effdate);//Gulzar 01-12-06 //pstmt.setTimestamp(12,acctVar_effdate);//Gulzar 01-12-06
pstmt.setTimestamp(12,chgDate); //Gulzar 01-12-06 pstmt.setTimestamp(12,chgDate); //Gulzar 01-12-06
pstmt.setString(13,userId); pstmt.setString(13,userId);
pstmt.setString(14,userId); //pstmt.setString(14,userId);
pstmt.setString(14,chgTerm); //Changed by poonam on 28-07-16 for chg_term from map
int cnt = pstmt.executeUpdate(); int cnt = pstmt.executeUpdate();
pstmt.close(); pstmt = null; // ADDED BY ALKA pstmt.close(); pstmt = null; // ADDED BY ALKA
System.out.println("INSERTED IN ACCTBAL FOR CURRENT PERIODE : " + cnt); System.out.println("INSERTED IN ACCTBAL FOR CURRENT PERIODE : " + cnt);
...@@ -465,6 +516,7 @@ public class FinCommon ...@@ -465,6 +516,7 @@ public class FinCommon
{ {
System.out.println("SQLException []:acctbalOpnUpd()[Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:acctbalOpnUpd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace(); se.printStackTrace();
retString = se.getMessage(); retString = se.getMessage();
return retString; return retString;
} }
...@@ -485,7 +537,8 @@ public class FinCommon ...@@ -485,7 +537,8 @@ public class FinCommon
pstmt.setDouble(4,lc_cramt_b); pstmt.setDouble(4,lc_cramt_b);
pstmt.setTimestamp(5,chgDate); //Gulzar 01-12-06 pstmt.setTimestamp(5,chgDate); //Gulzar 01-12-06
pstmt.setString(6,userId); //Gulzar 01-12-06 pstmt.setString(6,userId); //Gulzar 01-12-06
pstmt.setString(7,userId); //Gulzar 01-12-06 //pstmt.setString(7,userId); //Gulzar 01-12-06
pstmt.setString(7,chgTerm); //Changed by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
pstmt.close(); pstmt = null; // ADDED BY ALKA pstmt.close(); pstmt = null; // ADDED BY ALKA
System.out.println("NO. OF RECORDS UPDATED IN ACCTBAL...(CURRENT) :"+count); System.out.println("NO. OF RECORDS UPDATED IN ACCTBAL...(CURRENT) :"+count);
...@@ -553,7 +606,8 @@ public class FinCommon ...@@ -553,7 +606,8 @@ public class FinCommon
//pstmt.setTimestamp(12,acctVar_effdate); //Gulzar 01-12-06 //pstmt.setTimestamp(12,acctVar_effdate); //Gulzar 01-12-06
pstmt.setTimestamp(12,chgDate); //Gulzar 01-12-06 pstmt.setTimestamp(12,chgDate); //Gulzar 01-12-06
pstmt.setString(13,userId); pstmt.setString(13,userId);
pstmt.setString(14,userId); //pstmt.setString(14,userId);
pstmt.setString(14,chgTerm); //Changed by poonam on 28-07-16 for chg_term from map
int cnt = pstmt.executeUpdate(); int cnt = pstmt.executeUpdate();
pstmt.close(); pstmt = null; // ADDED BY ALKA pstmt.close(); pstmt = null; // ADDED BY ALKA
System.out.println("INSERTED IN ACCTBAL FOR CLOSING BALANCE : " + cnt); System.out.println("INSERTED IN ACCTBAL FOR CLOSING BALANCE : " + cnt);
...@@ -578,7 +632,8 @@ public class FinCommon ...@@ -578,7 +632,8 @@ public class FinCommon
pstmt.setDouble(4,lc_cramt_b); pstmt.setDouble(4,lc_cramt_b);
pstmt.setTimestamp(5,chgDate); //Gulzar 01-12-06 pstmt.setTimestamp(5,chgDate); //Gulzar 01-12-06
pstmt.setString(6,userId); //Gulzar 01-12-06 pstmt.setString(6,userId); //Gulzar 01-12-06
pstmt.setString(7,userId); //Gulzar 01-12-06 //pstmt.setString(7,userId); //Gulzar 01-12-06
pstmt.setString(7,chgTerm); //Changed by poonam on 28-07-16 for chg_term from map
int cnt = pstmt.executeUpdate(); int cnt = pstmt.executeUpdate();
pstmt.close(); pstmt = null; // ADDED BY ALKA pstmt.close(); pstmt = null; // ADDED BY ALKA
System.out.println("NO. OF RECORDS UPDATED IN ACCTBAL...(CLOSING)" + cnt); System.out.println("NO. OF RECORDS UPDATED IN ACCTBAL...(CLOSING)" + cnt);
...@@ -670,7 +725,7 @@ public class FinCommon ...@@ -670,7 +725,7 @@ public class FinCommon
try try
{ {
System.out.println("In SUNDRY-BAL !!!!!!!!!!!!!!!!!!!!!!!!!!"); System.out.println("In SUNDRY-BAL !!!!!!!!!!!!!!!!!!!!!!!!!!"+sundrybalMap.toString());
stmt = conn.createStatement(); stmt = conn.createStatement();
java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf((sundrybalMap.get("tran_date").toString())); java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf((sundrybalMap.get("tran_date").toString()));
String ls_finentity = (String)sundrybalMap.get("fin_entity"); String ls_finentity = (String)sundrybalMap.get("fin_entity");
...@@ -678,7 +733,19 @@ public class FinCommon ...@@ -678,7 +733,19 @@ public class FinCommon
String ls_sundrytype = (String)sundrybalMap.get("sundry_type"); String ls_sundrytype = (String)sundrybalMap.get("sundry_type");
String ls_sundrycode = (String)sundrybalMap.get("sundry_code"); String ls_sundrycode = (String)sundrybalMap.get("sundry_code");
String ls_acctcode = (String)sundrybalMap.get("acct_code"); String ls_acctcode = (String)sundrybalMap.get("acct_code");
String chgTerm = (String)sundrybalMap.get("chg_term"); //Added by poonam on 28-07-16 for chg_term from map
String chgUser = (String)sundrybalMap.get("chg_user"); //Added by poonam on 28-07-16 for chg_term from map
System.out.println("befor chgTerm "+chgTerm + "chgUser" +chgUser);
if(chgTerm == null || chgTerm.trim().length() == 0)
{
chgTerm = "SYSTEM" ;
}
if(chgUser == null || chgUser.trim().length() == 0)
{
chgUser = "SYSTEM" ;
}
System.out.println("gbf_sundrybal_upd chgTerm "+chgTerm + "chgUser" +chgUser);
String ls_cctr_upd = getFinparams("999999","SUND_UPD_CCTR",conn); String ls_cctr_upd = getFinparams("999999","SUND_UPD_CCTR",conn);
if(ls_cctr_upd.trim().equals("NULLFOUND")) if(ls_cctr_upd.trim().equals("NULLFOUND"))
{ {
...@@ -742,6 +809,11 @@ public class FinCommon ...@@ -742,6 +809,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
try try
{ {
...@@ -785,8 +857,10 @@ public class FinCommon ...@@ -785,8 +857,10 @@ public class FinCommon
pstmt.setDouble(14,0); pstmt.setDouble(14,0);
pstmt.setString(15,ls_contactcode); pstmt.setString(15,ls_contactcode);
pstmt.setTimestamp(16,ld_postdate); pstmt.setTimestamp(16,ld_postdate);
pstmt.setString(17,userId); //pstmt.setString(17,userId);
pstmt.setString(18,userId); pstmt.setString(17,chgUser);//Added by poonam on 28-07-16 for chg_term from map
//pstmt.setString(18,userId);
pstmt.setString(18,chgTerm ); //Added by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
pstmt.close(); pstmt = null; // ADDED BY ALKA pstmt.close(); pstmt = null; // ADDED BY ALKA
...@@ -800,12 +874,24 @@ public class FinCommon ...@@ -800,12 +874,24 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlnstr +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlnstr +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
System.out.println("ls_errcode11 28-07-16"+ls_errcode);
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//if }//if
}//outer try }//outer try
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
System.out.println("ls_errcode12 28-07-16"+ls_errcode);
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
try try
...@@ -828,6 +914,11 @@ public class FinCommon ...@@ -828,6 +914,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
if (ll_cnt == 0 ) if (ll_cnt == 0 )
{ {
...@@ -856,8 +947,10 @@ public class FinCommon ...@@ -856,8 +947,10 @@ public class FinCommon
pstmt.setDouble(14,lc_advamt); pstmt.setDouble(14,lc_advamt);
pstmt.setString(15,ls_contactcode); pstmt.setString(15,ls_contactcode);
pstmt.setTimestamp(16,ld_postdate); pstmt.setTimestamp(16,ld_postdate);
pstmt.setString(17,userId); //pstmt.setString(17,userId);
pstmt.setString(18,userId); pstmt.setString(17,chgUser);//Added by poonam on 28-07-16 for chg_term from map
//pstmt.setString(18,userId);
pstmt.setString(18,chgTerm); //Added by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
pstmt.close(); pstmt = null; // ADDED BY ALKA pstmt.close(); pstmt = null; // ADDED BY ALKA
...@@ -871,6 +964,11 @@ public class FinCommon ...@@ -871,6 +964,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlnstr +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlnstr +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//if }//if
else else
...@@ -892,8 +990,10 @@ public class FinCommon ...@@ -892,8 +990,10 @@ public class FinCommon
pstmt.setDouble(4,lc_dramt_b); pstmt.setDouble(4,lc_dramt_b);
pstmt.setDouble(5,lc_advamt); pstmt.setDouble(5,lc_advamt);
pstmt.setTimestamp(6,ld_postdate); pstmt.setTimestamp(6,ld_postdate);
pstmt.setString(7,userId); //pstmt.setString(7,userId);
pstmt.setString(8,userId); //pstmt.setString(8,userId);
pstmt.setString(7,chgUser); //Added by poonam on 28-07-16 for chg_term from map
pstmt.setString(8,chgTerm); //Added by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
pstmt.close(); pstmt = null; // ADDED BY ALKA pstmt.close(); pstmt = null; // ADDED BY ALKA
if(count<1) if(count<1)
...@@ -906,6 +1006,11 @@ public class FinCommon ...@@ -906,6 +1006,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlUpd +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlUpd +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//else }//else
try try
...@@ -928,6 +1033,11 @@ public class FinCommon ...@@ -928,6 +1033,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
if (ll_cnt == 0 ) if (ll_cnt == 0 )
{ {
...@@ -956,8 +1066,10 @@ public class FinCommon ...@@ -956,8 +1066,10 @@ public class FinCommon
pstmt.setDouble(14,lc_advamt); pstmt.setDouble(14,lc_advamt);
pstmt.setString(15,ls_contactcode); pstmt.setString(15,ls_contactcode);
pstmt.setTimestamp(16,ld_postdate); pstmt.setTimestamp(16,ld_postdate);
pstmt.setString(17,userId); //pstmt.setString(17,userId);
pstmt.setString(18,userId); //pstmt.setString(18,userId);
pstmt.setString(17,chgUser);//Added by poonam on 28-07-16 for chg_term from map
pstmt.setString(18,chgTerm);//Added by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
if(count<1) if(count<1)
...@@ -970,6 +1082,11 @@ public class FinCommon ...@@ -970,6 +1082,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlnstr +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlnstr +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//if }//if
else else
...@@ -991,8 +1108,10 @@ public class FinCommon ...@@ -991,8 +1108,10 @@ public class FinCommon
pstmt.setDouble(4,lc_dramt_b); pstmt.setDouble(4,lc_dramt_b);
pstmt.setDouble(5,lc_advamt); pstmt.setDouble(5,lc_advamt);
pstmt.setTimestamp(6,ld_postdate); pstmt.setTimestamp(6,ld_postdate);
pstmt.setString(7,userId); //pstmt.setString(7,userId);
pstmt.setString(8,userId); //pstmt.setString(8,userId);
pstmt.setString(7,chgUser);//Added by poonam on 28-07-16 for chg_user from map
pstmt.setString(8,chgTerm);//Added by poonam on 28-07-16 for chg_term from map
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
if(count<1) if(count<1)
{ {
...@@ -1004,6 +1123,11 @@ public class FinCommon ...@@ -1004,6 +1123,11 @@ public class FinCommon
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlUpd +se.getMessage()); System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sqlUpd +se.getMessage());
//Added by poonam on 28-07-16 for exception handling:Start
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
//Added by poonam on 28-07-16 for exception handling:End
} }
}//else }//else
break; break;
...@@ -1048,8 +1172,9 @@ public class FinCommon ...@@ -1048,8 +1172,9 @@ public class FinCommon
* @param conn Database connection * @param conn Database connection
* @return Error code if fails * @return Error code if fails
* @exception ITMException * @exception ITMException
* @throws SQLException
*/ */
public String gbf_acctbal_upd(HashMap acctbalMap, Connection conn)throws ITMException public String gbf_acctbal_upd(HashMap acctbalMap, Connection conn)throws ITMException, SQLException
{ {
String retString = ""; String retString = "";
String sql=null; String sql=null;
...@@ -1059,24 +1184,22 @@ public class FinCommon ...@@ -1059,24 +1184,22 @@ public class FinCommon
String ls_errcode = ""; String ls_errcode = "";
String ls_openprd = "000000"; String ls_openprd = "000000";
String ls_closeprd ="zzzzzz"; String ls_closeprd ="zzzzzz";
String refSer=""; //String refSer="";
String insertSql = null; //String insertSql = null;
String ls_acctprd = null; String ls_acctprd = null;
String ls_prdcode = null; String ls_prdcode = null;
String ls_prd_code = null; //String ls_prd_code = null;
int q =0; //int q =0;
int count = 0; int count = 0;
double lc_dramt_base = 0; double lc_dramt_base = 0;
double lc_cramt_base =0; double lc_cramt_base =0;
double ll_cnt = 0; double ll_cnt = 0;
double lc_dramt = 0;
double lc_cramt = 0;
double lc_advamt = 0;
double lc_cramt_b = 0; double lc_cramt_b = 0;
double lc_dramt_b = 0; double lc_dramt_b = 0;
try try
{ {
System.out.println("Inside acctbalMap......"+acctbalMap.toString());
stmt = conn.createStatement(); stmt = conn.createStatement();
String acctVar_contactcode = (String)acctbalMap.get("contact_code"); String acctVar_contactcode = (String)acctbalMap.get("contact_code");
String acctVar_finentity = (String)acctbalMap.get("fin_entity"); String acctVar_finentity = (String)acctbalMap.get("fin_entity");
...@@ -1084,10 +1207,17 @@ public class FinCommon ...@@ -1084,10 +1207,17 @@ public class FinCommon
String acctVar_acctcode = (String)acctbalMap.get("acct_code"); String acctVar_acctcode = (String)acctbalMap.get("acct_code");
String acctVar_cctrcode = (String)acctbalMap.get("cctr_code"); String acctVar_cctrcode = (String)acctbalMap.get("cctr_code");
String acctVar_currcode = (String)acctbalMap.get("curr_code"); String acctVar_currcode = (String)acctbalMap.get("curr_code");
String acctVar_empcode = (String)acctbalMap.get("emp_code"); //String acctVar_empcode = (String)acctbalMap.get("emp_code");
String userId = (String)acctbalMap.get("user_id"); String userId = (String)acctbalMap.get("user_id");
String chgTerm = (String)acctbalMap.get("chg_term");
if(chgTerm == null || chgTerm.trim().length() == 0)
{
chgTerm = "SYSTEM" ;
}
System.out.println("acctbalMap chgTerm"+chgTerm + "userId"+userId);
java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString()); java.sql.Timestamp ld_postdate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString());
java.sql.Timestamp acctVar_trandate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString()); //java.sql.Timestamp acctVar_trandate = java.sql.Timestamp.valueOf(acctbalMap.get("tran_date").toString());
java.sql.Timestamp acctVar_effdate = java.sql.Timestamp.valueOf(acctbalMap.get("eff_date").toString()); java.sql.Timestamp acctVar_effdate = java.sql.Timestamp.valueOf(acctbalMap.get("eff_date").toString());
double acctVar_exchrate = ((Double)acctbalMap.get("exch_rate")).doubleValue(); double acctVar_exchrate = ((Double)acctbalMap.get("exch_rate")).doubleValue();
...@@ -1169,7 +1299,8 @@ public class FinCommon ...@@ -1169,7 +1299,8 @@ public class FinCommon
pstmt.setDouble(10,0); pstmt.setDouble(10,0);
pstmt.setTimestamp(11,acctVar_effdate); pstmt.setTimestamp(11,acctVar_effdate);
pstmt.setString(12,userId); pstmt.setString(12,userId);
pstmt.setString(13,userId); //pstmt.setString(13,userId);
pstmt.setString(13,chgTerm);//Added by poonam on 28-07-16 for chg_term from map
pstmt.setString(14,acctVar_sitecode); pstmt.setString(14,acctVar_sitecode);
int cnt = pstmt.executeUpdate(); int cnt = pstmt.executeUpdate();
...@@ -1236,7 +1367,8 @@ public class FinCommon ...@@ -1236,7 +1367,8 @@ public class FinCommon
pstmt.setDouble(11,lc_cramt_base); pstmt.setDouble(11,lc_cramt_base);
pstmt.setTimestamp(12,acctVar_effdate); pstmt.setTimestamp(12,acctVar_effdate);
pstmt.setString(13,userId); pstmt.setString(13,userId);
pstmt.setString(14,userId); //pstmt.setString(14,userId);
pstmt.setString(14,chgTerm);//Added by poonam on 28-07-16 for chg_term from map
int cnt = pstmt.executeUpdate(); int cnt = pstmt.executeUpdate();
System.out.println("INSERTED IN ACCTBAL FOR CURRENT PERIODE : " + cnt); System.out.println("INSERTED IN ACCTBAL FOR CURRENT PERIODE : " + cnt);
...@@ -1299,6 +1431,7 @@ public class FinCommon ...@@ -1299,6 +1431,7 @@ public class FinCommon
if(ll_cnt == 0) if(ll_cnt == 0)
{ {
// insert a record for closing balance // insert a record for closing balance
try{ //poonam
sql="INSERT INTO ACCTBAL (ACCT_PRD, PRD_CODE, FIN_ENTITY, SITE_CODE,ACCT_CODE, CCTR_CODE, CURR_CODE__AC, DR_AMT, CR_AMT,"+ sql="INSERT INTO ACCTBAL (ACCT_PRD, PRD_CODE, FIN_ENTITY, SITE_CODE,ACCT_CODE, CCTR_CODE, CURR_CODE__AC, DR_AMT, CR_AMT,"+
" DR_AMT__BASE, CR_AMT__BASE, CHG_DATE, CHG_USER, CHG_TERM)"+ " DR_AMT__BASE, CR_AMT__BASE, CHG_DATE, CHG_USER, CHG_TERM)"+
" VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,? )"; " VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,? )";
...@@ -1316,7 +1449,8 @@ public class FinCommon ...@@ -1316,7 +1449,8 @@ public class FinCommon
pstmt.setDouble(11,lc_cramt_base); pstmt.setDouble(11,lc_cramt_base);
pstmt.setTimestamp(12,acctVar_effdate); pstmt.setTimestamp(12,acctVar_effdate);
pstmt.setString(13,userId); pstmt.setString(13,userId);
pstmt.setString(14,userId); //pstmt.setString(13,userId);
pstmt.setString(14,chgTerm); //Added by poonam on 28-07-16 for chg_term from map
int cnt = pstmt.executeUpdate(); int cnt = pstmt.executeUpdate();
System.out.println("INSERTED IN ACCTBAL FOR CLOSING BALANCE : " + cnt); System.out.println("INSERTED IN ACCTBAL FOR CLOSING BALANCE : " + cnt);
...@@ -1325,9 +1459,20 @@ public class FinCommon ...@@ -1325,9 +1459,20 @@ public class FinCommon
ls_errcode = "DS000"; ls_errcode = "DS000";
break; break;
} }
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
else else
{ {
try{ //poonam
// update closing in acctbal // update closing in acctbal
sql="UPDATE ACCTBAL SET DR_AMT = (DR_AMT + ( ? )), CR_AMT = (CR_AMT + ( ? )), DR_AMT__BASE = (DR_AMT__BASE + ( ? )), CR_AMT__BASE = (CR_AMT__BASE + ( ? )) "+ sql="UPDATE ACCTBAL SET DR_AMT = (DR_AMT + ( ? )), CR_AMT = (CR_AMT + ( ? )), DR_AMT__BASE = (DR_AMT__BASE + ( ? )), CR_AMT__BASE = (CR_AMT__BASE + ( ? )) "+
"WHERE ACCT_PRD = '"+ls_acctprd+"' AND PRD_CODE = '"+ls_closeprd+"' AND "+ "WHERE ACCT_PRD = '"+ls_acctprd+"' AND PRD_CODE = '"+ls_closeprd+"' AND "+
...@@ -1346,6 +1491,16 @@ public class FinCommon ...@@ -1346,6 +1491,16 @@ public class FinCommon
ls_errcode = "DS000"; ls_errcode = "DS000";
break; break;
} }
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
ls_errcode = se.getMessage();
return ls_errcode ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
break; break;
} }
...@@ -1556,6 +1711,8 @@ public class FinCommon ...@@ -1556,6 +1711,8 @@ public class FinCommon
catch(SQLException e) catch(SQLException e)
{ {
System.out.println("Exception :: [][getDailyExchRateSellBuy]"+sql+e); System.out.println("Exception :: [][getDailyExchRateSellBuy]"+sql+e);
} }
catch(Exception ex) catch(Exception ex)
{ {
...@@ -1733,7 +1890,7 @@ public class FinCommon ...@@ -1733,7 +1890,7 @@ public class FinCommon
public String isAcctCode(String siteCode,String acctCode,String modName,Connection con) throws ITMException public String isAcctCode(String siteCode,String acctCode,String modName,Connection con) throws ITMException
{ {
String errCode = "", siteSpec = ""; String errCode = "", siteSpec = "";
long counter; //long counter;
String sql1 = ""; String sql1 = "";
Statement statement1 = null; Statement statement1 = null;
ResultSet resultSet1 = null; ResultSet resultSet1 = null;
...@@ -1838,7 +1995,10 @@ public class FinCommon ...@@ -1838,7 +1995,10 @@ public class FinCommon
{ {
System.out.println("SQLException :ITMDBAccessEJB :isAcctCode:" + se.getMessage() + ":"); System.out.println("SQLException :ITMDBAccessEJB :isAcctCode:" + se.getMessage() + ":");
se.printStackTrace(); se.printStackTrace();
errCode = se.getMessage();
throw new ITMException(se); throw new ITMException(se);
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -2957,7 +3117,7 @@ public class FinCommon ...@@ -2957,7 +3117,7 @@ public class FinCommon
pstmt.close(); pstmt = null; pstmt.close(); pstmt = null;
if (cheque_or_name.equalsIgnoreCase("C")) if (cheque_or_name.equalsIgnoreCase("C"))
{ {
if (chqName == null && chqName.trim().length() == 0) if (chqName == null || chqName.trim().length() == 0)
{ {
chqName = sName; chqName = sName;
} }
...@@ -8364,7 +8524,7 @@ public class FinCommon ...@@ -8364,7 +8524,7 @@ public class FinCommon
String deptCode = "",currCode = "",empCode = "",analCode = "",projCode = ""; String deptCode = "",currCode = "",empCode = "",analCode = "",projCode = "";
String refType = "",refSer = "",refId = "",remarks = "",partyDocRef = ""; String refType = "",refSer = "",refId = "",remarks = "",partyDocRef = "";
String entryBatchNo = "",postdt = "",postOnLine = "",postStat = "",finEntCurr = "",sql= ""; String entryBatchNo = "",postdt = "",postOnLine = "",postStat = "",finEntCurr = "",sql= "";
String sundryTypeAc = "",acctPrd = "",code = "",keyString = "",tranId = ""; String acctPrd = "",code = "",keyString = "",tranId = "";
double exchRate = 0,drAmt = 0,crAmt = 0,tempDrAmt = 0,tempCrAmt = 0; double exchRate = 0,drAmt = 0,crAmt = 0,tempDrAmt = 0,tempCrAmt = 0;
Timestamp tranDate = null,effDate = null,postDate = null,chgDate = null; Timestamp tranDate = null,effDate = null,postDate = null,chgDate = null;
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
...@@ -8373,10 +8533,11 @@ public class FinCommon ...@@ -8373,10 +8533,11 @@ public class FinCommon
SimpleDateFormat sdf = null; SimpleDateFormat sdf = null;
HashMap glTran = null; HashMap glTran = null;
String analysis1="", analysis2="", analysis3=""; // cpatil; String analysis1="", analysis2="", analysis3=""; // cpatil;
String chgUser = "",chgTerm = ""; //poonam
String tableName=""; String tableName="";
String refSerTemp=""; String refSerTemp="";
try{ try{
System.out.println("Inside Try Catch..."); System.out.println("Inside Try Catch..."+ glTrace.toString());
// genericUtility = new GenericUtility(); // genericUtility = new GenericUtility();
chgDate = new Timestamp(System.currentTimeMillis()); chgDate = new Timestamp(System.currentTimeMillis());
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
...@@ -8405,6 +8566,18 @@ public class FinCommon ...@@ -8405,6 +8566,18 @@ public class FinCommon
analysis1 = (glTrace.get("analysis1") == null ? "":glTrace.get("analysis1").toString()); // added by cpatil analysis1 = (glTrace.get("analysis1") == null ? "":glTrace.get("analysis1").toString()); // added by cpatil
analysis2 = (glTrace.get("analysis2") == null ? "":glTrace.get("analysis2").toString()); // added by cpatil analysis2 = (glTrace.get("analysis2") == null ? "":glTrace.get("analysis2").toString()); // added by cpatil
analysis3 = (glTrace.get("analysis3") == null ? "":glTrace.get("analysis3").toString()); // added by cpatil analysis3 = (glTrace.get("analysis3") == null ? "":glTrace.get("analysis3").toString()); // added by cpatil
chgUser = (glTrace.get("chg_user") == null ? "":glTrace.get("chg_user").toString()); // added by poonam
chgTerm = (glTrace.get("chg_term") == null ? "":glTrace.get("chg_term").toString()); // added by poonam
if(chgUser == null || chgUser.trim().length() == 0)
{
chgUser = "SYSTEM" ;
}
if(chgTerm == null || chgTerm.trim().length() == 0)
{
chgTerm = "SYSTEM" ;
}
System.out.println("glTraceUpdate chgUser"+chgUser + "chgTerm"+chgTerm);
System.out.println("SYSO...............2"); System.out.println("SYSO...............2");
//errCode = itmDBAccessEJB.isAcctCode(siteCode,acctCode,"X",conn);//To be uncommented later - Jiten as it is giving resultset closed. //errCode = itmDBAccessEJB.isAcctCode(siteCode,acctCode,"X",conn);//To be uncommented later - Jiten as it is giving resultset closed.
...@@ -8603,6 +8776,8 @@ public class FinCommon ...@@ -8603,6 +8776,8 @@ public class FinCommon
glTran.put("analysis1",(glTrace.get("analysis1") == null ? "":glTrace.get("analysis1"))); // added by cpatil glTran.put("analysis1",(glTrace.get("analysis1") == null ? "":glTrace.get("analysis1"))); // added by cpatil
glTran.put("analysis2",(glTrace.get("analysis2") == null ? "":glTrace.get("analysis2"))); // added by cpatil glTran.put("analysis2",(glTrace.get("analysis2") == null ? "":glTrace.get("analysis2"))); // added by cpatil
glTran.put("analysis3",(glTrace.get("analysis3") == null ? "":glTrace.get("analysis3"))); // added by cpatil glTran.put("analysis3",(glTrace.get("analysis3") == null ? "":glTrace.get("analysis3"))); // added by cpatil
glTran.put("chg_user",(glTrace.get("chg_user") == null ? "":glTrace.get("chg_user"))); // added by Poonam
glTran.put("chg_term",(glTrace.get("chg_term") == null ? "":glTrace.get("chg_term"))); // added by poonam
if( ! isPreview )//change by vishakha for F14ISUN006 07-APR-15 if( ! isPreview )//change by vishakha for F14ISUN006 07-APR-15
{ {
...@@ -8617,7 +8792,7 @@ public class FinCommon ...@@ -8617,7 +8792,7 @@ public class FinCommon
postDate = null; postDate = null;
} }
System.out.println("iNSERTING INTO GLTRACE_PREVIEW ......****isPreview Value>>>"+isPreview); System.out.println("INSERTING INTO GLTRACE_PREVIEW ......****isPreview Value>>>"+isPreview);
/*sql = "select key_string from transetup where tran_window = 't_"+tableName+"'"; /*sql = "select key_string from transetup where tran_window = 't_"+tableName+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
...@@ -8630,6 +8805,7 @@ public class FinCommon ...@@ -8630,6 +8805,7 @@ public class FinCommon
System.out.println("Tran id for preview>>>****************"+tranId); System.out.println("Tran id for preview>>>****************"+tranId);
System.out.println("CR AMT for preview*****************"+crAmt); System.out.println("CR AMT for preview*****************"+crAmt);
try{
sql = "insert into "+tableName+" (tran_id, tran_date, eff_date, ref_type, ref_ser," + sql = "insert into "+tableName+" (tran_id, tran_date, eff_date, ref_type, ref_ser," +
"ref_id, fin_entity, site_code, sundry_type," + "ref_id, fin_entity, site_code, sundry_type," +
"sundry_code, acct_code, cctr_code, curr_code," + "sundry_code, acct_code, cctr_code, curr_code," +
...@@ -8706,8 +8882,12 @@ public class FinCommon ...@@ -8706,8 +8882,12 @@ public class FinCommon
pstmt.setString(23,code); pstmt.setString(23,code);
} }
pstmt.setTimestamp(24,chgDate); pstmt.setTimestamp(24,chgDate);
pstmt.setString(25,"SYSTEM"); //pstmt.setString(25,"SYSTEM");
pstmt.setString(26,"SYSTEM"); // pstmt.setString(26,"SYSTEM");
pstmt.setString(25,chgUser); // added by poonam
pstmt.setString(26,chgTerm); // added by poonam
pstmt.setString(27,entryBatchNo); pstmt.setString(27,entryBatchNo);
pstmt.setString(28,projCode); pstmt.setString(28,projCode);
pstmt.setString(29,partyDocRef); pstmt.setString(29,partyDocRef);
...@@ -8726,6 +8906,19 @@ public class FinCommon ...@@ -8726,6 +8906,19 @@ public class FinCommon
System.out.println("EXCH_RATE :"+exchRate); System.out.println("EXCH_RATE :"+exchRate);
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException P []:TRACE()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
System.out.println("errString TRACE(" + errString );
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
System.out.println("errString :::: ["+errString+"]["+isPreview+"]"); System.out.println("errString :::: ["+errString+"]["+isPreview+"]");
if(errString == null || errString.trim().length() == 0 ){ if(errString == null || errString.trim().length() == 0 ){
if(conn !=null && isPreview == true){ if(conn !=null && isPreview == true){
...@@ -8953,6 +9146,7 @@ public class FinCommon ...@@ -8953,6 +9146,7 @@ public class FinCommon
Statement stmt = null; Statement stmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql = "",ledgPost = "",errString = ""; String sql = "",ledgPost = "",errString = "";
String chgUser = "",chgTerm = ""; //poonam
String glTranId = "",keyString = "",tranIdTrace = ""; String glTranId = "",keyString = "",tranIdTrace = "";
String openPeriod = "000000",closePeriod = "zzzzzz"; String openPeriod = "000000",closePeriod = "zzzzzz";
Timestamp chgDate = null,tranDate = null,effDate = null; Timestamp chgDate = null,tranDate = null,effDate = null;
...@@ -8963,6 +9157,7 @@ public class FinCommon ...@@ -8963,6 +9157,7 @@ public class FinCommon
int cnt; int cnt;
ibase.webitm.ejb.sys.UtilMethods util=new ibase.webitm.ejb.sys.UtilMethods(); ibase.webitm.ejb.sys.UtilMethods util=new ibase.webitm.ejb.sys.UtilMethods();
try{ try{
System.out.println("Inside glTranUpdate :"+glTran.toString());
stmt = conn.createStatement(); stmt = conn.createStatement();
// genericUtility = new GenericUtility(); // genericUtility = new GenericUtility();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
...@@ -8974,6 +9169,19 @@ public class FinCommon ...@@ -8974,6 +9169,19 @@ public class FinCommon
//Date should be in applDate Format //Date should be in applDate Format
tranDate = (Timestamp)glTran.get("tran_date"); tranDate = (Timestamp)glTran.get("tran_date");
effDate = (Timestamp)glTran.get("eff_date"); effDate = (Timestamp)glTran.get("eff_date");
chgUser = glTran.get("chg_user").toString();
chgTerm = glTran.get("chg_term").toString();
if(chgTerm == null || chgTerm.trim().length() == 0)
{
chgTerm = "SYSTEM" ;
}
if(chgUser == null || chgUser.trim().length() == 0)
{
chgUser = "SYSTEM" ;
}
System.out.println("Inside glTranUpdate chg_user :"+glTran.get("chg_user").toString() + "chg_term"+glTran.get("chg_term").toString());
if(glTran.get("entry_batch_no").toString() == null || glTran.get("entry_batch_no").toString().trim().length() == 0){ if(glTran.get("entry_batch_no").toString() == null || glTran.get("entry_batch_no").toString().trim().length() == 0){
glTran.put("entry_batch_no"," "); glTran.put("entry_batch_no"," ");
...@@ -9007,6 +9215,9 @@ public class FinCommon ...@@ -9007,6 +9215,9 @@ public class FinCommon
errString = itmDBAccessEJB.getErrorString("","VTGLTRAN1","","",conn); errString = itmDBAccessEJB.getErrorString("","VTGLTRAN1","","",conn);
return errString; return errString;
}else if(cnt == 1){ }else if(cnt == 1){
try //added by poonam
{
sql = "update gltran set dr_amt = dr_amt + ? ," + sql = "update gltran set dr_amt = dr_amt + ? ," +
"cr_amt = cr_amt + ? ," + "cr_amt = cr_amt + ? ," +
"tran_date = ? ," + "tran_date = ? ," +
...@@ -9023,14 +9234,26 @@ public class FinCommon ...@@ -9023,14 +9234,26 @@ public class FinCommon
pstmt.setTimestamp(3,tranDate); pstmt.setTimestamp(3,tranDate);
pstmt.setTimestamp(4,effDate); pstmt.setTimestamp(4,effDate);
pstmt.setTimestamp(5,chgDate); pstmt.setTimestamp(5,chgDate);
pstmt.setString(6,"SYSTEM"); //pstmt.setString(6,"SYSTEM");
pstmt.setString(7,"SYSTEM"); // pstmt.setString(7,"SYSTEM");
pstmt.setString(6,chgUser); //Added By poonam on 28-07-16
pstmt.setString(7,chgTerm); //Added By poonam on 28-07-16
pstmt.setString(8,glTran.get("prd_code").toString()); pstmt.setString(8,glTran.get("prd_code").toString());
pstmt.setString(9,glTran.get("site_code").toString()); pstmt.setString(9,glTran.get("site_code").toString());
pstmt.setString(10,glTran.get("acct_code").toString()); pstmt.setString(10,glTran.get("acct_code").toString());
pstmt.setString(11,glTran.get("cctr_code").toString()); pstmt.setString(11,glTran.get("cctr_code").toString());
pstmt.setString(12,glTran.get("entry_batch_no").toString()); pstmt.setString(12,glTran.get("entry_batch_no").toString());
pstmt.executeUpdate(); pstmt.executeUpdate();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:glTranUpdate()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
} }
if(cnt == 0){ if(cnt == 0){
...@@ -9058,6 +9281,9 @@ public class FinCommon ...@@ -9058,6 +9281,9 @@ public class FinCommon
}else{ }else{
tranIdTrace = glTran.get("tran_id__trace").toString().trim(); tranIdTrace = glTran.get("tran_id__trace").toString().trim();
} }
try{ //added by poonam
sql = "insert into gltran (tran_id, tran_date, eff_date, ref_ser," + sql = "insert into gltran (tran_id, tran_date, eff_date, ref_ser," +
"ref_id, fin_entity, site_code, acct_code, cctr_code," + "ref_id, fin_entity, site_code, acct_code, cctr_code," +
"dr_amt, cr_amt, emp_code, anal_code, remarks," + "dr_amt, cr_amt, emp_code, anal_code, remarks," +
...@@ -9119,8 +9345,10 @@ public class FinCommon ...@@ -9119,8 +9345,10 @@ public class FinCommon
pstmt.setString(16,prdCode); pstmt.setString(16,prdCode);
} }
pstmt.setTimestamp(17,chgDate); pstmt.setTimestamp(17,chgDate);
pstmt.setString(18,"SYSTEM"); //pstmt.setString(18,"SYSTEM");
pstmt.setString(19,"SYSTEM"); //pstmt.setString(19,"SYSTEM");
pstmt.setString(18,chgUser); //Added By poonam on 28-07-16
pstmt.setString(19,chgTerm); //Added By poonam on 28-07-16
pstmt.setString(20,tranIdTrace); pstmt.setString(20,tranIdTrace);
pstmt.setString(21,glTran.get("proj_code").toString()); pstmt.setString(21,glTran.get("proj_code").toString());
pstmt.setString(22,glTran.get("dept_code").toString()); pstmt.setString(22,glTran.get("dept_code").toString());
...@@ -9132,6 +9360,19 @@ public class FinCommon ...@@ -9132,6 +9360,19 @@ public class FinCommon
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:glTranUpdate()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
sql ="select count(*) from acctbal where acct_prd = '"+glTran.get("acct_prd").toString()+"' " + sql ="select count(*) from acctbal where acct_prd = '"+glTran.get("acct_prd").toString()+"' " +
"and prd_code = '"+openPeriod+"' " + "and prd_code = '"+openPeriod+"' " +
...@@ -9146,6 +9387,8 @@ public class FinCommon ...@@ -9146,6 +9387,8 @@ public class FinCommon
} }
rs.close(); rs.close();
if(cnt == 0){ if(cnt == 0){
try{ //added by poonam
sql = "insert into acctbal (acct_prd, prd_code, fin_entity, site_code, " + sql = "insert into acctbal (acct_prd, prd_code, fin_entity, site_code, " +
"acct_code, cctr_code, curr_code__ac, dr_amt, cr_amt," + "acct_code, cctr_code, curr_code__ac, dr_amt, cr_amt," +
"dr_amt__base, cr_amt__base, chg_date, chg_user, chg_term) " + "dr_amt__base, cr_amt__base, chg_date, chg_user, chg_term) " +
...@@ -9164,12 +9407,26 @@ public class FinCommon ...@@ -9164,12 +9407,26 @@ public class FinCommon
pstmt.setInt(10,0); pstmt.setInt(10,0);
pstmt.setInt(11,0); pstmt.setInt(11,0);
pstmt.setTimestamp(12,chgDate); pstmt.setTimestamp(12,chgDate);
pstmt.setString(13,"SYSTEM"); //pstmt.setString(13,"SYSTEM");
pstmt.setString(14,"SYSTEM"); //pstmt.setString(14,"SYSTEM");
pstmt.setString(13,chgUser); //Added By poonam on 28-07-16
pstmt.setString(14,chgTerm); //Added By poonam on 28-07-16
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
sql = "select count(*) from acctbal where acct_prd = '"+glTran.get("acct_prd").toString()+"' " + sql = "select count(*) from acctbal where acct_prd = '"+glTran.get("acct_prd").toString()+"' " +
"and prd_code = '"+glTran.get("prd_code").toString()+"' " + "and prd_code = '"+glTran.get("prd_code").toString()+"' " +
...@@ -9183,6 +9440,8 @@ public class FinCommon ...@@ -9183,6 +9440,8 @@ public class FinCommon
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
if(cnt == 0){ if(cnt == 0){
try{ //Added by poonam
sql = "insert into acctbal (acct_prd, prd_code, fin_entity, site_code," + sql = "insert into acctbal (acct_prd, prd_code, fin_entity, site_code," +
"acct_code, cctr_code, curr_code__ac, dr_amt, cr_amt," + "acct_code, cctr_code, curr_code__ac, dr_amt, cr_amt," +
"dr_amt__base, cr_amt__base, chg_date, chg_user, chg_term) " + "dr_amt__base, cr_amt__base, chg_date, chg_user, chg_term) " +
...@@ -9201,12 +9460,29 @@ public class FinCommon ...@@ -9201,12 +9460,29 @@ public class FinCommon
pstmt.setDouble(10,drAmtBase); pstmt.setDouble(10,drAmtBase);
pstmt.setDouble(11,crAmtBase); pstmt.setDouble(11,crAmtBase);
pstmt.setTimestamp(12,chgDate); pstmt.setTimestamp(12,chgDate);
pstmt.setString(13,"SYSTEM"); //pstmt.setString(13,"SYSTEM");
pstmt.setString(14,"SYSTEM"); // pstmt.setString(14,"SYSTEM");
pstmt.setString(13,glTran.get("chg_user").toString()); //Added By poonam on 28-07-16
pstmt.setString(14,glTran.get("chg_term").toString()); //Added By poonam on 28-07-16
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
try{ //added by poonam
sql = "update acctbal set dr_amt = dr_amt + "+Double.parseDouble(glTran.get("dr_amt").toString())+" ," + sql = "update acctbal set dr_amt = dr_amt + "+Double.parseDouble(glTran.get("dr_amt").toString())+" ," +
"cr_amt = cr_amt + "+Double.parseDouble(glTran.get("cr_amt").toString())+", " + "cr_amt = cr_amt + "+Double.parseDouble(glTran.get("cr_amt").toString())+", " +
"dr_amt__base = dr_amt__base + "+drAmtBase+"," + "dr_amt__base = dr_amt__base + "+drAmtBase+"," +
...@@ -9221,6 +9497,17 @@ public class FinCommon ...@@ -9221,6 +9497,17 @@ public class FinCommon
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
sql = "select count(*) from acctbal where acct_prd = '"+glTran.get("acct_prd").toString()+"' " + sql = "select count(*) from acctbal where acct_prd = '"+glTran.get("acct_prd").toString()+"' " +
...@@ -9235,6 +9522,8 @@ public class FinCommon ...@@ -9235,6 +9522,8 @@ public class FinCommon
} }
rs.close(); rs.close();
if(cnt == 0){ if(cnt == 0){
try{ //added by poonam
sql = "insert into acctbal (acct_prd, prd_code, fin_entity, site_code," + sql = "insert into acctbal (acct_prd, prd_code, fin_entity, site_code," +
"acct_code, cctr_code, curr_code__ac, dr_amt, cr_amt," + "acct_code, cctr_code, curr_code__ac, dr_amt, cr_amt," +
"dr_amt__base, cr_amt__base, chg_date, chg_user, chg_term) " + "dr_amt__base, cr_amt__base, chg_date, chg_user, chg_term) " +
...@@ -9253,11 +9542,28 @@ public class FinCommon ...@@ -9253,11 +9542,28 @@ public class FinCommon
pstmt.setDouble(10,drAmtBase); pstmt.setDouble(10,drAmtBase);
pstmt.setDouble(11,crAmtBase); pstmt.setDouble(11,crAmtBase);
pstmt.setTimestamp(12,chgDate); pstmt.setTimestamp(12,chgDate);
pstmt.setString(13,"SYSTEM"); //pstmt.setString(13,"SYSTEM");
pstmt.setString(14,"SYSTEM"); //pstmt.setString(14,"SYSTEM");
pstmt.setString(13,glTran.get("chg_user").toString()); //Added By poonam on 28-07-16
pstmt.setString(14,glTran.get("chg_term").toString()); //Added By poonam on 28-07-16
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
try { //Added by poonam
sql = "update acctbal set dr_amt = dr_amt + "+Double.parseDouble(glTran.get("dr_amt").toString())+"," + sql = "update acctbal set dr_amt = dr_amt + "+Double.parseDouble(glTran.get("dr_amt").toString())+"," +
"cr_amt = cr_amt + "+Double.parseDouble(glTran.get("cr_amt").toString())+"," + "cr_amt = cr_amt + "+Double.parseDouble(glTran.get("cr_amt").toString())+"," +
"dr_amt__base = dr_amt__base + "+drAmtBase+"," + "dr_amt__base = dr_amt__base + "+drAmtBase+"," +
...@@ -9269,6 +9575,17 @@ public class FinCommon ...@@ -9269,6 +9575,17 @@ public class FinCommon
"cctr_code = '"+glTran.get("cctr_code").toString()+"'"; "cctr_code = '"+glTran.get("cctr_code").toString()+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
stmt.executeUpdate(sql); stmt.executeUpdate(sql);
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbf_sundrybal_upd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
}catch(Exception e){ }catch(Exception e){
System.out.println("Exception in glTranUpdate[FinCommon]"+e); System.out.println("Exception in glTranUpdate[FinCommon]"+e);
...@@ -9474,6 +9791,8 @@ public class FinCommon ...@@ -9474,6 +9791,8 @@ public class FinCommon
deptCode = " "; deptCode = " ";
} }
try
{ //added by poonam
sql = "select a.budget_id, case when b.alloc_reqd is null then ' ' else b.alloc_reqd end , " + sql = "select a.budget_id, case when b.alloc_reqd is null then ' ' else b.alloc_reqd end , " +
"(case when a.budget_amt is null then 0 else a.budget_amt end) + " + "(case when a.budget_amt is null then 0 else a.budget_amt end) + " +
"(case when a.adhoc_amt is null then 0 else a.adhoc_amt end)," + "(case when a.adhoc_amt is null then 0 else a.adhoc_amt end)," +
...@@ -9511,7 +9830,20 @@ public class FinCommon ...@@ -9511,7 +9830,20 @@ public class FinCommon
} }
rs.close(); rs.close();
pstmt.close(); pstmt.close();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
sql = "select a.tran_id, "+ sql = "select a.tran_id, "+
"case when round(b.alloc_amt * a.exch_rate,3) IS NULL THEN 0 else round(b.alloc_amt * a.exch_rate,3) END, "+ "case when round(b.alloc_amt * a.exch_rate,3) IS NULL THEN 0 else round(b.alloc_amt * a.exch_rate,3) END, "+
"case when round(b.req_amt * a.exch_rate,3) is null then 0 else round(b.req_amt * a.exch_rate,3) end, "+ "case when round(b.req_amt * a.exch_rate,3) is null then 0 else round(b.req_amt * a.exch_rate,3) end, "+
...@@ -9568,6 +9900,8 @@ public class FinCommon ...@@ -9568,6 +9900,8 @@ public class FinCommon
}else{ }else{
reqPo = 0; reqPo = 0;
} }
try{ //poonam
sql = "update budget_alloc_det " + sql = "update budget_alloc_det " +
"set consume_amt = consume_amt + "+amount+" ," + "set consume_amt = consume_amt + "+amount+" ," +
"req_amt = req_amt - "+indAmount+" ," + "req_amt = req_amt - "+indAmount+" ," +
...@@ -9578,9 +9912,22 @@ public class FinCommon ...@@ -9578,9 +9912,22 @@ public class FinCommon
"and anal_code = '"+analCode+"'"; "and anal_code = '"+analCode+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
updCnt = stmt.executeUpdate(sql); updCnt = stmt.executeUpdate(sql);
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
if(tranType.equalsIgnoreCase("PORD")){ if(tranType.equalsIgnoreCase("PORD")){
try{ //poonam
sql = "update budget_alloc_det " + sql = "update budget_alloc_det " +
"set alloc_amt_po = alloc_amt_po + "+amount+" ," + "set alloc_amt_po = alloc_amt_po + "+amount+" ," +
"req_amt = req_amt - "+indAmount+" " + "req_amt = req_amt - "+indAmount+" " +
...@@ -9590,7 +9937,19 @@ public class FinCommon ...@@ -9590,7 +9937,19 @@ public class FinCommon
"and anal_code = '"+analCode+"'"; "and anal_code = '"+analCode+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
updCnt = stmt.executeUpdate(sql); updCnt = stmt.executeUpdate(sql);
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
try{ //poonam
sql = "update budget_alloc_det " + sql = "update budget_alloc_det " +
"set req_amt = req_amt + "+amount+" " + "set req_amt = req_amt + "+amount+" " +
"where tran_id = '"+tranIdAlloc+"' " + "where tran_id = '"+tranIdAlloc+"' " +
...@@ -9599,6 +9958,16 @@ public class FinCommon ...@@ -9599,6 +9958,16 @@ public class FinCommon
"and anal_code = '"+analCode+"'"; "and anal_code = '"+analCode+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
updCnt = stmt.executeUpdate(sql); updCnt = stmt.executeUpdate(sql);
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
if(updCnt <= 0){ if(updCnt <= 0){
errString = itmDBAccessEJB.getErrorString("","VTACCTBUD","","",conn); errString = itmDBAccessEJB.getErrorString("","VTACCTBUD","","",conn);
...@@ -9661,6 +10030,7 @@ public class FinCommon ...@@ -9661,6 +10030,7 @@ public class FinCommon
}else{ }else{
reqPo = 0; reqPo = 0;
} }
try{ //poonam
sql = "update budget_alloc_det set consume_amt = consume_amt + "+amount+"," + sql = "update budget_alloc_det set consume_amt = consume_amt + "+amount+"," +
"alloc_amt_po = alloc_amt_po - "+reqPo+" " + "alloc_amt_po = alloc_amt_po - "+reqPo+" " +
"where tran_id = '"+tranIdAlloc+"' " + "where tran_id = '"+tranIdAlloc+"' " +
...@@ -9669,8 +10039,21 @@ public class FinCommon ...@@ -9669,8 +10039,21 @@ public class FinCommon
"and anal_code = '"+analCode+"'"; "and anal_code = '"+analCode+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
updCount = stmt.executeUpdate(sql); updCount = stmt.executeUpdate(sql);
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
if(tranType.equalsIgnoreCase("PORD")){ if(tranType.equalsIgnoreCase("PORD")){
try{ //poonam
sql = "update budget_alloc_det " + sql = "update budget_alloc_det " +
"set alloc_amt_po = alloc_amt_po + "+amount+", " + "set alloc_amt_po = alloc_amt_po + "+amount+", " +
"req_amt = req_amt - "+indAmount+" " + "req_amt = req_amt - "+indAmount+" " +
...@@ -9680,7 +10063,19 @@ public class FinCommon ...@@ -9680,7 +10063,19 @@ public class FinCommon
"and anal_code = '"+analCode+"'"; "and anal_code = '"+analCode+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
updCount = stmt.executeUpdate(sql); updCount = stmt.executeUpdate(sql);
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
try { //poonam
sql = "update budget_alloc_det " + sql = "update budget_alloc_det " +
"set req_amt = req_amt + "+amount+" " + "set req_amt = req_amt + "+amount+" " +
"where tran_id = '"+tranIdAlloc+"' " + "where tran_id = '"+tranIdAlloc+"' " +
...@@ -9689,6 +10084,17 @@ public class FinCommon ...@@ -9689,6 +10084,17 @@ public class FinCommon
"and anal_code = '"+analCode+"'"; "and anal_code = '"+analCode+"'";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
updCount = stmt.executeUpdate(sql); updCount = stmt.executeUpdate(sql);
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
} }
if(updCount <=0){ if(updCount <=0){
...@@ -9729,6 +10135,7 @@ public class FinCommon ...@@ -9729,6 +10135,7 @@ public class FinCommon
if(budgetCode != null && budgetCode.trim().length() > 0){ if(budgetCode != null && budgetCode.trim().length() > 0){
if(updType.equalsIgnoreCase("C") ){ if(updType.equalsIgnoreCase("C") ){
if(tranType.equalsIgnoreCase("PORD")){ if(tranType.equalsIgnoreCase("PORD")){
try{ //poonam
sql = "update acctbudget " + sql = "update acctbudget " +
"set dir_req_amt = dir_req_amt + "+indAmount+" ," + "set dir_req_amt = dir_req_amt + "+indAmount+" ," +
"alloc_amt_po = alloc_amt_po - "+amount+" " + "alloc_amt_po = alloc_amt_po - "+amount+" " +
...@@ -9741,12 +10148,24 @@ public class FinCommon ...@@ -9741,12 +10148,24 @@ public class FinCommon
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate(); pstmt.executeUpdate();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
if((tranType.equalsIgnoreCase("VOUCH") && acctEff.equalsIgnoreCase("N")) || (tranType.equalsIgnoreCase("P-RCP") && acctEff.equalsIgnoreCase("Y"))){ if((tranType.equalsIgnoreCase("VOUCH") && acctEff.equalsIgnoreCase("N")) || (tranType.equalsIgnoreCase("P-RCP") && acctEff.equalsIgnoreCase("Y"))){
reqPo = amount; reqPo = amount;
}else{ }else{
reqPo = 0; reqPo = 0;
} }
try { //poonam
sql = "update acctbudget " + sql = "update acctbudget " +
"set con_amt = con_amt + "+amount+" ," + "set con_amt = con_amt + "+amount+" ," +
"alloc_amt_po = alloc_amt_po - "+reqPo+" , " + "alloc_amt_po = alloc_amt_po - "+reqPo+" , " +
...@@ -9761,10 +10180,22 @@ public class FinCommon ...@@ -9761,10 +10180,22 @@ public class FinCommon
pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.executeUpdate(); pstmt.executeUpdate();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
}else{ }else{
if(tranType.equalsIgnoreCase("PORD")){ if(tranType.equalsIgnoreCase("PORD")){
if(indAmount > 0){ if(indAmount > 0){
try{ //poonam
sql = "update acctbudget " + sql = "update acctbudget " +
"set dir_req_amt = dir_req_amt - "+indAmount+" ," + "set dir_req_amt = dir_req_amt - "+indAmount+" ," +
"alloc_amt_po = alloc_amt_po + "+amount+" " + "alloc_amt_po = alloc_amt_po + "+amount+" " +
...@@ -9778,8 +10209,19 @@ public class FinCommon ...@@ -9778,8 +10209,19 @@ public class FinCommon
pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.executeUpdate(); pstmt.executeUpdate();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}else{ }else{
try{ //poonam
sql = "update acctbudget " + sql = "update acctbudget " +
"set alloc_amt_po = alloc_amt_po + "+amount+" " + "set alloc_amt_po = alloc_amt_po + "+amount+" " +
"where from_date <= ? and to_date >= ? " + "where from_date <= ? and to_date >= ? " +
...@@ -9792,8 +10234,19 @@ public class FinCommon ...@@ -9792,8 +10234,19 @@ public class FinCommon
pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.executeUpdate(); pstmt.executeUpdate();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
}else{ }else{
try{ //poonam
sql = "update acctbudget " + sql = "update acctbudget " +
"set dir_req_amt = dir_req_amt + "+amount+" " + "set dir_req_amt = dir_req_amt + "+amount+" " +
"where from_date <= ? and to_date >= ? " + "where from_date <= ? and to_date >= ? " +
...@@ -9806,6 +10259,16 @@ public class FinCommon ...@@ -9806,6 +10259,16 @@ public class FinCommon
pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(1,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()))); pstmt.setTimestamp(2,Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.executeUpdate(); pstmt.executeUpdate();
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:updateBudget()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
} }
} }
...@@ -9986,7 +10449,7 @@ public class FinCommon ...@@ -9986,7 +10449,7 @@ public class FinCommon
{ {
Statement stmt = null; Statement stmt = null;
ResultSet rs = null; ResultSet rs = null;
double drAmt = 0,crAmt = 0,exch = 0; double drAmt = 0,crAmt = 0;
double totDrAmt = 0,totCrAmt = 0,diffAmt = 0; double totDrAmt = 0,totCrAmt = 0,diffAmt = 0;
String sql = "",errString = "",postOnLine = "",acct = "",cctr = ""; String sql = "",errString = "",postOnLine = "",acct = "",cctr = "";
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
...@@ -10297,6 +10760,7 @@ public class FinCommon ...@@ -10297,6 +10760,7 @@ public class FinCommon
stmtTemp.close(); stmtTemp.close();
//amountBc = gf_get_rndamt(lc_amount_bc, ls_rndto, lc_rndoff) //amountBc = gf_get_rndamt(lc_amount_bc, ls_rndto, lc_rndoff)
try{ //poonam
sqlTemp = "INSERT INTO BANKTRAN_LOG " sqlTemp = "INSERT INTO BANKTRAN_LOG "
+" (TRAN_ID, BANK_CODE, TRAN_DATE, TRAN_SER, TRAN_NO, REF_NO, REF_DATE, " +" (TRAN_ID, BANK_CODE, TRAN_DATE, TRAN_SER, TRAN_NO, REF_NO, REF_DATE, "
+" REF_MODE, AMOUNT, TRAN_TYPE, SITE_CODE, ACCT_CODE, CCTR_CODE, SUNDRY_TYPE, " +" REF_MODE, AMOUNT, TRAN_TYPE, SITE_CODE, ACCT_CODE, CCTR_CODE, SUNDRY_TYPE, "
...@@ -10334,6 +10798,17 @@ public class FinCommon ...@@ -10334,6 +10798,17 @@ public class FinCommon
//errString = validator.getErrorString("TRAN_ID",errCode,chgUser);//errCode //errString = validator.getErrorString("TRAN_ID",errCode,chgUser);//errCode
errString = itmDBAccessEJB.getErrorString("TRAN_ID",errCode,chgUser,"",conn); errString = itmDBAccessEJB.getErrorString("TRAN_ID",errCode,chgUser,"",conn);
} }
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:bankTranLogUpdate()[Excuting Query Failed]" + sqlTemp +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
break; break;
} }
while (true); while (true);
...@@ -11352,9 +11827,9 @@ public class FinCommon ...@@ -11352,9 +11827,9 @@ public class FinCommon
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql = ""; String sql = "";
String errString = "" ; //String errString = "" ;
// GenericUtility genericUtility = null; // GenericUtility genericUtility = null;
ITMDBAccessEJB itmDBAccessEJB = null; //ITMDBAccessEJB itmDBAccessEJB = itmDBAccessEJB = new ITMDBAccessEJB();;
java.sql.Timestamp docRefDt = null; java.sql.Timestamp docRefDt = null;
String docRefNo="",returns ="",refDt =""; String docRefNo="",returns ="",refDt ="";
...@@ -11366,7 +11841,7 @@ public class FinCommon ...@@ -11366,7 +11841,7 @@ public class FinCommon
{ {
// genericUtility = new GenericUtility(); // genericUtility = new GenericUtility();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
itmDBAccessEJB = new ITMDBAccessEJB();
refSerSub = refSer.substring(0,5); refSerSub = refSer.substring(0,5);
...@@ -11598,6 +12073,7 @@ public class FinCommon ...@@ -11598,6 +12073,7 @@ public class FinCommon
payblsTranID = tg.generateTranSeqID("PAYL", "tran_id", keyStr, conn); payblsTranID = tg.generateTranSeqID("PAYL", "tran_id", keyStr, conn);
System.out.println("Transaction Id Generated for Payables :"+payblsTranID); System.out.println("Transaction Id Generated for Payables :"+payblsTranID);
try{ //poonam
sql = "INSERT INTO MISC_PAYABLES (TRAN_ID,TRAN_SER,TRAN_DATE,REF_NO,REF_DATE,CURR_CODE,EXCH_RATE," sql = "INSERT INTO MISC_PAYABLES (TRAN_ID,TRAN_SER,TRAN_DATE,REF_NO,REF_DATE,CURR_CODE,EXCH_RATE,"
+ "SUNDRY_TYPE,SUNDRY_CODE,ACCT_CODE,CCTR_CODE,DUE_DATE,FIN_ENTITY,SITE_CODE,BILL_NO,BILL_DATE," + "SUNDRY_TYPE,SUNDRY_CODE,ACCT_CODE,CCTR_CODE,DUE_DATE,FIN_ENTITY,SITE_CODE,BILL_NO,BILL_DATE,"
+ "TOT_AMT,ADJ_AMT,STATUS,STATUS_DATE,BANK_CODE,AUTO_PAY,PAY_MODE,PAID,ADV_AMT,HOLD_AMT," + "TOT_AMT,ADJ_AMT,STATUS,STATUS_DATE,BANK_CODE,AUTO_PAY,PAY_MODE,PAID,ADV_AMT,HOLD_AMT,"
...@@ -11642,6 +12118,17 @@ public class FinCommon ...@@ -11642,6 +12118,17 @@ public class FinCommon
return errString; return errString;
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbfMiscPayUpd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
}// end of try }// end of try
catch(Exception e) catch(Exception e)
{ {
...@@ -11678,20 +12165,20 @@ public class FinCommon ...@@ -11678,20 +12165,20 @@ public class FinCommon
ResultSet rs = null; ResultSet rs = null;
String sql = "",errString = ""; String sql = "",errString = "";
// GenericUtility genericUtility = null; // GenericUtility genericUtility = null;
ITMDBAccessEJB itmDBAccessEJB = null; //ITMDBAccessEJB itmDBAccessEJB = null;
FinCommon Fcommon = new FinCommon(); //FinCommon Fcommon = new FinCommon();
// genericUtility = new GenericUtility(); // genericUtility = new GenericUtility();
String siteCode= null,finEntity= null,currCode= null,acctCode= null,cctrCode= null; String siteCode= null,finEntity= null,currCode= null,acctCode= null,cctrCode= null;
String refNo= null,custCode= null,crTerm= null,itemSer= null,finScheme= null; String refNo= null,custCode= null,crTerm= null,itemSer= null,finScheme= null;
String salesPers= null,salesPers1= null,salesPers2= null,contactCode= null,saleOrder= null; String salesPers= null,salesPers1= null,salesPers2= null,contactCode= null,saleOrder= null;
String status= null,refSerOrg= null,tranSer= null,auotRcp= null,bankCode= null; String refSerOrg= null,tranSer= null,bankCode= null;
String refType= null,autoRcp= null,lineNoRef= null; String refType= null,autoRcp= null,lineNoRef= null;
String gpNo= null,gpDate= null,custRefNo= null,custRefDate= null,custRefAmt= null; String gpNo= null,gpDate= null,custRefNo= null,custRefDate= null,custRefAmt= null;
String keyString = null,recvTranID = null; String keyString = null,recvTranID = null;
String reasCode=null; String reasCode=null;
double totAmt=0,diffAmt=0,adjAmt=0,taxAmt=0,exchRate=0,discount=0,mrpValue=0; double totAmt=0,taxAmt=0,exchRate=0,discount=0,mrpValue=0;
java.sql.Timestamp dueDate = null; java.sql.Timestamp dueDate = null;
java.sql.Timestamp tranDate = null; java.sql.Timestamp tranDate = null;
...@@ -11786,6 +12273,7 @@ public class FinCommon ...@@ -11786,6 +12273,7 @@ public class FinCommon
recvTranID = tg.generateTranSeqID("RCVL","tran_id",keyString,conn); recvTranID = tg.generateTranSeqID("RCVL","tran_id",keyString,conn);
System.out.println("Transaction Id Generated for Receivables :"+recvTranID); System.out.println("Transaction Id Generated for Receivables :"+recvTranID);
try{ //poonam
sql =" INSERT INTO RECEIVABLES (TRAN_ID,TRAN_SER,TRAN_DATE,REF_NO,REF_DATE,CURR_CODE,EXCH_RATE," sql =" INSERT INTO RECEIVABLES (TRAN_ID,TRAN_SER,TRAN_DATE,REF_NO,REF_DATE,CURR_CODE,EXCH_RATE,"
+" CUST_CODE,ACCT_CODE,CCTR_CODE,DUE_DATE,FIN_ENTITY,SITE_CODE,TOT_AMT,ADJ_AMT,STATUS, " +" CUST_CODE,ACCT_CODE,CCTR_CODE,DUE_DATE,FIN_ENTITY,SITE_CODE,TOT_AMT,ADJ_AMT,STATUS, "
+" STAT_DATE,DISCOUNT,TAX_AMT,AUTO_RCP,BANK_CODE,RECD,REF_TYPE,CR_TERM,SALES_PERS,ITEM_SER, " +" STAT_DATE,DISCOUNT,TAX_AMT,AUTO_RCP,BANK_CODE,RECD,REF_TYPE,CR_TERM,SALES_PERS,ITEM_SER, "
...@@ -11845,6 +12333,17 @@ public class FinCommon ...@@ -11845,6 +12333,17 @@ public class FinCommon
} }
pstmt.close(); pstmt.close();
pstmt =null; pstmt =null;
}
catch(SQLException se)//Added by poonam on 28-07-16 for exception handling:Start
{
System.out.println("SQLException []:gbfReceivablesUpd()[Excuting Query Failed]" + sql +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
return errString ;
}
//Added by poonam on 28-07-16 for exception handling:End
} }
catch(SQLException e) catch(SQLException e)
...@@ -11905,7 +12404,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit ...@@ -11905,7 +12404,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
Statement stmtPeriod = null; Statement stmtPeriod = null;
String dtFormat=""; //$NON-NLS-1$ String dtFormat=""; //$NON-NLS-1$
java.text.SimpleDateFormat dtf=null; java.text.SimpleDateFormat dtf=null;
java.util.Date currDate =null; //java.util.Date currDate =null;
String dateString = ""; //$NON-NLS-1$ String dateString = ""; //$NON-NLS-1$
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
// System.out.println("modCode:"+modCode+"tranDate:"+tranDate+"\nsiteCode"+siteCode); // System.out.println("modCode:"+modCode+"tranDate:"+tranDate+"\nsiteCode"+siteCode);
...@@ -12378,7 +12877,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit ...@@ -12378,7 +12877,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
} }
rs23.close(); rs23.close();
stmt23.close(); stmt23.close();
if (errCode == null && errCode.length() == 0) if (errCode == null || errCode.length() == 0)
{ {
sql24 = "SELECT BLACK_LISTED FROM CUSTOMER WHERE CUST_CODE = '" + custCode + "'"; //$NON-NLS-1$ //$NON-NLS-2$ sql24 = "SELECT BLACK_LISTED FROM CUSTOMER WHERE CUST_CODE = '" + custCode + "'"; //$NON-NLS-1$ //$NON-NLS-2$
stmt24 = conn.createStatement(); stmt24 = conn.createStatement();
......
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