Commit a21af837 authored by vdhoble's avatar vdhoble

Domestic Receipt Changes -F14ISUN011


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99474 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b2ab2646
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.util.*;
import java.util.Date;
import java.text.DateFormat;
import java.sql.*;
import javax.ejb.*;
import javax.naming.InitialContext;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.text.SimpleDateFormat;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.GenericUtility;
import ibase.utility.CommonConstants;
@javax.ejb.Stateless
public class GenRcpPreSave extends ValidatorEJB implements GenRcpPreSaveLocal, GenRcpPreSaveRemote
{
public String preSave()throws RemoteException,ITMException
{
return "";
}
public String preSave( String domString, String editFlag, String xtraParams, Connection conn ) throws RemoteException,ITMException
{
String retString = "";
String objName = "";
String eventDate = "";
String sprsCode = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
Document preSaveXmlDom = null;
boolean isError = false;
boolean isLocalConn = false;
try
{
System.out.println("domString ReceiptGenWizPreSaveEJB ["+domString+"]");
retString = callWfValData( domString, xtraParams);//Call the validate component to validate the offline DCR
}
catch(Exception e)
{
System.out.println("Exception :WsfaDSRWizPreSaveEJB : :==>\n"+e.getMessage());
throw new ITMException(e);
}
finally
{
try
{
if (rs!= null)
{
rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
System.out.println("Exception :WsfaDSRWizPreSaveEJB : :==>\n"+e.getMessage());
throw new ITMException(e);
}
}
System.out.println("Return string :"+retString);
return retString;
}
public String checkNull(String input)
{
if (input == null || "null".equalsIgnoreCase(input))
{
input= "";
}
return input.trim();
}
private String callWfValData( String domString, String xtraParams) throws ITMException
{
String retString = "";
String errString = "";
//String presavexmlString = "";
PreparedStatement pStmt = null;
int updateCnt = 0;
try
{
System.out.println("Calling wfValData method for validations.............");
GenericUtility genericUtility = GenericUtility.getInstance();
AppConnectParm appConnect = new AppConnectParm();
Properties p = appConnect.getProperty();
InitialContext ctx = new InitialContext(p);
GenReceiptICLocal genRcp = (GenReceiptICLocal)ctx.lookup("ibase/GenReceiptIC/local");
// domString = "<>" + domString + "</>";
//StringBuffer errStringXml = new StringBuffer("<DocumentRoot>\r\n<description>Datawindow Root</description>\r\n<group0>\r\n<description>Group0 description</description>\r\n<Header0>\r\n<description>Header0 members</description>\r\n");
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
String dom1 = domString.substring(0, domString.indexOf("<Detail")) + "<Root>";
String dom2 = domString.substring(domString.indexOf("<Detail"), domString.indexOf("</Header0>")) + "</Root>";
String dom3 = domString.substring(domString.indexOf("</Header0>")) ;
domString = dom1 + dom2 + dom3;
System.out.println( "domString ::::: "+ domString);
Document preSaveXmlDom = genericUtility.parseString(domString);
Node parentNode = preSaveXmlDom.getElementsByTagName("Root").item(0);
//Node parentNode = preSaveXmlDom.getElementsByTagName("DocumentRoot").item(0);
NodeList detailNodeList = parentNode.getChildNodes();
int noOfDetails = detailNodeList.getLength();
System.out.println("noOfDetails =["+noOfDetails+"]");
for(int i = 0; i < noOfDetails; i++)
{
Node detailNode = detailNodeList.item(i);
if( detailNode.getNodeType() != Node.ELEMENT_NODE )
{
continue;
}
String nodeName = detailNode.getNodeName();
System.out.println("nodeName =["+nodeName+"]");
if(nodeName.startsWith("Detail") )
{
String currObjContext = nodeName.substring("Detail".length());
System.out.println("currObjContext =["+currObjContext+"]");
if(currObjContext != null && currObjContext.trim().length() > 0)
{
retString = genRcp.wfValDataPreSave(preSaveXmlDom, preSaveXmlDom, preSaveXmlDom, currObjContext, "", xtraParams);
System.out.println("retString =["+retString+"]");
//Changed by Gaurav Singh 28-May-2015
if( retString != null && retString.indexOf("<Errors>") != -1 )
{
//return retString;
String bufurErrString = retString.substring( retString.indexOf("<Errors>") + 8,retString.indexOf("</Errors>"));
errStringXml.append(bufurErrString);
System.out.println("errStringXml .........."+errStringXml);
}
/*else
{
//retString = "";
errStringXml = new StringBuffer( "" );
}*/
}
}
}//End of for loop
errStringXml.append("</Errors></Root>\r\n");
errString = errStringXml.toString();
System.out.println("errString ::::::::::"+errString);
if(errString.indexOf("<error") == -1)
{
errString = "";
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
}
catch(Exception e1)
{
}
}
//return retString;
return errString;
}
}
package ibase.webitm.ejb.fin;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
import java.util.ArrayList;
import java.sql.Connection;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Local
public interface GenRcpPreSaveLocal extends ValidatorLocal//, EJBObject
{
public String preSave()throws RemoteException,ITMException;
public String preSave( String domString, String editFlag, String xtraParams, Connection conn ) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
import java.util.ArrayList;
import java.sql.Connection;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface GenRcpPreSaveRemote extends ValidatorLocal//, EJBObject
{
public String preSave()throws RemoteException,ITMException;
public String preSave( String domString, String editFlag, String xtraParams, Connection conn ) throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -23,7 +23,6 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
......@@ -119,8 +118,8 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
String prdCode = "",refNo="",refSer="",lineNo="",refDate="";
java.util.Date tranDate = null;
int ctr = 0;
int currentFormNo = 0;
int cnt = 0;
int currentFormNo = 0,usrLevel=0;
int cnt = 0,cnt1 = 0;
ArrayList errList = new ArrayList();
ArrayList errFields = new ArrayList();
SimpleDateFormat dateFormat2 = null; //new SimpleDateFormat(genericUtility.getApplDateFormat());
......@@ -135,8 +134,10 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
int countCustRef=0,refSerCnt=0;
int childNodeListLength=0;
double rcpAmt=0.0,chqAmt=0.0,rcpAmtVal=0.0;
String logCode = "";
boolean isValidcustRef=false,dateFlag=false;
ArrayList<String> refNoList = new ArrayList<String>();
ArrayList<String> siteList = new ArrayList<String>();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String tranDateStr = "",statFin = "";Timestamp tranDateTs = null;
try
......@@ -189,6 +190,93 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
pstmt.close();
pstmt = null;
/*********************/
logCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
System.out.println("LOG CODE FOR THE SITE"+logCode);
sql="SELECT usr_lev from users where code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,logCode);
rs = pstmt.executeQuery();
if(rs.next())
{
usrLevel=rs.getInt("usr_lev");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(usrLevel==1)
{
System.out.println("User level is 1");
/**
* Some site code are allow
* from user_site
* */
// sql = "select site_code from site where site_code in (select site_code from user_site where user_id = ? )";
sql = "select count(*) as cnt from dual where ? in " +
"(select site_code from user_site where user_id = ? )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
pstmt.setString(2,logCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt=rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("User site count :- ["+cnt+"]");
if(cnt==0)
{
/**
* User level 1
* site not valid error
* */
System.out.println("Error ===Should not contain");
errCode = "VMINVSIT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
// sql = "select site_code from site where site_code in (select site_code from user_site where user_id = ? )";
// pstmt = conn.prepareStatement(sql);
// pstmt.setString(1,logCode);
// rs = pstmt.executeQuery();
// while(rs.next())
// {
// //cnt = rs.getInt(1);
// siteList.add(rs.getString("site_code"));
// for (String value : siteList) {
// System.out.println("Value of sites = " + value);
// }
// }
// if (!siteList.contains(siteCode))
// {
// System.out.println("Error ===Should not contain");
// errCode = "VMINVSIT";
// errList.add(errCode);
// errFields.add(childNodeName.toLowerCase());
// }
// rs.close();
// rs = null;
// pstmt.close();
// pstmt = null;
if(genericUtility.getColumnValue("eff_date", dom) == null)
{
tranDate = null;
......@@ -239,6 +327,10 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
errFields.add(childNodeName.toLowerCase());
}
}
}
else
......@@ -358,6 +450,31 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
rs = null;
pstmt.close();
pstmt = null;
siteCode = this.genericUtility.getColumnValue("site_code", dom);
System.out.println("siteCode for customer checking..");
sql = "select COUNT(*) AS COUNT from site_customer where cust_code=? and site_code=? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode);
pstmt.setString(2,siteCode);
rs = pstmt.executeQuery();
if( rs.next())
{
cnt = rs.getInt("COUNT");
System.out.println("COUNT@@@@");
}
if( cnt == 0 )
{
errCode = "VTCUSTCD2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else
......@@ -451,8 +568,32 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
pstmt.close();
pstmt = null;
siteCode = this.genericUtility.getColumnValue("site_code", dom);
System.out.println("Site code for bank==="+siteCode);
sql = "select count(*) from bank where site_code = ? and bank_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
pstmt.setString(2,bankCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt1 = rs.getInt(1);
}
if (cnt1 == 0)
{
errCode = "VMBANKMIS1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// added by akhilesh on 01/aug/13 as discuss with manoj sharma
siteSpecificBank = finCommon.getFinparams("999999", "SITE_SPECIFIC_BANK", conn);
/* siteSpecificBank = finCommon.getFinparams("999999", "SITE_SPECIFIC_BANK", conn);
if(siteSpecificBank != null && "Y".equalsIgnoreCase(siteSpecificBank))
{
......@@ -472,6 +613,8 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
errCode = "VMBCNCD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
}
}
......@@ -553,6 +696,23 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}
}
else if (childNodeName.equalsIgnoreCase("ref_no"))
{
String rcpMode = "",refNum = "";
rcpMode = this.genericUtility.getColumnValue("rcp_mode", dom);
refNum = this.genericUtility.getColumnValue("ref_no", dom);
System.out.println("Values of rcpmode :::"+rcpMode+"***** refNum:::::::"+refNum);
if("Q".equals(rcpMode) && refNum == null )
{
errCode = "VMINVREF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
//valueXmlString.append("</Detail1>");
......@@ -700,7 +860,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}
else if(childNodeName.equalsIgnoreCase("rcp_amt"))
/*else if(childNodeName.equalsIgnoreCase("rcp_amt"))
{
refNo=this.genericUtility.getColumnValue("ref_no", domAll);
refSer=this.genericUtility.getColumnValue("ref_ser", domAll);
......@@ -710,23 +870,25 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
System.out.println("rcp_amt!! "+this.genericUtility.getColumnValue("rcp_amt", domAll));
if(!(isNumeric(this.genericUtility.getColumnValue("rcp_amt", domAll))))
{
System.out.println("Receipt amount not valid"+isNumeric(this.genericUtility.getColumnValue("rcp_amt", domAll)));
errCode = "VTRCPATVLD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
System.out.println("Receipt amount not valid");
}
else
{
System.out.println();
rcpAmt=doublevalue(this.genericUtility.getColumnValue("rcp_amt", domAll));
}
System.out.println("rcpAmt---"+rcpAmt);
/*if(rcpAmt == 0)
System.out.println("rcpAmt:::::: "+rcpAmt);
if(rcpAmt == 0)
{
errCode = "VRCPAMTEMP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
}
if(rcpAmt == 0)
{
if(refNo != null || refSer != null)
......@@ -744,6 +906,36 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}
System.out.println("ref_ser :"+genericUtility.getColumnValue("ref_ser",domAll));
System.out.println("ref_no :"+genericUtility.getColumnValue("ref_no",domAll));
System.out.println("custCode :"+genericUtility.getColumnValue("cust_code", dom1));
System.out.println("site_code :"+genericUtility.getColumnValue("site_code", dom1));
sql = "SELECT (TOT_AMT - ADJ_AMT) AS AMT FROM RECEIVABLES WHERE TRAN_SER = ? AND REF_NO = ? AND cust_code = ? and site_code=? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(genericUtility.getColumnValue("ref_ser",domAll)));
pstmt.setString(2,checkNull(genericUtility.getColumnValue("ref_no",domAll)));
pstmt.setString(3,checkNull(genericUtility.getColumnValue("cust_code",dom1)));
pstmt.setString(4,checkNull(genericUtility.getColumnValue("site_code",dom1)));
rs = pstmt.executeQuery();
if( rs.next())
{
rcpAmtVal=rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("rcpAmtVal>>>["+rcpAmtVal+"]rcpAmt["+rcpAmt+"]");
if(rcpAmtVal < rcpAmt)
{
errCode = "VTINVTLAMT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
//added checkAmtvalidation by mahendra on dated 03-09-2015
if(checkAmtvalidation(dom2))
{
......@@ -753,6 +945,204 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}
}*/
}
break;
}
int errListSize = errList.size();
cnt = 0;
String errFldName = null;
if ((errList != null) && (errListSize > 0))
{
for (cnt = 0; cnt < errListSize; cnt++)
{
errCode = (String)errList.get(cnt);
errFldName = (String)errFields.get(cnt);
errString = getErrorString(errFldName, errCode, userId);
errorType = errorType(conn, errCode);
if (errString.length() > 0)
{
String bifurErrString = errString.substring(errString.indexOf("<Errors>") +
8, errString.indexOf("<trace>"));
bifurErrString = bifurErrString +
errString.substring(errString.indexOf("</trace>") +
8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
errString = "";
}
if (errorType.equalsIgnoreCase("E"))
{
break;
}
}
errStringXml.append("</Errors> </Root> \r\n");
}
else
{
errStringXml = new StringBuffer("");
}
}
catch (Exception e)
{
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
try
{
if (conn != null)
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
}
conn = null;
}
catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
errString = errStringXml.toString();
return errString;
}
public String wfValDataPreSave(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException {
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
StringBuffer valueXmlString = new StringBuffer();
String siteCode = "";
String custCode = "";
String userId = "";
String sql = "";
String errCode = "";
String errorType = "";
String errString = "";
String bankCode = "";
String siteCodeQuery = "";
String siteSpecificBank = "";
String currCode = "";
String prdCode = "",refNo="",refSer="",lineNo="",refDate="";
java.util.Date tranDate = null;
int ctr = 0;
int currentFormNo = 0,usrLevel=0;
int cnt = 0,cnt1 = 0;
ArrayList errList = new ArrayList();
ArrayList errFields = new ArrayList();
SimpleDateFormat dateFormat2 = null; //new SimpleDateFormat(genericUtility.getApplDateFormat());
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
PreparedStatement pstmt1 = null;
ResultSet rs1 = null;
Document domAll = dom2;
ConnDriver connDriver = new ConnDriver();
//String custrefNo="";
int countCustRef=0,refSerCnt=0;
int childNodeListLength=0;
double rcpAmt=0.0,chqAmt=0.0,rcpAmtVal=0.0;
String logCode = "";
boolean isValidcustRef=false,dateFlag=false;
ArrayList<String> refNoList = new ArrayList<String>();
ArrayList<String> siteList = new ArrayList<String>();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String tranDateStr = "",statFin = "";Timestamp tranDateTs = null;
try
{
System.out.println("validation called!!!!wfValDataPreSave");
dateFormat2 = new SimpleDateFormat(genericUtility.getApplDateFormat());
conn = connDriver.getConnectDB("DriverITM");
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
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 2:
parentNodeList = domAll.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
//valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength :"+childNodeListLength);
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("rcp_amt"))
{
refNo=this.genericUtility.getColumnValue("ref_no", domAll);
refSer=this.genericUtility.getColumnValue("ref_ser", domAll);
System.out.println("refNo>>>>> :"+refNo);
System.out.println("refSer>>>>> :"+refSer);
System.out.println("rcp_amt!! "+this.genericUtility.getColumnValue("rcp_amt", domAll));
if(!(isNumeric(this.genericUtility.getColumnValue("rcp_amt", domAll))))
{
System.out.println("Receipt amount not valid"+isNumeric(this.genericUtility.getColumnValue("rcp_amt", domAll)));
errCode = "VTRCPATVLD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
System.out.println();
rcpAmt=doublevalue(this.genericUtility.getColumnValue("rcp_amt", domAll));
}
System.out.println("rcpAmt:::::: "+rcpAmt);
/*if(rcpAmt == 0)
{
errCode = "VRCPAMTEMP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
if(rcpAmt == 0)
{
if(refNo != null || refSer != null)
{
errCode = "VRCPAMTEMP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
/* if(rcpAmt < 0)
{
errCode = "VTRCPATVLD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
System.out.println("ref_ser :"+genericUtility.getColumnValue("ref_ser",domAll));
System.out.println("ref_no :"+genericUtility.getColumnValue("ref_no",domAll));
......@@ -782,6 +1172,14 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
errFields.add(childNodeName.toLowerCase());
}
//added checkAmtvalidation by mahendra on dated 03-09-2015
if(checkAmtvalidation(dom2))
{
errCode = "VTCHQATINV";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
......@@ -971,9 +1369,12 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
String balAmtReqd="";
String logCode = "";
int parentNodeListLength=0;
/**added by vishakha*/
int userLevel = 0;
double cummBal = 0.0;
int detLines = 0;String tranId = "";
String detChar = "Contains";
try
{
dateFormat2=new SimpleDateFormat(genericUtility.getApplDateFormat());
......@@ -1043,7 +1444,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
if(userLevel == 1 || userLevel == 0 )//for user level 1 and 0 pophelp available
{
System.out.println("If User level is one****");
System.out.println("If User level is one****"+logCode);
valueXmlString.append("<user_level>").append( userLevel ).append("</user_level>\r\n");
valueXmlString.append("<user_id>").append( logCode ).append("</user_id>\r\n");
//valueXmlString.append( userLevel ).append( "</editFlag>\r\n</Header>\r\n" );
......@@ -1115,7 +1516,8 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
else if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{
tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp",currDom));
System.err.println("tranIdRcp value in edit "+tranIdRcp);
System.err.println("tranId value in edit** "+tranId);
if(tranIdRcp != null && tranIdRcp.trim().length() > 0)
{
bankNameValue = checkNull(genericUtility.getColumnValue("bank_code",currDom));
......@@ -1144,7 +1546,36 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
valueXmlString.append("<tran_id__rcp protect = \"1\">").append("<![CDATA["+tranIdRcp+"]]>").append("</tran_id__rcp>");
valueXmlString.append("<tran_id__adj protect = \"1\">").append("<![CDATA["+tranIdAdj+"]]>").append("</tran_id__adj>");
valueXmlString.append("<guid protect = \"1\">").append("<![CDATA["+guid+"]]>").append("</guid>");
}
/********************************************/
tranId = checkNull(genericUtility.getColumnValue("tran_id",allDom));
System.out.println("Checking for edit mode ::for tran_id :: "+tranId);
sql = "select count(*) as detline from rcpdet_form where tran_id = ? and ref_no is not null";
pstmt = connObject.prepareStatement(sql);
pstmt.setString(1, tranId);
rSet = pstmt.executeQuery();
if( rSet.next() )
{
detLines = rSet.getInt( "detline" );
}
rSet.close(); // added By vishakha on 18/12/13 to close the statement
rSet = null;
pstmt.close();
pstmt = null;
if(detLines > 0 )
{
System.out.println("No of lines in detail..."+detLines);
valueXmlString.append("<det_line>").append( detChar ).append("</det_line>\r\n");
//valueXmlString.append("< protect = \"1\">").append("<![CDATA["+custCodeValue+"]]>").append("</tran_id__rcp>");
}
}
else if( currentColumn.trim().equalsIgnoreCase( "bank_code" ) )
......@@ -2312,14 +2743,16 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
public static boolean isNumeric(String str)
{
System.out.println("Value of String ::: "+str);
try
{
if(str == null || str.trim().length()== 0)
{
str="0";
}
System.out.println("Value of String ::: "+str);
double d = Double.parseDouble(str);
System.out.println("Value of String in double ::: "+d);
}
catch(NumberFormatException nfe)
......
......@@ -7,6 +7,7 @@ package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
......@@ -19,6 +20,8 @@ public interface GenReceiptICLocal extends ValidatorLocal
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValDataPreSave(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
......
......@@ -18,6 +18,8 @@ public interface GenReceiptICRemote extends ValidatorRemote
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValDataPreSave(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, 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