Commit 9fe4078a authored by vvengurlekar's avatar vvengurlekar

PayIbcaConf.java- Changes done for IBCA Payables confirmation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@196900 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7d4c6294
......@@ -53,15 +53,19 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
try
{
retString = confirm( tranID, xtraParams, forcedFlag, conn );
if ( retString != null && retString.length() > 0 )
System.out.println("retString in PayIbcaConf::: ["+retString+"]");
//changed confirmation condition in below line by Varsha V
//if ( retString != null && retString.length() > 0 )
if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0)
{
throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]");
}
}
catch(Exception exception)
{
System.out.println("Exception in [InvHoldConfEJB] getCurrdateAppFormat " + exception.getMessage());
System.out.println("Exception in [PayIbcaConf] confirm " + exception.getMessage());
//Added by Varsha V for throwing exception on 07-02-19
throw new ITMException(exception);
}
return retString;
}
......@@ -80,7 +84,8 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
FinCommon finCommon = null;
// GenericUtility genericUtility = null;
ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = null;
//Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = null;
System.out.println("tran id = "+tranId);
//Added By Pavan R on 06/NOV/17 Start
......@@ -108,8 +113,10 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
finCommon = new FinCommon();
//genericUtility = new GenericUtility();
itmDBAccessEJB = new ITMDBAccessEJB();
validatorEJB = new ValidatorEJB();
loginEmpCode =validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//Commented BY Varsha V object no longer required on 07-02-19
//validatorEJB = new ValidatorEJB();
//loginEmpCode =validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode =genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
System.out.println("Printing loginEmpCode---1-----"+loginEmpCode+"--");
......@@ -154,16 +161,19 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
{
errString = gbfRetrievePibca(tranId,siteCode,xtraParams,conn);
System.out.println("err String from gdfRetrieveMiscRcp ="+errString);
if(errString != null && errString.trim().length() > 0)
//Condition changed by Varsha V on 07-02-19 not to return if success
//if(errString != null && errString.trim().length() > 0)
if((errString != null && errString.trim().length() > 0) && errString.indexOf("VTCICONF3") < 0)
{
return errString;
}
if(errString != null && errString.trim().length() > 0)
/*if(errString != null && errString.trim().length() > 0)
{
return errString;
}
if(errString == null || errString.trim().length() == 0)
}*///Commented by Varsha V on 07-02-19 because condition already added
//Condition changed by Varsha V on 07-02-19 not to return if success
//if(errString == null || errString.trim().length() == 0)
if((errString == null || errString.trim().length() == 0)|| errString.indexOf("VTCICONF3") >-1)
{
if("null".equalsIgnoreCase(loginEmpCode) || loginEmpCode==null || loginEmpCode.trim().length()==0)
{
......@@ -209,7 +219,7 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
try
{
System.out.println("connStatus:: ["+connStatus+"]");
if( conn != null && !conn.isClosed() && connStatus )
{
if(errString.indexOf("VTCICONF3") > -1)
......@@ -425,6 +435,7 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
}
errCode = gbfPostPibca(HdrMap,DetList,xtraParams,conn);
System.out.println("err String from gbfPostPibca ="+errCode);
}
catch(Exception e)
{
......@@ -451,12 +462,15 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
PreparedStatement pstmt = null;
ResultSet rs = null;
int cntrHdr = 0,cntr = 0,insertedRow = 0,rows = 0, ediOption = 0;
ValidatorEJB validatorEJB = null;
validatorEJB = new ValidatorEJB();
//Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = null;
//validatorEJB = new ValidatorEJB();
java.sql.Timestamp tranDate, today;
try
{
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
today = new java.sql.Timestamp(System.currentTimeMillis()) ;
sql = "select edi_option from transetup where tran_window = 'w_pay_ibca'";
pstmt = conn.prepareStatement(sql);
......@@ -475,11 +489,12 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
if("I".equalsIgnoreCase(tranSer))
{
errCode = gbfPostPibcaHdrIss(HdrMap,xtraParams,conn);
System.out.println("err String from gbfPostPibcaHdrIss ="+errCode);
if(errCode == null || errCode.trim().length() == 0)
{
errCode = gbfPostPibcaDetIss(HdrMap,DetList,xtraParams,conn);
System.out.println("err String from gbfPostPibcaDetIss ="+errCode);
if(errCode == null || errCode.trim().length() == 0)
{
......@@ -504,20 +519,28 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
return errCode;
}
}
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
}
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
}
}
if("R".equalsIgnoreCase(tranSer))
}//added else keyword by Varsha V on 07-02-19
else if("R".equalsIgnoreCase(tranSer))
{
errCode = gbfPostPibcaHdrRcp(HdrMap,xtraParams,conn);
System.out.println("err String from gbfPostPibcaHdrRcp ="+errCode);
if(errCode == null || errCode.trim().length() == 0)
{
errCode = gbfPostPibcaDetRcp(HdrMap,DetList, xtraParams ,conn);
System.out.println("err String from gbfPostPibcaDetRcp ="+errCode);
if(errCode == null || errCode.trim().length() == 0)
{
......@@ -542,8 +565,16 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
return errCode;
}
}
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
}
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
}
}
System.out.println("tran_id From Confirm::"+tranId1);
......@@ -665,14 +696,16 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
PreparedStatement pstmt = null;
ResultSet rs = null;
FinCommon finCommon = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
//Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = null;
try
{
finCommon =new FinCommon();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//java.util.Date today= new java.sql.Date(new java.util.Date().getTime());
itmDBAccessEJB = new ITMDBAccessEJB();
......@@ -1110,7 +1143,8 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
FinCommon finCommon = null;
DistCommon distCommon = null;
ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
//Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
java.sql.Timestamp dateInterest = null;
......@@ -1119,8 +1153,9 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
finCommon = new FinCommon();
distCommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
//Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
finlink = finCommon.getFinparams("999999", "ADM_FIN_LINK", conn);
tranDate = (Timestamp)MapHrd.get("tran_date");
......@@ -1513,14 +1548,17 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
PreparedStatement pstmt = null;
ResultSet rs = null;
FinCommon finCommon = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
//Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = null;
try
{
finCommon =new FinCommon();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
java.util.Date today= new java.sql.Date(new java.util.Date().getTime());
itmDBAccessEJB = new ITMDBAccessEJB();
......@@ -1684,14 +1722,17 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
FinCommon finCommon = null;
DistCommon distCommon = null;
ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
//Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
try
{
finCommon = new FinCommon();
distCommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
//Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//tranid to tran_Id Changed by Pavan R on On 06/NOV/17
tranId = (String)HdrMap.get("tran_id");
......@@ -1891,9 +1932,6 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
return errString;
}
}
}
catch(Exception e)
......@@ -1908,20 +1946,26 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
}
public double getReqDecimal(double actVal, int prec)
public double getReqDecimal(double actVal, int prec) throws ITMException
{
String fmtStr = "############0";
String strValue = null;
double retVal = 0;
if (prec > 0)
{
fmtStr = fmtStr + "." + "000000000".substring(0, prec);
try {
if (prec > 0)
{
fmtStr = fmtStr + "." + "000000000".substring(0, prec);
}
DecimalFormat decFormat = new DecimalFormat(fmtStr);
retVal = Double.parseDouble(decFormat.format(actVal));
if (Math.abs(retVal) == 0)
{
retVal = 0;
}
}
DecimalFormat decFormat = new DecimalFormat(fmtStr);
retVal = Double.parseDouble(decFormat.format(actVal));
if (Math.abs(retVal) == 0)
{
retVal = 0;
catch (Exception e) {
e.printStackTrace();
throw new ITMException(e);
}
return retVal;
}
......
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