Commit cfc0bc3a authored by vdhoble's avatar vdhoble

changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101164 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4e329269
...@@ -8,7 +8,7 @@ import ibase.system.config.ConnDriver; ...@@ -8,7 +8,7 @@ import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon; import ibase.webitm.ejb.dis.DistCommon;
//import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
...@@ -41,8 +41,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -41,8 +41,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
* @param editFlag the mode of the transaction(A-Add or E-Edit) * @param editFlag the mode of the transaction(A-Add or E-Edit)
* @param xtraParams contais additional information such as loginEmpCode,loginCode,chgTerm etc * @param xtraParams contais additional information such as loginEmpCode,loginCode,chgTerm etc
*/ */
E12GenericUtility genericUtility = new E12GenericUtility(); GenericUtility genericUtility = GenericUtility.getInstance();
// GenericUtility genericUtility = GenericUtility.getInstance();
String winName = null; String winName = null;
FinCommon finCommon = new FinCommon(); FinCommon finCommon = new FinCommon();
ValidatorEJB validator = null; ValidatorEJB validator = null;
...@@ -60,7 +59,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -60,7 +59,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
Document allDom = null; Document allDom = null;
String errString = null; String errString = null;
// GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
try try
{ {
allXmlDataStr1=allXmlDataStr; allXmlDataStr1=allXmlDataStr;
...@@ -849,14 +848,14 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -849,14 +848,14 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
} }
/**************************/ /**************************/
if(isAmountExceed(domAll,conn)) /* if(isAmountExceed(domAll,dom1,conn))
{ {
System.out.println("Amount Exceed checking..."); System.out.println("Amount Exceed checking...");
errCode = "VTAMTEXEED"; errCode = "VTAMTEXEED";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
...@@ -1079,12 +1078,47 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1079,12 +1078,47 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>"); valueXmlString = new StringBuffer("<?xml version = \"1.0\"?> <Root> <header> <editFlag>");
valueXmlString.append(editFlag).append("</editFlag> </header>"); valueXmlString.append(editFlag).append("</editFlag> </header>");
switch (currentFormNo) switch (currentFormNo)
{ {
case 2: case 2:
parentNodeList = domAll.getElementsByTagName("Detail1");
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();
System.out.println("nodeName =["+childNodeName+"]");
if(childNodeName.equalsIgnoreCase("site_code"))
{
// System.out.println("site_code :"+childNode.getNodeValue());
siteCode = genericUtility.getColumnValue("site_code", dom1);
System.out.println("site_code :"+siteCode);
}
/*if(childNodeName.equalsIgnoreCase("cust_code"))
{
System.out.println("cust_code :"+childNode.getNodeValue());
String cust_code = genericUtility.getColumnValue("cust_code", dom1);
System.out.println("cust code :::::::"+cust_code);
}*/
}
parentNodeList = domAll.getElementsByTagName("Detail2"); parentNodeList = domAll.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
...@@ -1143,19 +1177,19 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1143,19 +1177,19 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}*/ }*/
System.out.println("ref_ser :"+genericUtility.getColumnValue("ref_ser",domAll)); System.out.println("ref_ser :"+genericUtility.getColumnValue("ref_ser",domAll));
System.out.println("ref_no :"+genericUtility.getColumnValue("ref_no",domAll)); System.out.println("ref_no :"+genericUtility.getColumnValue("ref_no",domAll));
System.out.println("custCode :"+genericUtility.getColumnValue("cust_code", dom1)); System.out.println("custCode :"+genericUtility.getColumnValue("cust_code", domAll));
System.out.println("site_code :"+genericUtility.getColumnValue("site_code", dom1)); System.out.println("site_code :"+siteCode);
sql = "SELECT (TOT_AMT - ADJ_AMT) AS AMT FROM RECEIVABLES WHERE TRAN_SER = ? AND REF_NO = ? AND cust_code = ? and site_code=? " ; 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 = conn.prepareStatement(sql);
pstmt.setString(1,checkNull(genericUtility.getColumnValue("ref_ser",domAll))); pstmt.setString(1,checkNull(genericUtility.getColumnValue("ref_ser",domAll)));
pstmt.setString(2,checkNull(genericUtility.getColumnValue("ref_no",domAll))); pstmt.setString(2,checkNull(genericUtility.getColumnValue("ref_no",domAll)));
pstmt.setString(3,checkNull(genericUtility.getColumnValue("cust_code",dom1))); pstmt.setString(3,checkNull(genericUtility.getColumnValue("cust_code",domAll)));
pstmt.setString(4,checkNull(genericUtility.getColumnValue("site_code",dom1))); //pstmt.setString(4,siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next()) if( rs.next())
{ {
...@@ -1287,7 +1321,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1287,7 +1321,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
Document hdrDom = null; Document hdrDom = null;
Document allDom = null; Document allDom = null;
String errString = null; String errString = null;
// GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
try try
{ {
System.out.println("ALL DOM "+allXmlDataStr); System.out.println("ALL DOM "+allXmlDataStr);
...@@ -1365,7 +1399,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1365,7 +1399,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
double custDocAmt=0,discAppr=0,finChg=0; double custDocAmt=0,discAppr=0,finChg=0;
String updateFlag=""; String updateFlag="";
// GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
boolean isFound=false; boolean isFound=false;
String balAmtReqd=""; String balAmtReqd="";
String logCode = ""; String logCode = "";
...@@ -1516,6 +1550,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1516,6 +1550,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
} }
else if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) else if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{ {
System.out.println("Inside Item Default Edit::::");
tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp",currDom)); tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp",currDom));
System.err.println("tranId value in edit** "+tranId); System.err.println("tranId value in edit** "+tranId);
...@@ -1524,7 +1559,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1524,7 +1559,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
bankNameValue = checkNull(genericUtility.getColumnValue("bank_code",currDom)); bankNameValue = checkNull(genericUtility.getColumnValue("bank_code",currDom));
custCodeValue = checkNull(genericUtility.getColumnValue("cust_code",currDom)); custCodeValue = checkNull(genericUtility.getColumnValue("cust_code",currDom));
//siteCodeValue = checkNull(genericUtility.getColumnValue("site_code",currDom)); //siteCodeValue = checkNull(genericUtility.getColumnValue("site_code",currDom));
rcpMode = checkNull(genericUtility.getColumnValue("rcp_mode",currDom)); //rcpMode = checkNull(genericUtility.getColumnValue("rcp_mode",currDom));
chqAmtStr = checkNull(genericUtility.getColumnValue("chq_amt",currDom)); chqAmtStr = checkNull(genericUtility.getColumnValue("chq_amt",currDom));
tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp",currDom)); tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp",currDom));
tranIdAdj = checkNull(genericUtility.getColumnValue("tran_id__adj",currDom)); tranIdAdj = checkNull(genericUtility.getColumnValue("tran_id__adj",currDom));
...@@ -1535,7 +1570,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1535,7 +1570,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
valueXmlString.append("<bank_code protect = \"1\">").append("<![CDATA["+bankNameValue+"]]>").append("</bank_code>"); valueXmlString.append("<bank_code protect = \"1\">").append("<![CDATA["+bankNameValue+"]]>").append("</bank_code>");
valueXmlString.append("<cust_code protect = \"1\">").append("<![CDATA["+custCodeValue+"]]>").append("</cust_code>"); valueXmlString.append("<cust_code protect = \"1\">").append("<![CDATA["+custCodeValue+"]]>").append("</cust_code>");
//valueXmlString.append("<site_code protect = \"1\">").append("<![CDATA["+siteCodeValue+"]]>").append("</site_code>"); //valueXmlString.append("<site_code protect = \"1\">").append("<![CDATA["+siteCodeValue+"]]>").append("</site_code>");
valueXmlString.append("<rcp_mode protect = \"1\">").append("<![CDATA["+rcpMode+"]]>").append("</rcp_mode>"); //valueXmlString.append("<rcp_mode protect = \"1\">").append("<![CDATA["+rcpMode+"]]>").append("</rcp_mode>");
valueXmlString.append("<ref_no protect = \"1\">").append("<![CDATA["+refNo+"]]>").append("</ref_no>"); valueXmlString.append("<ref_no protect = \"1\">").append("<![CDATA["+refNo+"]]>").append("</ref_no>");
if(refDate != null && refDate.trim().length() > 0) if(refDate != null && refDate.trim().length() > 0)
{ {
...@@ -1551,6 +1586,11 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -1551,6 +1586,11 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
} }
/********************************************/ /********************************************/
rcpMode = checkNull(genericUtility.getColumnValue("rcp_mode",allDom));
System.out.println("Checking for edit mode ::for rcp_mode :: "+rcpMode);
valueXmlString.append("<rcp_mode protect = \"1\">").append("<![CDATA["+rcpMode+"]]>").append("</rcp_mode>");
tranId = checkNull(genericUtility.getColumnValue("tran_id",allDom)); tranId = checkNull(genericUtility.getColumnValue("tran_id",allDom));
System.out.println("Checking for edit mode ::for tran_id :: "+tranId); 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"; sql = "select count(*) as detline from rcpdet_form where tran_id = ? and ref_no is not null";
...@@ -2846,7 +2886,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -2846,7 +2886,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
}*/ }*/
public boolean isAmountExceed(Document dom1,Connection conn) throws ITMException public boolean isAmountExceed(Document dom1,Document hdrdom,Connection conn) throws ITMException
{ {
boolean flag=false; boolean flag=false;
NodeList parentList = null; NodeList parentList = null;
...@@ -2865,7 +2905,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -2865,7 +2905,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
domTest = parseString(allXmlDataStr1); domTest = parseString(allXmlDataStr1);
detailsLen=domTest.getElementsByTagName("Detail2").getLength(); detailsLen=domTest.getElementsByTagName("Detail2").getLength();
System.out.println("detailsLen "+detailsLen); System.out.println("detailsLen "+detailsLen);
siteCode = checkNull(genericUtility.getColumnValue("site_code",dom1)); siteCode = checkNull(genericUtility.getColumnValue("site_code",hdrdom));
System.out.println("siteCode$$$$$$$$"+siteCode); System.out.println("siteCode$$$$$$$$"+siteCode);
...@@ -2878,7 +2918,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen ...@@ -2878,7 +2918,7 @@ public class GenReceiptIC extends ValidatorEJB implements GenReceiptICLocal, Gen
pstmt.setString(1,checkNull(genericUtility.getColumnValue("ref_no",dom1))); pstmt.setString(1,checkNull(genericUtility.getColumnValue("ref_no",dom1)));
pstmt.setString(2,checkNull(genericUtility.getColumnValue("site_code",dom1))); pstmt.setString(2,checkNull(siteCode));
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if( rs.next()) if( rs.next())
{ {
......
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