Commit 707e83be authored by ngadkari's avatar ngadkari

Provision needed to transfer positive payable to negative receivables and...

Provision needed to transfer positive payable to negative receivables and similarly provision needed to transfer positive receivables to negative paya 

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183982 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b5226d56
package ibase.webitm.ejb.fin;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import ibase.utility.E12GenericUtility;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* Session Bean implementation class PayRecXfrIC
*/
@Stateless
public class PayRecXfrIC extends ValidatorEJB implements PayRecXfrICRemote, PayRecXfrICLocal {
/**
* Default constructor.
*/
public PayRecXfrIC() {
}
E12GenericUtility genericUtility = new E12GenericUtility();
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String retString = "";
E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("----------------Inside RecPayXfrIC itemChanged-------------------");
try {
System.out.println("xmlString::["+xmlString+"]\nxmlString1::["+xmlString1+"]\nxmlString2::["+xmlString2+"]");
if (xmlString != null && xmlString.trim().length() > 0) {
dom = genericUtility.parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length() > 0) {
dom1 = genericUtility.parseString(xmlString1);
}
if (xmlString2 != null && xmlString2.trim().length() > 0) {
dom2 = genericUtility.parseString(xmlString2);
}
retString = itemChanged(dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams);
} catch (Exception e) {
System.out.println("Exception: RecPayXfrIC: itemChanged:" + this.getClass().getSimpleName() + "::" + e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
return retString;
}
public String itemChanged(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
String loginSite="";
String dateNow="";
StringBuffer valueXmlString = new StringBuffer();
int currentFormNo = 0, ctr = 0;
Timestamp currentDate= null;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
try {
System.out.println("******************* NANDKUMAR GADKARI *******************");
System.out.println("----------------Inside itemChanged-------------------");
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
currentDate = new Timestamp(System.currentTimeMillis());
dateNow = (sdf.format(currentDate).toString()).trim();
if(objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo)
{
case 1 : parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
ctr = 0;
int childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equals(currentColumn))
{
if(childNode.getFirstChild() != null)
{
}
}
ctr ++;
}while(ctr < childNodeListLength && ! childNodeName.equals(currentColumn));
if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{
loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.println("loginSite::["+loginSite+"]");
System.out.println("----------- inside itm_default ---------------");
valueXmlString.append("<site_code>").append("<![CDATA[" + loginSite + "]]>").append("</site_code>");
valueXmlString.append("<tran_date>").append("<![CDATA[" + dateNow + "]]>").append("</tran_date>");
}
valueXmlString.append("</Detail1>");
break;
}//switch
valueXmlString.append("</Root>");
System.out.println("------ItemChanged::valueXmlString["+valueXmlString+"]");
}catch(Exception e)
{
System.out.println("Exception: RecPayXfrIC: itemChanged:" + this.getClass().getSimpleName() + "::" + e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
return valueXmlString.toString();
}
private String errorType(Connection conn, String errorCode) throws ITMException {
String msgType = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
String sql = "SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
if (rs.next()) {
msgType = rs.getString("MSG_TYPE");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} catch (Exception ex) {
ex.printStackTrace();
throw new ITMException(ex);
} finally {
try {
if (rs != null) {
rs.close();
rs = null;
}
if (pstmt != null) {
pstmt.close();
pstmt = null;
}
} catch (Exception e) {
e.printStackTrace();
throw new ITMException(e);
}
}
return msgType;
}
private String checkNull(String str) {
if (str == null) {
return "";
} else {
return str;
}
}
private String checkNullAndTrim(String inputVal)
{
if ( inputVal == null )
{
inputVal = "";
}
else
{
inputVal = inputVal.trim();
}
return inputVal;
}
}
package ibase.webitm.ejb.fin;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.w3c.dom.Document;
@Local
public interface PayRecXfrICLocal extends ValidatorLocal {
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(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
@Remote
public interface PayRecXfrICRemote extends ValidatorRemote {
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(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
This diff is collapsed.
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import javax.ejb.Local;
import org.w3c.dom.Document;
import ibase.webitm.utility.ITMException;
@Local
public interface PayRecXfrPrcLocal extends ibase.webitm.ejb.ProcessLocal{
public String process() throws RemoteException,ITMException;
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) throws RemoteException,ITMException;
}
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
import ibase.webitm.utility.ITMException;
@Remote
public interface PayRecXfrPrcRemote extends ibase.webitm.ejb.ProcessRemote{
public String process() throws RemoteException,ITMException;
public String process(Document dom, Document dom2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document dom, Document dom2, String windowNamem, String xtraParams) throws RemoteException,ITMException;
}
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