Commit c7279217 authored by manohar's avatar manohar

Changes for multi currency receipt


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93672 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5446deed
......@@ -28,6 +28,26 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
DistCommon disCommon = null;
ValidatorEJB validator = null;
public String wfValData(String xmlString, String xmlString1, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
String errString = "";
Document dom = null;
Document dom1 = null;
Document dom2 = null;
try
{
System.out.println("Val xmlString :: " + xmlString);
System.out.println("Val xmlString1 :: " + xmlString1);
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
}
catch (Exception e)
{
throw new ITMException(e);
}
return errString;
}
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
String errString = "";
......@@ -230,6 +250,8 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
else if(childNodeName.equalsIgnoreCase("cust_code"))
{
custCode = this.genericUtility.getColumnValue("cust_code", dom);
// 21/09/13 manoharan commented and added call to common function
/*
if(custCode != null && custCode.trim().length() > 0 )
{
sql = "select count(*) from customer where cust_code = ?";
......@@ -289,6 +311,14 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
*/
siteCode = this.genericUtility.getColumnValue("site_code", dom);
errCode = finCommon.isSundryCode(siteCode, "C", custCode, "RCP", conn);
if (errCode != null && errCode.trim().length() > 0 )
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if (childNodeName.equalsIgnoreCase("site_code"))
......@@ -1692,12 +1722,14 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
int errListSize = errList.size();
cnt = 0;
String errFldName = null;
System.out.println("errListSize [" + errListSize + "] errFields size [" + errFields.size() + "]");
if ((errList != null) && (errListSize > 0))
{
for (cnt = 0; cnt < errListSize; cnt++)
{
errCode = (String)errList.get(cnt);
errFldName = (String)errFields.get(cnt);
System.out.println(" cnt [" + cnt + "] errCode [" + errCode + "] errFldName [" + errFldName + "]");
errString = getErrorString(errFldName, errCode, userId);
errorType = errorType(conn, errCode);
if (errString.length() > 0)
......@@ -2153,6 +2185,26 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
return errCode;
}*/
public String itemChanged(String xmlString, String xmlString1, String objContext, String currentColumn, String editFlag, String xtraParams)
throws RemoteException, ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String valueXmlString = "";
try
{
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
valueXmlString = itemChanged(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams);
}
catch (Exception e)
{
System.out.println("Exception : [MiscVal][itemChanged( String, String )] :==>\n" +
e.getMessage());
}
return valueXmlString;
}
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams)
throws RemoteException, ITMException
{
......@@ -2178,6 +2230,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
return valueXmlString;
}
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams)
throws RemoteException, ITMException
{
......@@ -2288,6 +2341,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
int currentFormNo = 0;
int childNodeListLength = 0;
java.util.Date tranDate = null;
//String tranDate = null;
java.util.Date refDate = null;
java.util.Date effDate = null;
java.util.Date dueDate = null;
......@@ -2296,7 +2350,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
ArrayList errFields = new ArrayList();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/mm/dd");
SimpleDateFormat dateFormat1 = new SimpleDateFormat("dd/MM/yy");
SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd-MMM-yy");
//SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd-MMM-yy");
SimpleDateFormat sdf;
StringBuffer valueXmlString = new StringBuffer();
Connection conn = null;
......@@ -2574,7 +2628,10 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
valueXmlString.append("<acct_code__ar>").append("<![CDATA[]]>").append("</acct_code__ar>");
valueXmlString.append("<cctr_code__ar>").append("<![CDATA[]]>").append("</cctr_code__ar>");
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom));
mexchrate = takeExchRate(currCode, "", siteCode, tranDate, "S", conn);
// 21/09/13 manoharan caqll common function
//mexchrate = takeExchRate(currCode, "", siteCode, tranDate, "S", conn);
mexchrate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom), "S", conn);
currCode = genericUtility.getColumnValue("curr_code", dom);
setNodeValue(dom, "curr_code", getAbsString(currCode));
tranIdAdvbking = genericUtility.getColumnValue("tran_id__advbking", dom);
......@@ -2674,11 +2731,14 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
valueXmlString.append("<acct_code__ar>").append("<![CDATA[" + acctCodeAr + "]]>").append("</acct_code__ar>");
valueXmlString.append("<cctr_code__ar>").append("<![CDATA[" + cctrCodeAr + "]]>").append("</cctr_code__ar>");
valueXmlString.append("<curr_code>").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
bankName = (bankName== null ? "" : bankName);
valueXmlString.append("<cust_bank_ref>").append("<![CDATA[" + bankName + "]]>").append("</cust_bank_ref>");
valueXmlString.append("<acct_code__adv>").append("<![CDATA[" + acctCodeAdv + "]]>").append("</acct_code__adv>");
valueXmlString.append("<cctr_code__adv>").append("<![CDATA[" + cctrCodeAdv + "]]>").append("</cctr_code__adv>");
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom));
mexchrate = takeExchRate(currCode, "", siteCode, tranDate, "S", conn);
// 21/09/13 manoharan caqll common function
//mexchrate = takeExchRate(currCode, "", siteCode, tranDate, "S", conn);
mexchrate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom), "S", conn);
tranIdAdvbking = genericUtility.getColumnValue("tran_id__advbking", dom);
if ((tranIdAdvbking == null) || (tranIdAdvbking.length() == 0))
{
......@@ -2759,7 +2819,9 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
currCode = genericUtility.getColumnValue("curr_code", dom);
siteCode = genericUtility.getColumnValue("site_code", dom);
tranDate = dateFormat1.parse(getColumnValue("tran_date", dom));
mexchrate = takeExchRate(currCode, "", siteCode, tranDate, "S", conn);
// 21/09/13 manoharan caqll common function
//mexchrate = takeExchRate(currCode, "", siteCode, tranDate, "S", conn);
mexchrate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom), "S", conn);
lsAdvbking = genericUtility.getColumnValue("tran_id__advbking", dom);
if ((lsAdvbking == null) || (lsAdvbking.trim().length() == 0))
{
......@@ -2985,7 +3047,10 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
pstmt.close();
pstmt = null;
}
hexchRate = doublevalue(genericUtility.getColumnValue("exch_rate", dom1));
// 21/09/13 manoharan to get the exchange rate for detail currency
//hexchRate = doublevalue(genericUtility.getColumnValue("exch_rate", dom1));
siteCode = genericUtility.getColumnValue("site_code", dom1);
hexchRate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom1), "S", conn);
sql = "select descr from currency where currency.curr_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode);
......@@ -3059,10 +3124,24 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
valueXmlString.append("<bill_disc>").append("<![CDATA[" + billDisc + "]]>").append("</bill_disc>");
valueXmlString.append("<curr_code>").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
valueXmlString.append("<currency_descr>").append("<![CDATA[" + currDescr + "]]>").append("</currency_descr>");
valueXmlString.append("<ref_date>").append("<![CDATA[" + simpleDateFormat.format(refDate) + "]]>").append("</ref_date>");
valueXmlString.append("<exch_rate>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate>");
if (refDate != null )
{
valueXmlString.append("<ref_date>").append("<![CDATA[" + simpleDateFormat.format(refDate) + "]]>").append("</ref_date>");
}
else
{
valueXmlString.append("<ref_date/>");
}
valueXmlString.append("<exch_rate>").append("<![CDATA[" + hexchRate + "]]>").append("</exch_rate>");
valueXmlString.append("<exch_rate__rcv>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate__rcv>");
valueXmlString.append("<due_date>").append("<![CDATA[" + simpleDateFormat.format(dueDate)+ "]]>").append("</due_date>");
if (dueDate != null )
{
valueXmlString.append("<due_date>").append("<![CDATA[" + simpleDateFormat.format(dueDate)+ "]]>").append("</due_date>");
}
else
{
valueXmlString.append("<due_date/>");
}
valueXmlString.append("<disc_amt>").append("<![CDATA[" + discount + "]]>").append("</disc_amt>");
valueXmlString.append("<tax_amt>").append("<![CDATA[" + taxAmt + "]]>").append("</tax_amt>");
valueXmlString.append("<net_amt>").append("<![CDATA[" + totAmt + "]]>").append("</net_amt>");
......@@ -3194,6 +3273,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
billDisc = "N";
refNo = genericUtility.getColumnValue("ref_no", dom);
refSer = genericUtility.getColumnValue("ref_ser", dom);
rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom));
sql = "select bill_disc FROM receivables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
......@@ -3227,8 +3307,12 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
pstmt.close();
pstmt = null;
rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom));
hexchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate", dom));
// 21/09/13 manoharan
//hexchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate", dom));
siteCode = genericUtility.getColumnValue("site_code", dom1);
currCode = genericUtility.getColumnValue("curr_code", dom);
hexchRate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom1), "S", conn);
exchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate__rcv", dom));
}
bdFluctuationCf = finCommon.getFinparams("999999", "BD_FLUCTUATION_CF" ,conn);
......@@ -3243,7 +3327,13 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
}
else
{
diffAmtExch = rcpAmt * exchRate - rcpAmt * hexchRate;
siteCode = genericUtility.getColumnValue("site_code", dom1);
currCode = genericUtility.getColumnValue("curr_code", dom);
exchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate__rcv", dom));
hexchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate", dom)); //finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom1), "S", conn);
System.out.println("rcp_amt change calculating diff_amt__exch rcpAmt [" + rcpAmt + "] exchRate[" + exchRate + "] hexchRate ["+ hexchRate+ "]" );
diffAmtExch = (rcpAmt * exchRate) - (rcpAmt * hexchRate);
valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + diffAmtExch + "]]>").append("</diff_amt__exch>");
}
......@@ -3603,7 +3693,9 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
htranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom1));
hsiteCode = genericUtility.getColumnValue("site_code", dom1);
hcurrCode = genericUtility.getColumnValue("curr_code", dom1);
mexchrate = takeExchRate(currCode, "", hsiteCode, htranDate, "S", conn);
// 21/09/13 manoharan caqll common function
//mexchrate = takeExchRate(currCode, "", hsiteCode, htranDate, "S", conn);
mexchrate = finCommon.getDailyExchRateSellBuy(currCode,"",hsiteCode, genericUtility.getColumnValue("tran_date", dom1), "S", conn);
valueXmlString.append("<exch_rate>").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate>");
sql = "select finent.curr_code from site, finent where ( site.fin_entity = finent.fin_entity and site.site_code = ? )";
pstmt = conn.prepareStatement(sql);
......@@ -3792,7 +3884,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
return 0;
}
private double takeExchRate(String currCode, String blank, String siteCode, java.util.Date tranDate, String type, Connection conn)
/*private double takeExchRate(String currCode, String blank, String siteCode, java.util.Date tranDate, String type, Connection conn)
{
PreparedStatement pstmt = null;
ResultSet rs = null;
......@@ -3965,7 +4057,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
System.out.println(e.getMessage());
}
return exchRate;
}
} */
private String checkBadDebtAmt(int value, Connection conn, Document dom)
{
......
......@@ -18,11 +18,13 @@ public interface ReceiptAdvLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
......
package ibase.webitm.ejb.fin;
import ibase.system.config.AppConnectParm;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.MasterStatefulLocal;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.naming.InitialContext;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.w3c.dom.Document;
@javax.ejb.Stateless
public class ReceiptAdvPostSave extends ValidatorEJB implements ReceiptAdvPostSaveLocal, ReceiptAdvPostSaveRemote
{
FinCommon finCommon = new FinCommon();
DistCommon distCommon = new DistCommon();
public String postSave()throws RemoteException,ITMException
{
return "";
}
public String postSave( String domString, String editFlag, String xtraParams, Connection conn ) throws RemoteException,ITMException
{
System.out.println("In ReceiptAdvPostSave ... ");
PreparedStatement pstmt = null;
Document dom = null;
ResultSet rs =null;
boolean isError = false;
String tranIdRcp = "";
String tranId = "",lineNo="";
String errString ="";
String xmlString =null;
String sql = null;
String sqlC=null;
StringBuffer xmlBuff = new StringBuffer();
//PreparedStatement pstmt=null;
String bankCode = null;
String finEntity = null;
String currCode = null;
double exchRate = 0;
double chqAmt = 0;
String tranDate =null;
String custCode =null;
String siteCode = null;
String acctCodeBal = null;
String acctCodeAr = null;
String cctrCodeBal = null;
String cctrCodeAr = null;
String acctCodeAdv = null;
String cctrCodeAdv = null;
String refNo = null;
String itemSer = null;
String varValue = "";
String loginEmpCode = "";
String cctrFin = "";
String cctrFinS = "";
String acctFin = "";
String acctFinS = "";
double rcpAmt=0,finChg=0, diffAmtExchDet = 0, diffAmtExchAdv = 0, diffAmtExchEpc = 0;
int cnt=0;
try
{
GenericUtility genericUtility = GenericUtility.getInstance();
dom = genericUtility.parseString(domString);
tranId = GenericUtility.getInstance().getColumnValue("tran_id",dom);
//for(int i=0;i<dom.getElementsByTagName("Detail2").getLength() ; i++)
//{
//lineNo= GenericUtility.getInstance().getColumnValueFromNode("line_no",dom.getElementsByTagName("Detail2").item(i));
//rcpAmt = Double.parseDouble(GenericUtility.getInstance().getColumnValueFromNode("rcp_amt",dom.getElementsByTagName("Detail2").item(i)));
//finChg = Double.parseDouble(GenericUtility.getInstance().getColumnValueFromNode("fin_chg",dom.getElementsByTagName("Detail2").item(i)));
sql="select sum(diff_amt__exch) from rcpdet WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId );
rs = pstmt.executeQuery();
if (rs.next())
{
diffAmtExchDet = rs.getDouble(1);
}
rs.close();
rs = null;
sql="select sum(diff_amt__exch) from rcpadv WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId );
rs = pstmt.executeQuery();
if (rs.next())
{
diffAmtExchAdv = rs.getDouble(1);
}
rs.close();
rs = null;
sql="select sum(diff_amt__exch) from rcpepc_adj WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId );
rs = pstmt.executeQuery();
if (rs.next())
{
diffAmtExchEpc = rs.getDouble(1);
}
rs.close();
rs = null;
sql="select sum(d.rcp_amt * d.exch_rate / h.exch_rate) from receipt h, rcpdet d WHERE h.tran_id = d.tran_id and h.tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId );
rs = pstmt.executeQuery();
if (rs.next())
{
chqAmt = rs.getDouble(1);
}
rs.close();
rs = null;
sql="UPDATE receipt SET bill_amt = ?, chq_amt = ? WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,chqAmt );
pstmt.setDouble(2,chqAmt );
pstmt.setString(3,tranId );
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
sql="UPDATE receipt SET DIFF_AMT__EXCH = ? + ? + ?, net_amt = ((case when adv_amt is null then 0 else adv_amt end)+ (case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end)+ (case when oth_amt is null then 0 else oth_amt end) - (case when bill_disc_amt is null then 0 else bill_disc_amt end) + (case when fin_chg is null then 0 else fin_chg end)) ,net_amt__bc = ((case when adv_amt is null then 0 else adv_amt end)+ (case when bill_amt is null then 0 else bill_amt end)+ (case when advadj_amt is null then 0 else advadj_amt end)+ (case when oth_amt is null then 0 else oth_amt end) - (case when bill_disc_amt is null then 0 else bill_disc_amt end) + (case when fin_chg is null then 0 else fin_chg end)) * exch_rate WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,diffAmtExchDet );
pstmt.setDouble(2,diffAmtExchAdv );
pstmt.setDouble(3,diffAmtExchEpc );
pstmt.setString(4,tranId );
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
if( cnt > 0)
{
System.out.println("update successfully ["+cnt+"]");
}
//}
}
catch(Exception e)
{
try {
conn.rollback();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
isError = true;
System.out.println("Exception :DcdetPostSaveEJB : :==>\n"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
System.out.println("isError ["+isError+"]");
if( conn != null )
{
if( isError )
{
conn.rollback();
}
else
{
conn.commit();
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
catch(Exception e)
{
System.out.println("Exception :SavexPreSaveEJB : :==>\n"+e.getMessage());
try
{
System.out.println("Before rollback");
conn.rollback();
}
catch(SQLException sqle)
{
System.out.println(sqle);
}
throw new ITMException(e);
}
}
System.out.println("Out DcdetPostSaveEJB ... ");
return "";
}
private java.math.BigDecimal round(int scale ,double round)
{
return new java.math.BigDecimal(round).setScale(scale, java.math.BigDecimal.ROUND_UP);
}
private double roundVal(double round,int scale)
{
return Math.round(round*Math.pow(10, scale))/Math.pow(10, scale);
}
}
\ No newline at end of file
/*
* PURPOSE : Local interface for ReceiptAdv Post Save to lookup Localy
*/
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.sql.Connection;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Local
public interface ReceiptAdvPostSaveLocal extends ValidatorLocal
{
public String postSave( String domString, String editFlag, String xtraParams,
Connection conn ) throws RemoteException,ITMException;
}
\ No newline at end of file
/*
* PURPOSE : Remote interface for ReceiptAdv Post Save to lookup remotely
*/
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.sql.Connection;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface ReceiptAdvPostSaveRemote extends ValidatorRemote
{
public String postSave( String domString, String editFlag, String xtraParams,
Connection conn ) throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -19,10 +19,12 @@ import javax.ejb.Remote; // added for ejb3
public interface ReceiptAdvRemote extends ValidatorRemote {
public String wfValData(String xmlString, String xmlString1, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
......
......@@ -262,7 +262,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
int i = 0;
int cnt = 0 ;
int maxline = 0;
int cnt1 = 0 ;
int cnt1 = 0 , findIndex = -1;
Date tranDate = null;
HashMap RcpHdrMap = null;
......@@ -276,11 +276,14 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
ArrayList DetList = new ArrayList();
ArrayList ADetList = new ArrayList();
ArrayList miscRcpDetList = new ArrayList();
PreparedStatement pstmt = null;
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null;
ITMDBAccessEJB itmDBAccessEJB = null;
FinCommon finCommon = null;
DistCommon disCommon = null;
double amountMap = 0;
double detAmount = 0;
HashMap detMap = null;
try
{
finCommon = new FinCommon();
......@@ -290,20 +293,42 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
cctrFin = finCommon.getFinparams("999999", "ACCT_FINCHG", conn);
if(cctrFin != null && ! "NULLFOUND".equalsIgnoreCase(cctrFin))
{
acctFin = disCommon.getToken(cctrFin, ";");
}else
if (cctrFin.indexOf(";") > -1)
{
acctFin = cctrFin.substring(0, cctrFin.indexOf(";"));
cctrFin = cctrFin.substring(cctrFin.indexOf(";") +1);
}
else
{
acctFin = cctrFin;
cctrFin = " ";
}
}
else
{
errString = itmDBAccessEJB.getErrorString("","VTFINPARM ","","",conn);
return errString;
}
cctrFins = finCommon.getFinparams("999999", "ACCT_FINCHG_AR", conn);
if(cctrFins != null && ! "NULLFOUND".equalsIgnoreCase(cctrFins))
{
acctFins = disCommon.getToken(cctrFins, ";");
}else
if (cctrFins.indexOf(";") > -1)
{
acctFins = cctrFins.substring(0, cctrFins.indexOf(";"));
cctrFins = cctrFins.substring(cctrFins.indexOf(";") +1);
}
else
{
acctFins = cctrFins;
cctrFins = " ";
}
}
else
{
errString = itmDBAccessEJB.getErrorString("","VTFINPARM ","","",conn);
return errString;
}
......@@ -311,6 +336,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if( "NULLFOUND".equalsIgnoreCase(bdFluctuationCf))
{
errString = itmDBAccessEJB.getErrorString("","VTFINPARM ","","",conn);
return errString;
}
......@@ -318,6 +344,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if( "NULLFOUND".equalsIgnoreCase(rcpClubPost))
{
errString = itmDBAccessEJB.getErrorString("","VTFINPARM ","","",conn);
return errString;
}
......@@ -339,7 +366,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{
tranId = rs.getString("tran_id") == null ? " ":rs.getString("tran_id");
advAmt = rs.getDouble("adv_amt");
......@@ -366,7 +393,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{
RcpHdrMap = new HashMap();
RcpHdrMap.put("tran_date",rs.getDate("tran_date"));
......@@ -429,8 +456,6 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
if(ledgPostConf != null && "Y".equalsIgnoreCase(ledgPostConf))
{
if(((Date)RcpHdrMap.get("tran_date")).compareTo(today)!= 0){tranDate = today;}
......@@ -447,20 +472,21 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(((Date)RcpHdrMap.get("eff_date")).compareTo(today) > 0)
{
errString = itmDBAccessEJB.getErrorString("","VTRCPDT1","","",conn);
return errString;
}
// populate rcpacct
DetMap = new HashMap();
sql = "select sundry_type,sundry_code,acct_code,cctr_code,emp_code, anal_code,curr_code ,exch_rate,amount,party_doc_ref from rcpacct where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
while(rs.next())
{
DetMap = new HashMap();
DetMap.put("sundry_type", rs.getString("sundry_type"));
DetMap.put("sundry_code", rs.getString("sundry_code"));
DetMap.put("acct_code", rs.getString("acct_code"));
......@@ -525,7 +551,6 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
EpcAdjList.add(EpcAdjMap);
System.out.println(" Rcpepc Adj Map..........");
System.out.println(EpcAdjList.toString());
}
rs.close();
......@@ -534,7 +559,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = null;
//RcpDetMap = new HashMap();
sql = "select line_no__ref,ref_ser,ref_no,acct_code__ar,cctr_code__ar,exch_rate__rcv,rcp_amt,fin_chg,cust_code,bad_debt_amt,bill_disc_amt from rcpdet where tran_id = ?";
sql = "select line_no__ref,ref_ser,ref_no,acct_code__ar,cctr_code__ar,exch_rate__rcv,rcp_amt,fin_chg,cust_code,bad_debt_amt,bill_disc_amt,exch_rate from rcpdet where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
......@@ -547,6 +572,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
RcpDetMap.put("acct_code__ar", rs.getString("acct_code__ar"));
RcpDetMap.put("cctr_code__ar", rs.getString("cctr_code__ar")==null?"":rs.getString("cctr_code__ar"));
RcpDetMap.put("exch_rate__rcv", rs.getDouble("exch_rate__rcv"));
RcpDetMap.put("exch_rate", rs.getDouble("exch_rate"));
RcpDetMap.put("rcp_amt", rs.getDouble("rcp_amt"));
RcpDetMap.put("fin_chg", rs.getDouble("fin_chg"));
RcpDetMap.put("cust_code", rs.getString("cust_code"));
......@@ -566,29 +592,30 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
for(i=0 ; i<RcpDetList.size() ; i++)
{
RcpDetMap = new HashMap();
//RcpDetMap = new HashMap();
RcpDetMap = (HashMap) RcpDetList.get(i);
if(!((String)RcpDetMap.get("ref_ser")).equals("M-INV"))
{
total = total + (Double)RcpDetMap.get("rcp_amt");
// to convert in terms of header currency in case multiple currency
//total = total + (Double)RcpDetMap.get("rcp_amt");
total = total + ( (Double)RcpDetMap.get("rcp_amt") * (Double)RcpDetMap.get("exch_rate") / (Double)RcpHdrMap.get("exch_rate") );
finTotal = finTotal + (Double)RcpDetMap.get("fin_chg");
System.out.println("LINE NO 541"+total);
//System.out.println("LINE NO 541"+total);
if(rcpClubPost.equals("Y"))
{
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
/* sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,(String)RcpDetMap.get("acct_code__ar"));
pstmt.setString(2,(String)RcpDetMap.get("cctr_code__ar")==null?"":(String)RcpDetMap.get("cctr_code__ar"));
pstmt.setDouble(3,(Double)RcpDetMap.get("exch_rate__rcv"));
pstmt.setString(4,tranId);
rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{
cnt = rs.getInt(1);
}
......@@ -602,7 +629,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{
maxline = rs.getInt(1);
}
......@@ -611,9 +638,6 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
if(cnt == 0)
{
......@@ -636,7 +660,6 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
}
else
{
......@@ -649,25 +672,55 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
}
}*/
// 29/09/13 manoharan check whether exists in rcpacct map, if so, add the amount, else add new map to list
findIndex = findExistingIndex(DetList,(String) RcpDetMap.get("acct_code__ar"), (String) RcpDetMap.get("cctr_code__ar"), (Double)RcpDetMap.get("exch_rate__rcv"));
}
else
{
findIndex = -1;
}
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detAmount = (Double) RcpDetMap.get("rcp_amt");
detMap.put("amount", amountMap + detAmount );
DetList.set(findIndex, detMap);
}
else
{
detMap = new HashMap();
detMap.put("sundry_type", "C");
detMap.put("sundry_code", (String)RcpDetMap.get("cust_code"));
detMap.put("acct_code", (String)RcpDetMap.get("acct_code__ar"));
detMap.put("cctr_code", (String)RcpDetMap.get("cctr_code__ar"));
detMap.put("emp_code", null);
detMap.put("anal_code", null);
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", (Double)RcpDetMap.get("exch_rate__rcv"));
detMap.put("amount", (Double)RcpDetMap.get("rcp_amt"));
partyDocRef = finCommon.gfGetPartyDocRef((String)RcpDetMap.get("ref_ser"), (String)RcpDetMap.get("ref_no"),conn);
DetMap.put("party_doc_ref",partyDocRef);
detMap.put("party_doc_ref", partyDocRef);
DetList.add(detMap);
}
}
}
// populate bill if bill is discounted
// then credit the amount to the BD
for(i=0 ; i<RcpDetList.size() ; i++)
{
RcpDetMap = new HashMap();
//RcpDetMap = new HashMap();
RcpDetMap = (HashMap)RcpDetList.get(i);
refSer = (String)RcpDetMap.get( "ref_ser");
refNo = (String)RcpDetMap.get("ref_no");
hExchRate = (Double)RcpHdrMap.get("exch_rate");
hExchRate = (Double)RcpDetMap.get("exch_rate"); // 26/09/13 Manoharan take from detail instead of
lineNoRef = (String)RcpDetMap.get("line_no__ref");
......@@ -679,11 +732,10 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.setString(2,refNo);
pstmt.setString(3,lineNoRef);
rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{
billDisc = rs.getString(1)==null?"N":rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
......@@ -713,20 +765,52 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
rcpAmt = (Double)RcpDetMap.get( "bill_disc_amt"); //added by ritesh on 15/05/13 as per discussion with pravin
totbdDiff = totbdDiff + (rcpAmt * hExchRate ) - (rcpAmt * exch );
// rcpAmt = 0 - (Double)RcpDetMap.get( "rcp_amt");
rcpAmt = 0 - (Double)RcpDetMap.get( "bill_disc_amt"); // //added by ritesh on 15/05/13 as per discussion with pravin
finChg = 0 - (Double)RcpDetMap.get( "fin_chg");
rcpAmt = -1 * (Double)RcpDetMap.get( "bill_disc_amt"); // //added by ritesh on 15/05/13 as per discussion with pravin
finChg = -1 * (Double)RcpDetMap.get( "fin_chg");
total = total + rcpAmt;
System.out.println("total in 666"+total);
//System.out.println("total in 666"+total);
tFin = tFin + finChg;
if(rcpClubPost.equals("Y"))
if (rcpAmt != 0)
{
if(rcpClubPost.equals("Y"))
{
findIndex = findExistingIndex(DetList, acct, cctr, exch);
}
else
{
findIndex = -1;
}
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detMap.put("amount", amountMap + rcpAmt );
DetList.set(findIndex, detMap);
}
else
{
detMap = new HashMap();
detMap.put("sundry_type", stype);
detMap.put("sundry_code", scode);
detMap.put("acct_code", acct);
detMap.put("cctr_code", cctr);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", exch);
detMap.put("amount", rcpAmt);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
}
/* sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acct);
pstmt.setString(2,cctr==null?"":cctr);
......@@ -793,7 +877,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
}
}
}*/
}
}
......@@ -802,7 +887,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
for(i=0 ; i<ADetList.size() ; i++)
{
ADetMap = new HashMap();
//ADetMap = new HashMap();
ADetMap = (HashMap) ADetList.get(i);
......@@ -815,7 +900,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
System.out.println("LINE NO 743"+total);
if(rcpClubPost.equals("Y"))
{
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
findIndex = findExistingIndex(DetList, acct, cctr, exch);
/*sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acct);
pstmt.setString(2,cctr==null?"":cctr);
......@@ -830,9 +916,38 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
rs = null;
pstmt.close();
pstmt = null;
*/
}
else
{
findIndex = -1;
}
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detMap.put("amount", amountMap + amount );
DetList.set(findIndex, detMap);
}
else
{
detMap = new HashMap();
detMap.put("sundry_type", "C");
detMap.put("sundry_code", (String) RcpHdrMap.get("cust_code"));
detMap.put("acct_code", acct);
detMap.put("cctr_code", cctr);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", exch);
detMap.put("amount", amount);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
/*
sql = "select max(LINE_NO) from rcpacct where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
......@@ -881,13 +996,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
}
}*/
}
// insert data for finchg
//take but det and insert
......@@ -903,7 +1013,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
sql = "select max(LINE_NO) from rcpacct where tran_id = ?";
/*sql = "select max(LINE_NO) from rcpacct where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
rs = pstmt.executeQuery();
......@@ -935,8 +1045,21 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
*/
detMap = new HashMap();
detMap.put("sundry_type", "O");
detMap.put("sundry_code", "");
detMap.put("acct_code", acct);
detMap.put("cctr_code", cctr);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
detMap.put("exch_rate", exch);
detMap.put("amount", tFin);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY,SUNDRY_TYPE,SUNDRY_CODE) values (?,?,?,?,?,?,?,?,?,?,?)";
/*sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY,SUNDRY_TYPE,SUNDRY_CODE) values (?,?,?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
pstmt.setString(2,String.valueOf(maxline+1));//issue
......@@ -952,8 +1075,21 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
*/
detMap = new HashMap();
detMap.put("sundry_type", "C");
detMap.put("sundry_code", (String)RcpHdrMap.get("cust_code"));
detMap.put("acct_code", acctFins);
detMap.put("cctr_code", cctrFins);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
detMap.put("exch_rate", exch);
detMap.put("amount", tFin);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY,SUNDRY_TYPE,SUNDRY_CODE) values (?,?,?,?,?,?,?,?,?,?,?)";
/*sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY,SUNDRY_TYPE,SUNDRY_CODE) values (?,?,?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
pstmt.setString(2,String.valueOf(maxline+1));//issue
......@@ -969,6 +1105,19 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
*/
detMap = new HashMap();
detMap.put("sundry_type", "C");
detMap.put("sundry_code", (String)RcpHdrMap.get("cust_code"));
detMap.put("acct_code", acctFins);
detMap.put("cctr_code", cctrFins);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
detMap.put("exch_rate", exch);
detMap.put("amount", -1 * tFin);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
......@@ -986,8 +1135,38 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(rcpClubPost.equals("Y"))
{
findIndex = findExistingIndex(DetList, acct, cctr, exch);
}
else
{
findIndex = -1;
}
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detMap.put("amount", amountMap + advAmt );
DetList.set(findIndex, detMap);
}
else
{
detMap = new HashMap();
detMap.put("sundry_type", "C");
detMap.put("sundry_code", (String) RcpHdrMap.get("cust_code"));
detMap.put("acct_code", acct);
detMap.put("cctr_code", cctr);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", exch);
detMap.put("amount", advAmt);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
/*sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acct);
pstmt.setString(2,cctr==null?"":cctr);
......@@ -1048,8 +1227,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
int updateCoount = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
}
}*/
}
......@@ -1057,7 +1235,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
///// insert rows for epc adjustment
for(i=0 ; i<EpcAdjList.size() ; i++)
{
EpcAdjMap = new HashMap();
//EpcAdjMap = new HashMap();
EpcAdjMap = (HashMap) DetList.get(i);
currCode = (String)EpcAdjMap.get("curr_code");
......@@ -1084,8 +1262,37 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(rcpClubPost.equals("Y"))
{
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
findIndex = findExistingIndex(DetList, acctCode, cctrCode, exchRate);
}
else
{
findIndex = -1;
}
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detMap.put("amount", amountMap + amount );
DetList.set(findIndex, detMap);
}
else
{
detMap = new HashMap();
detMap.put("sundry_type", sundryType);
detMap.put("sundry_code", sundryCode);
detMap.put("acct_code", acctCode);
detMap.put("cctr_code", cctrCode);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", exchRate);
detMap.put("amount", amount);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
/*sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acctCode);
pstmt.setString(2,cctrCode==null?"":cctrCode);
......@@ -1148,7 +1355,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
}
}
//}*/
}
// insert rows for ADVANCE BOOKING adjustment
......@@ -1168,31 +1375,62 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = null;
/* sql = "SELECT diff_amt__exch FROM ADVBKING_ADJ where tran_id = ? " ;
acct = (String)RcpHdrMap.get("acct_code__ar");
cctr = (String)RcpHdrMap.get("cctr_code__ar");
stype = "C";
exchRate = 1;
amount = diffAmtExch;
sql = "SELECT diff_amt__exch FROM RCPADVBKING_ADJ where tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if(rs.next())
while(rs.next())
{
diffAmtExch = rs.getDouble("diff_amt__exch");
if(rcpClubPost.equals("Y"))
{
findIndex = findExistingIndex(DetList, acct, cctr, exchRate);
}
else
{
findIndex = -1;
}
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detMap.put("amount", amountMap + diffAmtExch );
DetList.set(findIndex, detMap);
}
else
{
detMap = new HashMap();
detMap.put("sundry_type", stype);
detMap.put("sundry_code", (String)RcpHdrMap.get("cust_code"));
detMap.put("acct_code", acct);
detMap.put("cctr_code", cctr);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", exchRate);
detMap.put("amount", diffAmtExch);
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;*/ //---OPEN
pstmt = null;
acct = (String)RcpHdrMap.get("acct_code__ar");
cctr = (String)RcpHdrMap.get("cctr_code__ar");
exch = (Double)RcpHdrMap.get("exch_rate");
stype = "C";
exchRate = 1;
amount = diffAmtExch;
if(rcpClubPost.equals("Y"))
/*if(rcpClubPost.equals("Y"))
{
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
......@@ -1212,7 +1450,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
/*if(cnt==0)
if(cnt==0)
{
......@@ -1244,9 +1482,9 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
int updateCoount = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}*/ //OPEN
}
/ //OPEN
}*/
double totBad = 0;
for(i=0 ; i<RcpDetList.size() ; i++)
{
RcpDetMap = new HashMap();
......@@ -1264,7 +1502,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.setString(2,refNo);
pstmt.setString(3,lineNoRef);
rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{
badDebtAmt = rs.getDouble(1);
exchRate = rs.getDouble("exch_rate");
......@@ -1277,7 +1515,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(badDebtAmt > 0)
{
sql = "select baddebt_amt,tran_id, acct_code__dr,cctr_code__dr, acct_code__cr, cctr_code__cr, amt_prov, case when amt_revrsed is null then 0 else amt_revrsed end from bad_debts_prov where tran_ser = ? and ref_no = ? and amt_prov <> 0 order by tran_date";
sql = "select tran_id, acct_code__dr,cctr_code__dr, acct_code__cr, cctr_code__cr, amt_prov, case when amt_revrsed is null then 0 else amt_revrsed end from bad_debts_prov where tran_ser = ? and ref_no = ? and amt_prov <> 0 order by tran_date";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refSer);
pstmt.setString(2,refNo);
......@@ -1285,7 +1523,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
rs = pstmt.executeQuery();
while(rs.next())
{
badDebtAmt = rs.getDouble("baddebt_amt");
//badDebtAmt = rs.getDouble("baddebt_amt");
tranId = rs.getString("tran_id");
acctCodeDr = rs.getString("acct_code__dr");
cctrCodeDr = rs.getString("cctr_code__dr")==null?"":rs.getString("cctr_code__dr");
......@@ -1293,76 +1531,47 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
cctrCodeCr = rs.getString("cctr_code__cr")==null?"":rs.getString("cctr_code__cr");
amtProv = rs.getDouble("amt_prov");
amtRevrsed = rs.getDouble("amt_revrsed");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
amtRev = Math.min(badDebtAmt,amtProv);
total = total + amtRev;
System.out.println("LINE NO 1164"+total);
amtRev = Math.min(badDebtAmt,amtProv);
totBad = totBad + amtRev;
System.out.println("LINE NO 1164"+total);
if(rcpClubPost.equals("Y"))
{
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acctCodeDr);
pstmt.setString(2,cctrCodeDr==null?"":cctrCodeDr);
pstmt.setDouble(3,exch);
pstmt.setString(4,tranId);//issue
rs = pstmt.executeQuery();
while(rs.next())
if(rcpClubPost.equals("Y"))
{
cnt = rs.getInt(1);
findIndex = findExistingIndex(DetList, acctCodeDr, cctrCodeDr, exchRate);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt==0)
else
{
sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY) values (?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
pstmt.setString(2,(String)RcpDetMap.get("line_no__ref"));////issue
pstmt.setString(3,acctCodeDr);
pstmt.setString(4,cctrCodeDr==null?"":cctrCodeDr);
pstmt.setDouble(5,exchRate);
pstmt.setDouble(6,amtRev);
pstmt.setString(7,"");
pstmt.setString(8,"");
pstmt.setString(9,"N");
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
findIndex = -1;
}
else
if (findIndex > -1)
{
sql = "update rcpacct set amount =? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, ((badDebtAmt*-1)+(Double)DetMap.get(amount)));
pstmt.setString(2, tranId);
int updateCoount = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detMap.put("amount", amountMap + (amtRev * -1) );
DetList.set(findIndex, detMap);
}
if(rcpClubPost.equals("Y"))
else
{
detMap = new HashMap();
detMap.put("sundry_type", "O");
detMap.put("sundry_code", "");
detMap.put("acct_code", acctCodeDr);
detMap.put("cctr_code", cctrCodeDr);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", exchRate);
detMap.put("amount", (amtRev * -1));
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
/* sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acctCodeCr);
pstmt.setString(2,cctrCodeCr==null?"":cctrCodeCr);
pstmt.setString(1,acctCodeDr);
pstmt.setString(2,cctrCodeDr==null?"":cctrCodeDr);
pstmt.setDouble(3,exch);
pstmt.setString(4,tranId);//issue
rs = pstmt.executeQuery();
......@@ -1370,112 +1579,205 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(cnt==0)
{
// for debit account
sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY) values (?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
pstmt.setString(2,(String)RcpDetMap.get("line_no__ref"));////issue
pstmt.setString(3,acctCodeCr);
pstmt.setString(4,cctrCodeCr==null?"":cctrCodeCr);
pstmt.setString(3,acctCodeDr);
pstmt.setString(4,cctrCodeDr==null?"":cctrCodeDr);
pstmt.setDouble(5,exchRate);
pstmt.setDouble(6,amtRev);
pstmt.setString(7,"");
pstmt.setString(8,"");
pstmt.setString(9,"N");
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
else
{
sql = "update rcpacct set amount =? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, ((badDebtAmt*-1)+(Double)DetMap.get(amount)));
pstmt.setString(2, tranId);
int updateCoount = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
*/
if(rcpClubPost.equals("Y"))
{
findIndex = findExistingIndex(DetList, acctCodeCr, cctrCodeCr, exchRate);
}
else
{
sql = "update rcpacct set amount =? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, (badDebtAmt+(Double)DetMap.get(amount)));
pstmt.setString(2, tranId);
int updateCoount = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
findIndex = -1;
}
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
amountMap = (Double) detMap.get("amount");
detMap.put("amount", amountMap + amtRev );
DetList.set(findIndex, detMap);
}
else
{
detMap = new HashMap();
detMap.put("sundry_type", "O");
detMap.put("sundry_code", "");
detMap.put("acct_code", acctCodeCr);
detMap.put("cctr_code", cctrCodeCr);
detMap.put("emp_code", "");
detMap.put("anal_code", "");
//detMap.put("curr_code", rs.getString("curr_code"));
detMap.put("exch_rate", exchRate);
detMap.put("amount", amtRev );
detMap.put("party_doc_ref", "");
DetList.add(detMap);
}
/*sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acctCodeCr);
pstmt.setString(2,cctrCodeCr==null?"":cctrCodeCr);
pstmt.setDouble(3,exch);
pstmt.setString(4,tranId);//issue
rs = pstmt.executeQuery();
while(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "update bad_debts_prov set amt_prov = ?, amt_revrsed = ? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,amtRev);
pstmt.setDouble(2,amtRevrsed);
pstmt.setString(3,tranId);
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
badAmt = badAmt - amtRev;
sql = " update receivables set bad_debt_amt = ? , ref_no = ? , tran_ser = ? and line_no__ref = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,badDebtAmt-total);
pstmt.setString(2,refNo);
pstmt.setString(3,refser);
pstmt.setString(4,lineNoRef);
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
if(cnt==0)
{
// for debit account
sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY) values (?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);//issue
pstmt.setString(2,(String)RcpDetMap.get("line_no__ref"));////issue
pstmt.setString(3,acctCodeCr);
pstmt.setString(4,cctrCodeCr==null?"":cctrCodeCr);
pstmt.setDouble(5,exchRate);
pstmt.setDouble(6,amtRev);
pstmt.setString(7,"");
pstmt.setString(8,"");
pstmt.setString(9,"N");
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
}
else
{
System.out.println("aaaaaaaaaaaa"+total);
sql = "update rcpacct set amount =? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, (badDebtAmt+(Double)DetMap.get(amount)));
pstmt.setString(2, tranId);
int updateCoount = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
*/
sql = "update bad_debts_prov set amt_prov = amt_prov - ?, amt_revrsed = amt_revrsed + ? where tran_id = ?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setDouble(1,amtRev);
pstmt1.setDouble(2,amtRev);
pstmt1.setString(3,tranId);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
badDebtAmt = badDebtAmt - amtRev;
if (badDebtAmt == 0)
{
break;
}
}
System.out.println("BBBBBBBBBBB"+total);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
System.out.println("CCCCCCCCCCCC"+total);
sql = " update receivables set bad_debt_amt = bad_debt_amt - ? where tran_ser = ? and ref_no = ? and line_no__ref = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, totBad);
pstmt.setString(2,refser);
pstmt.setString(3,refNo);
pstmt.setString(4,lineNoRef);
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
totBad = 0;
//System.out.println("aaaaaaaaaaaa"+total);
//System.out.println("BBBBBBBBBBB"+total);
//System.out.println("CCCCCCCCCCCC"+total);
}
System.out.println("DDDDDDDDDDDDDDDDDDd"+total);
exchRate = (Double)RcpHdrMap.get("exch_rate");
total = total + ( (Double)RcpHdrMap.get("tax_amt")); //change done by akhilesh on 05/sep/2013 for adjust tax amount
totBc = total * exchRate;
System.out.println("Final total ["+ total + "] totBc [" + totBc + "]");
//total = 0;
totBc = total * (Double)RcpHdrMap.get("exch_rate");
System.out.println("DDDDDDDDDDDDDDDDDDd"+total);
/// the upper block is transfer here.
total = total + (Double)RcpHdrMap.get("net_amt")+(Double)RcpHdrMap.get("tax_amt"); //change done by akhilesh on 05/sep/2013 for adjust tax amount
totBc = totBc + (Double)RcpHdrMap.get("net_amt__bc")+(Double)RcpHdrMap.get("tax_amt"); //change done by akhilesh on 05/sep/2013 for adjust tax amount
//totBc = totBc + (Double)RcpHdrMap.get("net_amt__bc")+(Double)RcpHdrMap.get("tax_amt"); //change done by akhilesh on 05/sep/2013 for adjust tax amount
System.out.println("net_amt AND net_amt__bc 1"+total+""+totBc);
//System.out.println("net_amt AND net_amt__bc 1"+total+""+totBc);
System.out.println("DDDDDDDDDDDDDDDDDDd"+total);
if(bdFluctuationCf.equalsIgnoreCase("N"))
{
totBc = totBc +totbdDiff;
System.out.println("DDDDDDDDDDDDDDDDDDd"+total);
totBc = totBc + totbdDiff;
System.out.println("bdFluctuationCf [" + bdFluctuationCf + "] totBc ["+totBc + "]");
}
// if EPC is adjusted in diff currency then update the net amount bc.
if(isEpcCurrSame == true)
{
System.out.println("total totEpc totEpcBc"+total+""+totEpc+""+totEpcBc);
System.out.println("total ["+total+"] totEpc ["+totEpc+"] totEpcBc ["+totEpcBc + "]");
total = total + totEpc;
totBc = totBc +totEpcBc;
}
else
{
totBc = total + totEpcBc;
totBc = totBc + totEpcBc;
}
/*
//if EPC can be adjusted in base currency if it is so then check in base currency
sql = "SELECT count(*) FROM rcpepc_adj WHERE rcpepc_adj.tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
while(rs.next())
if(rs.next())
{
rcpepcAdj = rs.getString(1);
}
......@@ -1484,20 +1786,21 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
rs = null;
pstmt.close();
pstmt = null;
chq = (Double)RcpHdrMap.get("chq_amt")- (Double)RcpHdrMap.get("bill_disc_amt")+(Double)RcpHdrMap.get("oth_amt");
*/
chq = ((Double)RcpHdrMap.get("chq_amt") ) - ((Double) RcpHdrMap.get("bill_disc_amt")) + ((Double)RcpHdrMap.get("oth_amt") );
// if EPC adjusted in same currency then
if(isEpcCurrSame == true)
{
chq = chq + (Double)RcpHdrMap.get("efundadj_amt");
chq = chq + ((Double)RcpHdrMap.get("efundadj_amt")) ;
}
System.out.println("chq and total "+chq+""+total);
if(chq != (total))
System.out.println("chq and ["+chq+"] total ["+total + "] diff [" + Math.abs(chq - total) +"]");
if(Math.abs(chq - total) > 1)
{
errString = itmDBAccessEJB.getErrorString("","VTRCPT8","","",conn);
conn.rollback();
......@@ -1506,7 +1809,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
RcpHdrMap.put("net_amt", total);
RcpHdrMap.put("net_amt__bc", totBc);
System.out.println("net_amt AND net_amt__bc 1"+total+""+totBc);
System.out.println("net_amt ["+total+"] net_amt__bc ["+totBc + "]");
if(errString == null || errString.trim().length() == 0)
{
......@@ -1543,7 +1846,38 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
return errString;
}
// 26/09/13 manoharan to find existing detail
private int findExistingIndex(ArrayList detList, String acctCode, String cctrCode, double exchRate)throws RemoteException,ITMException
{
int findIndex = -1;
HashMap detMap = null;
String acctCodeMap = null, cctrCodeMap = null;
double exchRateMap = 0;
try
{
for(int ctr=0 ; ctr < detList.size() ; ctr++)
{
detMap = (HashMap) detList.get(ctr);
acctCodeMap = (String) detMap.get("acct_code");
cctrCodeMap = (String) detMap.get("cctr_code");
exchRateMap = (Double) detMap.get("exch_rate");
if (acctCodeMap.trim().equalsIgnoreCase(acctCode.trim()) && cctrCodeMap.trim().equalsIgnoreCase(cctrCode.trim()) && exchRateMap == exchRate)
{
findIndex = ctr;
break;
}
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
System.out.println("Exception : "+e);
e.printStackTrace();
throw new ITMException(e);
}
return findIndex;
}
private String gbfPostReceipt(String tranId,String xtraParams,HashMap RcpHdrMap,ArrayList DDetList, ArrayList RcpDetList,ArrayList ADetList,ArrayList EpcAdjList, Connection conn)throws RemoteException,ITMException
......@@ -1576,7 +1910,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
// populate rcpacct
//DetMap = new HashMap();
sql = "select sundry_type,sundry_code,acct_code,cctr_code,emp_code, anal_code,curr_code ,exch_rate,amount,party_doc_ref from rcpacct where tran_id = ?";
/*sql = "select sundry_type,sundry_code,acct_code,cctr_code,emp_code, anal_code,curr_code ,exch_rate,amount,party_doc_ref from rcpacct where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
......@@ -1605,10 +1939,10 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
rs = null;
pstmt.close();
pstmt = null;
*/
// header posting
errString = gbfPostRcphdr(tranId, xtraParams,RcpHdrMap, DetList,conn);
errString = gbfPostRcphdr(tranId, xtraParams,RcpHdrMap, DDetList,conn);
System.out.println("ERROR......................"+errString);
if(errString != null && errString.trim().length() > 0)
{
......@@ -1616,7 +1950,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
else
{
gbfPostRcpdet(tranId,xtraParams,RcpHdrMap,DetList,RcpDetList,ADetList,EpcAdjList,conn);
gbfPostRcpdet(tranId,xtraParams,RcpHdrMap,DDetList,RcpDetList,ADetList,EpcAdjList,conn);
}
if(errString != null && errString.trim().length() > 0)
{
......@@ -1658,7 +1992,10 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
{
refNo = rs.getString(1);
amount = rs.getDouble(2);
if(amount < 0 ){amount = -amount;}
if(amount < 0 )
{
amount = -amount;
}
if(amount > 0)
{
sql = "update advbking set bal_amt = bal_amt - ? where tran_id = ?";
......
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