Commit 9d42004a authored by mjadhav's avatar mjadhav

changes done in implement interface


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97565 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 35d909e7
......@@ -22,7 +22,7 @@ import java.util.HashSet;
import org.w3c.dom.*;
@javax.ejb.Stateless
public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CRemittanceTrRemote//implements SessionBean
public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, GenReceiptICRemote//implements SessionBean
{
/**
* The public method is used for validation of required fields which inturn called overloded method
......@@ -57,18 +57,18 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
allXmlDataStr1=allXmlDataStr;
if(currXmlDataStr != null && currXmlDataStr.trim().length()!= 0)
{
System.out.println ( "currXmlDataStr: " + currXmlDataStr);
//System.out.println ( "currXmlDataStr: " + currXmlDataStr);
currDom = genericUtility.parseString(currXmlDataStr);
}
if(hdrXmlDataStr != null && hdrXmlDataStr.trim().length()!= 0)
{
hdrDom = genericUtility.parseString(hdrXmlDataStr);
System.out.println("hdrXmlDataStr:"+hdrXmlDataStr);
//System.out.println("hdrXmlDataStr:"+hdrXmlDataStr);
}
if(allXmlDataStr != null && allXmlDataStr.trim().length()!= 0)
{
allDom = genericUtility.parseString(allXmlDataStr);
System.out.println("allXmlDataStr:"+allXmlDataStr);
//System.out.println("allXmlDataStr:"+allXmlDataStr);
}
errString = wfValData( currDom, hdrDom,allDom,objContext, editFlag, xtraParams );
System.out.println ( "ErrString: " + errString);
......@@ -117,7 +117,7 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
Document domAll = null;
ConnDriver connDriver = new ConnDriver();
//String custrefNo="";
int countCustRef=0;
int countCustRef=0,refSerCnt=0;
int childNodeListLength=0;
double rcpAmt=0.0,chqAmt=0.0;
boolean isValidcustRef=false;
......@@ -295,7 +295,18 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
}
else if (childNodeName.equalsIgnoreCase("chq_amt"))
{
chqAmt=doublevalue(this.genericUtility.getColumnValue("chq_amt", dom));
if(!(isNumeric(this.genericUtility.getColumnValue("chq_amt", dom))))
{
errCode = "VTCHQATEMP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
System.out.println("cheque amount not valid");
}
else
{
chqAmt=doublevalue(this.genericUtility.getColumnValue("chq_amt", dom));
}
System.out.println("chqAmt---"+chqAmt);
if(chqAmt < 0)
{
......@@ -303,6 +314,8 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
System.out.println("!!"+this.genericUtility.getColumnValue("chq_amt", dom));
}
......@@ -336,6 +349,31 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
refSer=refSer.trim();
sql="select count(*) from receivables where tran_ser=?";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,refSer);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
refSerCnt = rs1.getInt(1);
}
rs1.close(); // added By akhilesh on 10/01/13 to close the statement
rs1 = null;
pstmt1.close();
pstmt1 = null;
System.out.println("refSerCnt :"+refSerCnt);
if(refSerCnt == 0)
{
errCode = "VTREFSRINV";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("ref_no"))
......@@ -419,7 +457,21 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
}
else if(childNodeName.equalsIgnoreCase("rcp_amt"))
{
rcpAmt=doublevalue(this.genericUtility.getColumnValue("rcp_amt", domAll));
System.out.println("rcp_amt!! "+this.genericUtility.getColumnValue("rcp_amt", domAll));
if(!(isNumeric(this.genericUtility.getColumnValue("rcp_amt", domAll))))
{
errCode = "VTRCPATVLD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
System.out.println("Receipt amount not valid");
}
else
{
rcpAmt=doublevalue(this.genericUtility.getColumnValue("rcp_amt", domAll));
}
System.out.println("rcpAmt---"+rcpAmt);
if(rcpAmt == 0)
{
......@@ -433,6 +485,7 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(checkAmtvalidation(dom1))
{
......@@ -444,7 +497,6 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
}
/*----------changes done on 04-MARCH-2015,end-------------------------------*/
}
......@@ -553,22 +605,16 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
{
if (currXmlDataStr != null && currXmlDataStr.trim().length()!=0)
{
System.out.println("currXmlDataStr @@@@@@ :"+currXmlDataStr);
currDom = genericUtility.parseString(currXmlDataStr);
}
if (hdrXmlDataStr != null && hdrXmlDataStr.trim().length()!=0)
{
System.out.println("hdrXmlDataStr @@@@@@ :"+hdrXmlDataStr);
hdrDom = genericUtility.parseString(hdrXmlDataStr);
}
if (allXmlDataStr != null && allXmlDataStr.trim().length()!=0)
{
System.out.println("allXmlDataStr @@@@@@ :"+hdrXmlDataStr);
allDom = genericUtility.parseString(allXmlDataStr);
}
//System.out.println ("currXmlDataStr by Mayur ======" + currXmlDataStr.toString());
//System.out.println ("hdrXmlDataStr by Mayur ======" + hdrXmlDataStr.toString());
//System.out.println ("allXmlDataStr by Mayur ======" + allXmlDataStr.toString());
errString = itemChanged( currDom, hdrDom, allDom, objContext, currentColumn, editFlag, xtraParams );
System.out.println ( "ErrString :" + errString);
}
......@@ -847,75 +893,20 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
valueXmlString.append( "<Detail2>\r\n");
/*
if ( currentColumn.trim().equalsIgnoreCase("itm_default") )
{
valueXmlString.append("<line_no__ref><![CDATA[" ).append("1").append( "]]></line_no__ref>\r\n");
}
*/
/*
parentNodeList = currDom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr2 = 0; ctr2 < childNodeListLength; ctr2++)
{
childNode = childNodeList.item(ctr2);
if( childNode != null )
{
childNodeName = childNode.getNodeName();
if ("attribute".equalsIgnoreCase(childNodeName))
{
updateFlag = childNode.getAttributes().getNamedItem("updateFlag").getNodeValue()== null ? "":childNode.getAttributes().getNamedItem("updateFlag").getNodeValue();
}
}
}
//
//else if ( currentColumn.trim().equalsIgnoreCase( "line_no__ref" ) || currentColumn.trim().equalsIgnoreCase( "ref_no" ) ||currentColumn.trim().equalsIgnoreCase( "ref_ser" ))
/*else if ( currentColumn.trim().equalsIgnoreCase( "ref_no" ) )
{
sql ="select (tot_amt - adj_amt) as amt , tran_ser,tran_date,ref_no,ref_date,curr_code,exch_rate,acct_code, cctr_code,due_date,tax_amt,tot_amt,cust_code,adj_amt, case when bad_debt_amt is null then 0 else bad_debt_amt end,discount_dt,DISCOUNT from receivables "
+ " where tran_ser = ? and ref_no = ? and line_no__ref = ? " ;
pstmt = connObject.prepareStatement(sql);
pstmt.setString(1,checkNull(genericUtility.getColumnValue("ref_ser",currDom)));
pstmt.setString(2,checkNull(genericUtility.getColumnValue("ref_no",currDom)));
pstmt.setString(3,checkNull(genericUtility.getColumnValue("line_no__ref",currDom)));
rSet = pstmt.executeQuery();
if (rSet.next())
{
discAmt=rSet.getDouble("DISCOUNT");
discDate=rSet.getDate("discount_dt");
//valueXmlString.append("<discount_dt><![CDATA[" ).append(dtFormat.format( discDate)).append("]]</discount_dt>\r\n");
valueXmlString.append("<rcp_amt><![CDATA[" ).append(rSet.getString(1)).append("]]</rcp_amt>\r\n");
valueXmlString.append("<disc_amt><![CDATA[" ).append(discAmt).append("]]</disc_amt>\r\n");
}
rSet.close();
rSet=null;
pstmt.close();
pstmt=null;
}*/
// added by cpatil on 21/12/12 start
System.out.println("currentColumn ::"+currentColumn);
if ( ( currentColumn.trim().equalsIgnoreCase( "line_no__ref" ) || currentColumn.trim().equalsIgnoreCase( "ref_no" ) || currentColumn.trim().equalsIgnoreCase( "ref_ser" )) && ( "A".equalsIgnoreCase( updateFlag )) )
{
//added by kunal on 12/04/13 change for discount amt
//refNoCust = genericUtility.getColumnValue("ref_no__cust",currDom);
refNo = genericUtility.getColumnValue("ref_no",currDom);
System.out.println("refNo :"+refNo);
/*String refNo2=genericUtility.getColumnValue("ref_no",allDom);
System.out.println("refNo2 :"+refNo2);*/
if(genericUtility.getColumnValue("tran_date", hdrDom) == null)
{
......@@ -936,8 +927,7 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
rSet = pstmt.executeQuery();
if (rSet.next())
{
//discAmt=rSet.getDouble("DISCOUNT");
//discDate=rSet.getTimestamp("discount_dt");
rcpAmt=rSet.getDouble(1);
isFound=true;
}
......@@ -1600,7 +1590,18 @@ public class GenReceiptIC extends ValidatorEJB implements CRemittanceTrLocal, CR
return true;
}
public static boolean isNumeric(String str)
{
try
{
double d = Double.parseDouble(str);
}
catch(NumberFormatException nfe)
{
return false;
}
return true;
}
}
......
......@@ -15,7 +15,7 @@ public interface GenReceiptICLocal extends ValidatorLocal
{
public String wfValData() throws RemoteException,ITMException;
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;
......
......@@ -14,7 +14,7 @@ public interface GenReceiptICRemote extends ValidatorRemote
{
public String wfValData() throws RemoteException,ITMException;
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;
......
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