Commit a39f4c5e authored by prane's avatar prane

Pay IBACA bug fix in confirmation - wrong accounting effect , ejb component

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@173113 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cbe8ac14
...@@ -1885,7 +1885,7 @@ conn = getConnection(); ...@@ -1885,7 +1885,7 @@ conn = getConnection();
pstmt.setString(23,remarks); pstmt.setString(23,remarks);
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close(); pstmt.close();
System.out.println(">>>>>>>>@1888::tran_id["+ibcaId+"]");
sql =" insert into pay_ibca_det (tran_id,ref_ser,ref_no,ref_date,curr_code,exch_rate, " sql =" insert into pay_ibca_det (tran_id,ref_ser,ref_no,ref_date,curr_code,exch_rate, "
+" sundry_type,sundry_code,acct_code,cctr_code,due_date,tot_amt,discount,tax_amt, " +" sundry_type,sundry_code,acct_code,cctr_code,due_date,tot_amt,discount,tax_amt, "
+" auto_pay,bank_code,ref_type,bill_no,bill_date,pay_mode,entry_batch_no,purc_order, " +" auto_pay,bank_code,ref_type,bill_no,bill_date,pay_mode,entry_batch_no,purc_order, "
...@@ -1931,8 +1931,12 @@ conn = getConnection(); ...@@ -1931,8 +1931,12 @@ conn = getConnection();
errString = payIbcaConf.confirm(ibcaId, xtraParams, "", conn); errString = payIbcaConf.confirm(ibcaId, xtraParams, "", conn);
if(errString != null && errString.indexOf("VTCICONF3") != -1) if(errString != null && errString.indexOf("VTCICONF3") != -1)
{ {
//System.out.println("errString.indexOf::["+errString.indexOf("VTCICONF3")+"]"); System.out.println("errString.indexOf::["+errString.indexOf("VTCICONF3")+"]");
errString = ""; errString = "";
}//else condition added BY Pavan R on 06/NOV/17
else
{
return errString;
} }
} }
...@@ -2273,6 +2277,7 @@ conn = getConnection(); ...@@ -2273,6 +2277,7 @@ conn = getConnection();
int upd = pstmt.executeUpdate(); int upd = pstmt.executeUpdate();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println(">>>>>::Ref_Ser["+refSer+"]Ref_No["+refNo+"]");
}//for end }//for end
if(errString != null && errString.trim().length() > 0) if(errString != null && errString.trim().length() > 0)
{ {
...@@ -2813,7 +2818,7 @@ conn = getConnection(); ...@@ -2813,7 +2818,7 @@ conn = getConnection();
rSer = (String)glTraceMap.get("ref_ser"); rSer = (String)glTraceMap.get("ref_ser");
rId = (String)glTraceMap.get("ref_id"); rId = (String)glTraceMap.get("ref_id");
glTraceMap.put("party_doc_ref",Fcommon.gfGetPartyDocRef(rSer,rId,conn)); glTraceMap.put("party_doc_ref",Fcommon.gfGetPartyDocRef(rSer,rId,conn));
System.out.println(">>>>@2821::glTraceMap["+glTraceMap+"]");
errString = Fcommon.glTraceUpdate(glTraceMap,conn); errString = Fcommon.glTraceUpdate(glTraceMap,conn);
if(errString != null && errString.trim().length() > 0) if(errString != null && errString.trim().length() > 0)
{ {
......
...@@ -31,11 +31,19 @@ import java.text.*; ...@@ -31,11 +31,19 @@ import java.text.*;
import javax.ejb.Stateless; import javax.ejb.Stateless;
@Stateless @Stateless
public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, PayIbcaConfRemote public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, PayIbcaConfRemote
{ {
// GenericUtility genericUtility = GenericUtility.getInstance(); // GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
FinCommon finCommon = new FinCommon();
//Added By Pavan R on 06/NOV/17 Start
FinCommon finCommon = new FinCommon();
String tranId1 ="";
//Added By Pavan R on 06/NOV/17 End
public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException
{ {
String retString = ""; String retString = "";
...@@ -74,6 +82,11 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -74,6 +82,11 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = null; ValidatorEJB validatorEJB = null;
System.out.println("tran id = "+tranId); System.out.println("tran id = "+tranId);
//Added By Pavan R on 06/NOV/17 Start
tranId1 = tranId;
//Added By Pavan R on 06/NOV/17 End
boolean connStatus=false; boolean connStatus=false;
String chgUser=""; String chgUser="";
java.sql.Timestamp tranDate = null, today = null; java.sql.Timestamp tranDate = null, today = null;
...@@ -421,7 +434,7 @@ conn = getConnection(); ...@@ -421,7 +434,7 @@ conn = getConnection();
private String gbfPostPibca(HashMap HdrMap, ArrayList DetList, String xtraParams, Connection conn) throws ITMException private String gbfPostPibca(HashMap HdrMap, ArrayList DetList, String xtraParams, Connection conn) throws ITMException
{ {
String errCode = "",keyFld = "" , expHdr = "",expDet = "", winName = "", ledgPostconf= "" , ledgPostConf, String errCode = "",keyFld = "" , expHdr = "",expDet = "", winName = "", ledgPostconf= "" , ledgPostConf,
sql = "" ,winname ="" ,loginEmpCode = ""; sql = "" ,winname ="" ,loginEmpCode = "", postOnline;
String currCode[],custCode[],acctCode[],cctrCode[]; String currCode[],custCode[],acctCode[],cctrCode[];
String tranSer = "" ,linkType = ""; String tranSer = "" ,linkType = "";
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
...@@ -525,7 +538,21 @@ conn = getConnection(); ...@@ -525,7 +538,21 @@ conn = getConnection();
} }
} }
/* System.out.println("tran_id From Confirm::"+tranId1);
//Added By Pavan R on 06/NOV/17 Start
System.out.println("Before POST_ON_LINE.....");
postOnline = checkNullAndTrim(finCommon.getFinparams("999999", "POST_ON_LINE", conn));
System.out.println("Before checkGlTranDrCr::postOnline["+postOnline+"]");
//tranId = (String)HdrMap.get("tran_Id");
System.out.println("before checkGlTranDrCr::tranId["+tranId1+"]");
if("Y".equals(postOnline))
{
errCode = finCommon.checkGlTranDrCr("P-IBCA", tranId1, conn);
}
System.out.println("After checkGlTranDrCr::errCode["+errCode+"]");
//Added By Pavan R on 06/NOV/17 End
//Uncommented by Pavan R start On 06/NOV/17
if(errCode == null || errCode.trim().length() == 0) if(errCode == null || errCode.trim().length() == 0)
{ {
...@@ -537,13 +564,10 @@ conn = getConnection(); ...@@ -537,13 +564,10 @@ conn = getConnection();
pstmt.setString(4, (String)HdrMap.get("tran_Id")); pstmt.setString(4, (String)HdrMap.get("tran_Id"));
pstmt.executeUpdate(); pstmt.executeUpdate();
rs.close();
rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
//Uncommented by Pavan R end On 06/NOV/17
}*/
} }
catch (Exception e) catch (Exception e)
...@@ -901,6 +925,7 @@ conn = getConnection(); ...@@ -901,6 +925,7 @@ conn = getConnection();
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
pstmtDet.clearParameters(); pstmtDet.clearParameters();
pstmtDet.setString(1,newTranId); pstmtDet.setString(1,newTranId);
pstmtDet.setString(2,rs.getString("ref_ser")); pstmtDet.setString(2,rs.getString("ref_ser"));
...@@ -1364,9 +1389,11 @@ conn = getConnection(); ...@@ -1364,9 +1389,11 @@ conn = getConnection();
} }
System.out.println("Before calling gbfPostPibcaDetRcp::link["+link+"]");
if("A".equalsIgnoreCase(link)) if("A".equalsIgnoreCase(link))
{ {
errString = gbfPostPibcaDetRcp(MapHrd, MapDet ,xtraParams ,conn); errString = gbfPostPibcaDetRcp(MapHrd, MapDet ,xtraParams ,conn);
System.out.println("calling gbfPostPibcaDetRcp::errString["+errString+"]");
return errString; return errString;
} }
...@@ -1536,7 +1563,7 @@ conn = getConnection(); ...@@ -1536,7 +1563,7 @@ conn = getConnection();
glTraceMap.put("ref_ser", "P-IBCA"); glTraceMap.put("ref_ser", "P-IBCA");
glTraceMap.put("ref_id", tranId); glTraceMap.put("ref_id", tranId);
glTraceMap.put("remarks", remarks); glTraceMap.put("remarks", remarks);
System.out.println("@@1563 tranId::["+tranId+"]");
System.out.println("1766 glTraceUpdate Called.............."); System.out.println("1766 glTraceUpdate Called..............");
errString = finCommon.glTraceUpdate(glTraceMap,conn); errString = finCommon.glTraceUpdate(glTraceMap,conn);
if(errString != null && errString.trim().length() > 0) if(errString != null && errString.trim().length() > 0)
...@@ -1559,7 +1586,6 @@ conn = getConnection(); ...@@ -1559,7 +1586,6 @@ conn = getConnection();
private String gbfPostPibcaDetRcp(HashMap HdrMap , ArrayList DetList ,String xtraParams, Connection conn) throws ITMException private String gbfPostPibcaDetRcp(HashMap HdrMap , ArrayList DetList ,String xtraParams, Connection conn) throws ITMException
{ {
System.out.println("gbfPostPibcaDetRcp called.............."); System.out.println("gbfPostPibcaDetRcp called..............");
String errString = ""; String errString = "";
String currCode = ""; String currCode = "";
...@@ -1652,7 +1678,8 @@ conn = getConnection(); ...@@ -1652,7 +1678,8 @@ conn = getConnection();
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
tranId = (String)HdrMap.get("tranId"); //tranid to tran_Id Changed by Pavan R on On 06/NOV/17
tranId = (String)HdrMap.get("tran_id");
tranDate = (Timestamp)HdrMap.get("tran_date"); tranDate = (Timestamp)HdrMap.get("tran_date");
effDate = (Timestamp)HdrMap.get("eff_date"); effDate = (Timestamp)HdrMap.get("eff_date");
finEntity = (String)HdrMap.get("fin_entity__to"); finEntity = (String)HdrMap.get("fin_entity__to");
...@@ -1714,9 +1741,11 @@ conn = getConnection(); ...@@ -1714,9 +1741,11 @@ conn = getConnection();
glTraceMap.put("cr_amt",0.0); glTraceMap.put("cr_amt",0.0);
} }
glTraceMap.put("ref_type","F"); glTraceMap.put("ref_type","F");
glTraceMap.put("ref_ser", "RCP"); //RCP ref_ser changed to P-IBCA Changed by Pavan R on On 06/NOV/17
glTraceMap.put("ref_ser", "P-IBCA");
glTraceMap.put("ref_id", tranId); glTraceMap.put("ref_id", tranId);
glTraceMap.put("remarks",remarks); glTraceMap.put("remarks",remarks);
System.out.println();
System.out.println("848 glTraceUpdate Called.............."); System.out.println("848 glTraceUpdate Called..............");
errString = finCommon.glTraceUpdate(glTraceMap,conn); errString = finCommon.glTraceUpdate(glTraceMap,conn);
...@@ -1767,9 +1796,45 @@ conn = getConnection(); ...@@ -1767,9 +1796,45 @@ conn = getConnection();
///Populate the misc_payables structure ///// ///Populate the misc_payables structure /////
// insert into misc_payable // insert into misc_payable
System.out.println("Inside gbfPostPibcaDetFcp::Ref_Ser ["+(String)DetMap.get("ref_ser")+"] :: Ref_No ["+(String)DetMap.get("ref_no")+"]");
//Added By Pavan R on 06/NOV/17 Start to fix in misc_payables table reference series of IBCA is gone wrong. on 03/NOV/17
String ref_No = (String)DetMap.get("ref_no");
String ref_Ser = "";
int ll_cnt = 0;
System.out.println("ref_No::["+ref_No+"]");
sql = "select count(*) as ll_cnt from misc_payables where tran_ser like 'P-IBC%'" +
"AND REF_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,ref_No); //refNo
rs = pstmt.executeQuery();
if(rs.next())
{
ll_cnt = rs.getInt("ll_cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (ll_cnt == 0 )
{
ref_Ser = "P-IBCA";
}
else{
ref_Ser = "P-IBCA"+ll_cnt;
}
//Added By Pavan R on 06/NOV/17 End
miscPayMap = new HashMap(); miscPayMap = new HashMap();
miscPayMap.put("tran_date",tranDate); miscPayMap.put("tran_date",tranDate);
miscPayMap.put("tran_ser",(String)DetMap.get("ref_ser"));
//changed by Pavan R On 06/NOV/17
//miscPayMap.put("tran_ser",(String)DetMap.get("ref_ser"));
miscPayMap.put("tran_ser",ref_Ser);
miscPayMap.put("ref_no",(String)DetMap.get("ref_no")); miscPayMap.put("ref_no",(String)DetMap.get("ref_no"));
miscPayMap.put("ref_date", (Timestamp)DetMap.get("ref_date")); miscPayMap.put("ref_date", (Timestamp)DetMap.get("ref_date"));
miscPayMap.put("bill_no", (String)DetMap.get("bill_no")); miscPayMap.put("bill_no", (String)DetMap.get("bill_no"));
...@@ -1800,6 +1865,7 @@ conn = getConnection(); ...@@ -1800,6 +1865,7 @@ conn = getConnection();
miscPayMap.put("paid", "N"); miscPayMap.put("paid", "N");
miscPayMap.put("hold_amt", holdAmt); miscPayMap.put("hold_amt", holdAmt);
System.out.println("miscPayMap::["+miscPayMap+"]");
System.out.println("884 sundryBaleUpdate Called.............."); System.out.println("884 sundryBaleUpdate Called..............");
errString = finCommon.gbfMiscPayUpd(miscPayMap, conn); errString = finCommon.gbfMiscPayUpd(miscPayMap, conn);
if(errString != null && errString.trim().length() > 0) if(errString != null && errString.trim().length() > 0)
...@@ -1842,5 +1908,20 @@ conn = getConnection(); ...@@ -1842,5 +1908,20 @@ conn = getConnection();
return retVal; return retVal;
} }
//Added By Pavan R on 06/NOV/17 Start
public String checkNullAndTrim( String inputVal )
{
if ( inputVal == null )
{
inputVal = "";
}
else
{
inputVal = inputVal.trim();
}
return inputVal;
}
//Added By Pavan R on 06/NOV/17 End
} }
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