Commit e50f73a1 authored by kshinde's avatar kshinde

Bug fix in getProject

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@196762 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7227ec9d
...@@ -11724,6 +11724,11 @@ public class FinCommon ...@@ -11724,6 +11724,11 @@ public class FinCommon
*/ */
public String getProject(String refSer,String refId,Connection conn) throws ITMException//Added by Jiten public String getProject(String refSer,String refId,Connection conn) throws ITMException//Added by Jiten
{ {
Statement stmt = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "",projectCode = "",tname="";
try{
Statement stmt = null; Statement stmt = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
...@@ -11732,25 +11737,23 @@ public class FinCommon ...@@ -11732,25 +11737,23 @@ public class FinCommon
//stmt = conn.createStatement(); //stmt = conn.createStatement();
if(refSer.equalsIgnoreCase("JOUR")){ if(refSer.equalsIgnoreCase("JOUR")){
sql = "select proj_code from journal where tran_id = '"+refId+"'"; sql = "select proj_code from journal where tran_id = '"+refId+"'";
tname = "journal"; //tname = "journal";
} }
if(refSer.equalsIgnoreCase("E-PAY")){ if(refSer.equalsIgnoreCase("E-PAY")){
//sql = "select proj_code from payment_exp where tran_id = '"+refId+"'"; sql = "select proj_code from payment_exp where tran_id = '"+refId+"'";
tname = "payment_exp"; //tname = "payment_exp";
} }
if(refSer.equalsIgnoreCase("M-VOUC")){ if(refSer.equalsIgnoreCase("M-VOUC")){
//sql = "select proj_code from misc_voucher where tran_id = '"+refId+"'"; sql = "select proj_code from misc_voucher where tran_id = '"+refId+"'";
tname = "misc_voucher"; //tname = "misc_voucher";
} }
if(refSer.equalsIgnoreCase("VOUCH")){ if(refSer.equalsIgnoreCase("VOUCH")){
//sql = "select proj_code from voucher where tran_id = '"+refId+"'"; sql = "select proj_code from voucher where tran_id = '"+refId+"'";
tname = "voucher"; //tname = "voucher";
} }
if(tname.trim().length() > 0){ if(sql.trim().length() > 0){
sql = "select proj_code from '"+tname+"' where tran_id = ? ";
//rs = stmt.executeQuery(sql);
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, refId);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()){ if(rs.next()){
projectCode = rs.getString(1); projectCode = rs.getString(1);
...@@ -11783,6 +11786,18 @@ public class FinCommon ...@@ -11783,6 +11786,18 @@ public class FinCommon
}catch(Exception e1){} }catch(Exception e1){}
} }
return projectCode; return projectCode;
}catch(Exception e){
System.out.println("Exception in getProject [Fincommon]"+e);
e.printStackTrace();
throw new ITMException(e);
}
finally{
try{
if(stmt != null) stmt.close();
if(rs != null)rs.close();
}catch(Exception e1){}
}
return projectCode;
} }
//nvo_business_object_fin - gbf_get_entry_batch_no() //nvo_business_object_fin - gbf_get_entry_batch_no()
public String getEntryBatchNo(String refSer,String periodCode) throws ITMException//Added by Jiten public String getEntryBatchNo(String refSer,String periodCode) throws ITMException//Added by Jiten
......
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