Commit 6c892f55 authored by arawankar's avatar arawankar

Changes made in below components

-Changes made in filter screen for below issue-MiscPayAutoIC.java
1. sundry code in mandtory in filter screen ,data will be filter sundry code wise
2. currency code and exch rate can not set by  by default.

MiscPayAutoPrc.java
1.On split cheque functionality system shows wrong error message
2.confirmation message needs to be proper.

automatic_payment.sql


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@189638 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 892d3f1a
...@@ -11,6 +11,7 @@ import java.util.Date; ...@@ -11,6 +11,7 @@ import java.util.Date;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
...@@ -479,7 +480,192 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi ...@@ -479,7 +480,192 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi
valueXmlString.append("<date__to>").append("<![CDATA["+ sdf.format(date) +"]]>").append("</date__to>"); valueXmlString.append("<date__to>").append("<![CDATA["+ sdf.format(date) +"]]>").append("</date__to>");
valueXmlString.append("<site_code__fr>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__fr>"); valueXmlString.append("<site_code__fr>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__fr>");
valueXmlString.append("<site_code__to>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__to>"); valueXmlString.append("<site_code__to>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__to>");
//itemChanged( dom, dom1, dom2, objContext, "site_code__to", editFlag, xtraParams) ; setNodeValue(dom, "site_code__to", loginsiteCode);
//itemChanged( dom, dom1, dom2, objContext, "site_code__fr", editFlag, xtraParams ,valueXmlString) ;
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
sql = "select fin_entity from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
finEntity = checkNullAndTrim(rs.getString("fin_entity"));
}
System.out.println("finEntity--["+finEntity+"]--siteCodeFr["+siteCodeFr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select curr_code from finent where fin_entity = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
rs = pstmt.executeQuery();
if(rs.next())
{
currCodeTemp = checkNullAndTrim(rs.getString("curr_code"));
}
System.out.println("currCodeTemp--["+currCodeTemp+"]--finEntity["+finEntity+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<curr_code>").append("<![CDATA["+currCode+"]]>").append("</curr_code>");
setNodeValue(dom, "curr_code",currCode);
//itemChanged(dom, dom1, dom2,objContext, "curr_code", editFlag, xtraParams,valueXmlString);
datePay = genericUtility.getColumnValue("date__pay", dom);
System.out.println("datePay---["+datePay+"]");
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
sql = "select fin_entity from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
finEntity = checkNullAndTrim(rs.getString("fin_entity"));
}
System.out.println("finEntity--["+finEntity+"]--siteCodeFr["+siteCodeFr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select curr_code from finent where fin_entity = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
rs = pstmt.executeQuery();
if(rs.next())
{
currCodeTemp = checkNullAndTrim(rs.getString("curr_code"));
}
System.out.println("currCodeTemp--["+currCodeTemp+"]--finEntity["+finEntity+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<curr_code>").append("<![CDATA["+currCodeTemp+"]]>").append("</curr_code>");
setNodeValue(dom, "curr_code",currCodeTemp);
//itemChanged(dom, dom1, dom2,objContext, "curr_code", editFlag, xtraParams,valueXmlString);
sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
siteDescr = checkNullAndTrim(rs.getString("descr"));
}
System.out.println("siteCodeFr--["+siteCodeFr+"]--siteDescr["+siteDescr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
currCode = genericUtility.getColumnValue("curr_code", dom);
System.out.println("currCode-----["+currCode+"]");
maxRate = finCommon.getDailyExchRateSellBuy(currCodeTemp, "", siteCodeFr, datePay, "B",conn);
System.out.println("maxRate--["+maxRate+"]");
valueXmlString.append("<exch_rate>").append("<![CDATA["+maxRate+"]]>").append("</exch_rate>");
if(currCode.equalsIgnoreCase(currCodeTemp))
{
valueXmlString.append("<exch_rate protect='1'>").append("<![CDATA["+"1"+"]]>").append("</exch_rate>");
}
else
{
valueXmlString.append("<exch_rate protect='1'>").append("<![CDATA["+"0"+"]]>").append("</exch_rate>");
}
sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
siteDescr = checkNullAndTrim(rs.getString("descr"));
}
System.out.println("siteCodeFr--["+siteCodeFr+"]--siteDescr["+siteDescr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<site_code_descr__fr>").append("<![CDATA["+siteDescr+"]]>").append("</site_code_descr__fr>");
varValue = finCommon.getFinparams("999999", "SITE_CODE_MULTI", conn);
if(varValue == null || varValue.trim().length() == 0 || varValue.equalsIgnoreCase("NULLFOUND"))
{
varValue = "N";
}
if("N".equalsIgnoreCase(varValue))
{
valueXmlString.append("<site_code__to protect='1'>").append("<![CDATA["+siteCodeFr+"]]>").append("</site_code__to>");
valueXmlString.append("<site_code_descr__to>").append("<![CDATA["+siteDescr+"]]>").append("</site_code_descr__to>");
}
else
{
valueXmlString.append("<site_code__to protect='0'>").append("<![CDATA["+""+"]]>").append("</site_code__to>");
}
//itemChanged( dom, dom1, dom2, objContext, "site_code__to", editFlag, xtraParams ,valueXmlString) ;
siteCodeTo = genericUtility.getColumnValue("site_code__to", dom);
sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
siteCodeToDescr = checkNullAndTrim(rs.getString("descr"));
}
System.out.println("siteCodeTo--["+siteCodeTo+"]--siteCodeToDescr["+siteCodeToDescr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<site_code_descr__to>").append("<![CDATA["+siteCodeToDescr+"]]>").append("</site_code_descr__to>");
sql = "select descr from site where site_code = ?"; sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginsiteCode); pstmt.setString(1, loginsiteCode);
...@@ -629,7 +815,7 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi ...@@ -629,7 +815,7 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi
{ {
currCodeTemp = checkNullAndTrim(rs.getString("curr_code")); currCodeTemp = checkNullAndTrim(rs.getString("curr_code"));
} }
System.out.println("currCode--["+currCode+"]--finEntity["+finEntity+"]"); System.out.println("currCodeTemp--["+currCodeTemp+"]--finEntity["+finEntity+"]");
if(rs != null) if(rs != null)
{ {
rs.close(); rs.close();
...@@ -684,6 +870,25 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi ...@@ -684,6 +870,25 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi
datePay = genericUtility.getColumnValue("date__pay", dom); datePay = genericUtility.getColumnValue("date__pay", dom);
System.out.println("datePay---["+datePay+"]"); System.out.println("datePay---["+datePay+"]");
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom); siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
sql = "select fin_entity from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
finEntity = checkNullAndTrim(rs.getString("fin_entity"));
}
System.out.println("finEntity--["+finEntity+"]--siteCodeFr["+siteCodeFr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select curr_code from finent where fin_entity = ?"; sql = "select curr_code from finent where fin_entity = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity); pstmt.setString(1, finEntity);
...@@ -825,4 +1030,23 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi ...@@ -825,4 +1030,23 @@ public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,Mi
} }
return date; return date;
} }
private static void setNodeValue(Document dom, String nodeName,String nodeVal) throws Exception
{
Node tempNode = dom.getElementsByTagName(nodeName).item(0);
if (tempNode != null)
{
if (tempNode.getFirstChild() == null)
{
CDATASection cDataSection = dom.createCDATASection(nodeVal);
tempNode.appendChild(cDataSection);
}
else
{
tempNode.getFirstChild().setNodeValue(nodeVal);
}
}
tempNode = null;
}
} }
...@@ -31,6 +31,7 @@ import javax.xml.xpath.XPathFactory; ...@@ -31,6 +31,7 @@ import javax.xml.xpath.XPathFactory;
import org.apache.axis.client.Call; import org.apache.axis.client.Call;
import org.apache.axis.client.Service; import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType; import org.apache.axis.encoding.XMLType;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import org.w3c.dom.Node; import org.w3c.dom.Node;
...@@ -174,7 +175,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -174,7 +175,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
mvouchTo = "z"; mvouchTo = "z";
} }
if(sundryType == null) if(sundryType == null || sundryType.trim().length() == 0)
{ {
sundryType = "%"; sundryType = "%";
} }
...@@ -182,7 +183,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -182,7 +183,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
sundryType = sundryType.trim() + "%"; sundryType = sundryType.trim() + "%";
} }
if(sundryCode == null) if(sundryCode == null || sundryCode.trim().length() == 0)
{ {
sundryCode = "%"; sundryCode = "%";
} }
...@@ -190,7 +191,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -190,7 +191,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
sundryCode = sundryCode.trim() + "%"; sundryCode = sundryCode.trim() + "%";
} }
if(batch == null) if(batch == null || batch.trim().length() == 0)
{ {
batch = "%"; batch = "%";
} }
...@@ -708,6 +709,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -708,6 +709,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
int mrows = 0; int mrows = 0;
StringBuffer xmlString = null; StringBuffer xmlString = null;
StringBuffer headerBuff = null;
StringBuffer detailBuff = null; StringBuffer detailBuff = null;
//StringBuffer xmlString = null; //StringBuffer xmlString = null;
StringBuffer xmlString1 = null; StringBuffer xmlString1 = null;
...@@ -859,51 +861,51 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -859,51 +861,51 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("tranDate--["+tranDate+"]autoPost--["+autoPost+"]taxEnv--["+taxEnv+"]mExchRatePay--["+mExchRatePay+"]"); System.out.println("tranDate--["+tranDate+"]autoPost--["+autoPost+"]taxEnv--["+taxEnv+"]mExchRatePay--["+mExchRatePay+"]");
//xmlString = new StringBuffer(); headerBuff = new StringBuffer();
xmlString.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">"); headerBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">");
xmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>"); headerBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlString.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>"); headerBuff.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>");
xmlString.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>"); headerBuff.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>");
xmlString.append("<ref_no>").append("<![CDATA[" + mRefNo + "]]>").append("</ref_no>"); headerBuff.append("<ref_no>").append("<![CDATA[" + mRefNo + "]]>").append("</ref_no>");
xmlString.append("<ref_no__upto>").append("<![CDATA[" + mRefNoUpto + "]]>").append("</ref_no__upto>"); headerBuff.append("<ref_no__upto>").append("<![CDATA[" + mRefNoUpto + "]]>").append("</ref_no__upto>");
xmlString.append("<bank_code>").append("<![CDATA[" + mBankCode + "]]>").append("</bank_code>"); headerBuff.append("<bank_code>").append("<![CDATA[" + mBankCode + "]]>").append("</bank_code>");
xmlString.append("<noof_confirmed>").append("<![CDATA[0]]>").append("</noof_confirmed>"); headerBuff.append("<noof_confirmed>").append("<![CDATA[0]]>").append("</noof_confirmed>");
xmlString.append("<noof_rejected>").append("<![CDATA[0]]>").append("</noof_rejected>"); headerBuff.append("<noof_rejected>").append("<![CDATA[0]]>").append("</noof_rejected>");
xmlString.append("<acct_code__bal>").append("<![CDATA[" + acctCodeBal + "]]>").append("</acct_code__bal>"); headerBuff.append("<acct_code__bal>").append("<![CDATA[" + acctCodeBal + "]]>").append("</acct_code__bal>");
xmlString.append("<cctr_code__bal>").append("<![CDATA[" + cctrCodeBal + "]]>").append("</cctr_code__bal>"); headerBuff.append("<cctr_code__bal>").append("<![CDATA[" + cctrCodeBal + "]]>").append("</cctr_code__bal>");
xmlString.append("<acct_code__bc>").append("<![CDATA[" + acctCodeBc + "]]>").append("</acct_code__bc>"); headerBuff.append("<acct_code__bc>").append("<![CDATA[" + acctCodeBc + "]]>").append("</acct_code__bc>");
xmlString.append("<cctr_code__bc>").append("<![CDATA[" + cctrCodeBc + "]]>").append("</cctr_code__bc>"); headerBuff.append("<cctr_code__bc>").append("<![CDATA[" + cctrCodeBc + "]]>").append("</cctr_code__bc>");
xmlString.append("<acct_code__cf>").append("<![CDATA[" + acctCodeCf + "]]>").append("</acct_code__cf>"); headerBuff.append("<acct_code__cf>").append("<![CDATA[" + acctCodeCf + "]]>").append("</acct_code__cf>");
xmlString.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>"); headerBuff.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>");
xmlString.append("<cctr_code__cf>").append("<![CDATA[" + cctrCodeCf + "]]>").append("</cctr_code__cf>"); headerBuff.append("<cctr_code__cf>").append("<![CDATA[" + cctrCodeCf + "]]>").append("</cctr_code__cf>");
xmlString.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>"); headerBuff.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>");
xmlString.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>"); headerBuff.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>");
xmlString.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>"); headerBuff.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>");
xmlString.append("<date__pay>").append("<![CDATA[" + tranDate + "]]>").append("</date__pay>"); headerBuff.append("<date__pay>").append("<![CDATA[" + tranDate + "]]>").append("</date__pay>");
xmlString.append("<date__fr>").append("<![CDATA[" + tranDate + "]]>").append("</date__fr>"); headerBuff.append("<date__fr>").append("<![CDATA[" + tranDate + "]]>").append("</date__fr>");
xmlString.append("<date__to>").append("<![CDATA[" + tranDate + "]]>").append("</date__to>"); headerBuff.append("<date__to>").append("<![CDATA[" + tranDate + "]]>").append("</date__to>");
xmlString.append("<vouch_no__fr>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__fr", headerDom,"1","") + "]]>").append("</vouch_no__fr>"); headerBuff.append("<vouch_no__fr>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__fr", headerDom,"1","") + "]]>").append("</vouch_no__fr>");
xmlString.append("<vouch_no__to>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__to", headerDom,"1","") + "]]>").append("</vouch_no__to>"); headerBuff.append("<vouch_no__to>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__to", headerDom,"1","") + "]]>").append("</vouch_no__to>");
xmlString.append("<post>").append("<![CDATA[" + autoPost + "]]>").append("</post>"); headerBuff.append("<post>").append("<![CDATA[" + autoPost + "]]>").append("</post>");
xmlString.append("<tax_env>").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>"); headerBuff.append("<tax_env>").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>");
xmlString.append("<exch_rate>").append("<![CDATA[" + mExchRatePay + "]]>").append("</exch_rate>"); headerBuff.append("<exch_rate>").append("<![CDATA[" + mExchRatePay + "]]>").append("</exch_rate>");
xmlString.append("<site_code__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__fr", headerDom,"1","") + "]]>").append("</site_code__fr>"); headerBuff.append("<site_code__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__fr", headerDom,"1","") + "]]>").append("</site_code__fr>");
xmlString.append("<site_code__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__to", headerDom,"1","") + "]]>").append("</site_code__to>"); headerBuff.append("<site_code__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__to", headerDom,"1","") + "]]>").append("</site_code__to>");
xmlString.append("<bank_name>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name", headerDom,"1","") + "]]>").append("</bank_name>"); headerBuff.append("<bank_name>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name", headerDom,"1","") + "]]>").append("</bank_name>");
xmlString.append("<sundry_type>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_type", headerDom,"1","") + "]]>").append("</sundry_type>"); headerBuff.append("<sundry_type>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_type", headerDom,"1","") + "]]>").append("</sundry_type>");
xmlString.append("<sundry_code>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_code", headerDom,"1","") + "]]>").append("</sundry_code>"); headerBuff.append("<sundry_code>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_code", headerDom,"1","") + "]]>").append("</sundry_code>");
xmlString.append("<pay_mode>").append("<![CDATA[" + genericUtility.getColumnValue("pay_mode", headerDom,"1","") + "]]>").append("</pay_mode>"); headerBuff.append("<pay_mode>").append("<![CDATA[" + genericUtility.getColumnValue("pay_mode", headerDom,"1","") + "]]>").append("</pay_mode>");
xmlString.append("<entry_batch_no>").append("<![CDATA[" + genericUtility.getColumnValue("entry_batch_no", headerDom,"1","") + "]]>").append("</entry_batch_no>"); headerBuff.append("<entry_batch_no>").append("<![CDATA[" + genericUtility.getColumnValue("entry_batch_no", headerDom,"1","") + "]]>").append("</entry_batch_no>");
xmlString.append("<chq_split>").append("<![CDATA[" + genericUtility.getColumnValue("chq_split", headerDom,"1","") + "]]>").append("</chq_split>"); headerBuff.append("<chq_split>").append("<![CDATA[" + genericUtility.getColumnValue("chq_split", headerDom,"1","") + "]]>").append("</chq_split>");
xmlString.append("<bank_code__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_code__add", headerDom,"1","") + "]]>").append("</bank_code__add>"); headerBuff.append("<bank_code__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_code__add", headerDom,"1","") + "]]>").append("</bank_code__add>");
xmlString.append("<bank_name__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name__add", headerDom,"1","") + "]]>").append("</bank_name__add>"); headerBuff.append("<bank_name__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name__add", headerDom,"1","") + "]]>").append("</bank_name__add>");
xmlString.append("<noof_confirmed>").append("<![CDATA[" + genericUtility.getColumnValue("noof_confirmed", headerDom,"1","") + "]]>").append("</noof_confirmed>"); headerBuff.append("<noof_confirmed>").append("<![CDATA[" + genericUtility.getColumnValue("noof_confirmed", headerDom,"1","") + "]]>").append("</noof_confirmed>");
xmlString.append("<noof_rejected>").append("<![CDATA[" + genericUtility.getColumnValue("noof_rejected", headerDom,"1","") + "]]>").append("</noof_rejected>"); headerBuff.append("<noof_rejected>").append("<![CDATA[" + genericUtility.getColumnValue("noof_rejected", headerDom,"1","") + "]]>").append("</noof_rejected>");
xmlString.append("<curr_code>").append("<![CDATA[" + genericUtility.getColumnValue("curr_code", headerDom,"1","") + "]]>").append("</curr_code>"); headerBuff.append("<curr_code>").append("<![CDATA[" + genericUtility.getColumnValue("curr_code", headerDom,"1","") + "]]>").append("</curr_code>");
xmlString.append("<bank_flag>").append("<![CDATA[" + genericUtility.getColumnValue("bank_flag", headerDom,"1","") + "]]>").append("</bank_flag>"); headerBuff.append("<bank_flag>").append("<![CDATA[" + genericUtility.getColumnValue("bank_flag", headerDom,"1","") + "]]>").append("</bank_flag>");
xmlString.append("<site_code_descr__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__fr", headerDom,"1","") + "]]>").append("</site_code_descr__fr>"); headerBuff.append("<site_code_descr__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__fr", headerDom,"1","") + "]]>").append("</site_code_descr__fr>");
xmlString.append("<site_code_descr__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__to", headerDom,"1","") + "]]>").append("</site_code_descr__to>"); headerBuff.append("<site_code_descr__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__to", headerDom,"1","") + "]]>").append("</site_code_descr__to>");
xmlString.append("</Detail1>"); headerBuff.append("</Detail1>");
String payModeArray[] = {"Q","N","G","T","C","D"}; String payModeArray[] = {"Q","N","G","T","C","D"};
...@@ -1594,6 +1596,15 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1594,6 +1596,15 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
System.out.println("chqName----------["+ chqName +"]"); System.out.println("chqName----------["+ chqName +"]");
System.out.println("headerBuff--@@@@@@-["+headerBuff+"]");
Document tempdom = genericUtility.parseString(headerBuff.toString());
setNodeValue(tempdom, "sundry_code", mSundryCode);
String tempStr = genericUtility.serializeDom(tempdom);
headerBuff = null;
headerBuff = new StringBuffer(tempStr );
System.out.println("headerBuff--&&&&&-["+headerBuff+"]");
detailBuff.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>"); detailBuff.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>");
detailBuff.append("<acct_code__ap>").append("<![CDATA[" + mAcctCodeAp + "]]>").append("</acct_code__ap>"); detailBuff.append("<acct_code__ap>").append("<![CDATA[" + mAcctCodeAp + "]]>").append("</acct_code__ap>");
detailBuff.append("<cctr_code__ap>").append("<![CDATA[" + mCctrCodeAp + "]]>").append("</cctr_code__ap>"); detailBuff.append("<cctr_code__ap>").append("<![CDATA[" + mCctrCodeAp + "]]>").append("</cctr_code__ap>");
...@@ -1690,6 +1701,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1690,6 +1701,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
xmlString1.append("</group0>\r\n"); xmlString1.append("</group0>\r\n");
xmlString1.append("</DocumentRoot>\r\n"); xmlString1.append("</DocumentRoot>\r\n");
xmldata.append(xmlString); xmldata.append(xmlString);
xmldata.append(headerBuff);
xmldata.append(detailBuff); xmldata.append(detailBuff);
xmldata.append(xmlString1); xmldata.append(xmlString1);
...@@ -1697,8 +1709,21 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1697,8 +1709,21 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
String returnString = saveData(oSiteCode, xmldata.toString(), loginCode, conn); String returnString = saveData(oSiteCode, xmldata.toString(), loginCode, conn);
System.out.println("returnString------["+returnString+"]"); System.out.println("returnString------["+returnString+"]");
ArrayList<String> errList = getTranId(returnString);
miscPaymentTranID = getTranId(returnString); System.out.println("errList--["+errList+"]");
//miscPaymentTranID = getTranId(returnString);
if(errList.get(1).indexOf("NOERROR") > -1)
{
miscPaymentTranID = errList.get(0);
}
else
{
String errCode = errList.get(1);
errString = itmDBAccess.getErrorString( "", errCode , loginCode,"",conn);// changes by Nandkumar Gadkari on 20/07/18
errString = getErrorXml(errString);
return errString;
}
System.out.println("miscPaymentTranID--["+miscPaymentTranID+"]"); System.out.println("miscPaymentTranID--["+miscPaymentTranID+"]");
sql = "update misc_payment set sundry_type = ?, sundry_code = ?, pay_mode = ?, " sql = "update misc_payment set sundry_type = ?, sundry_code = ?, pay_mode = ?, "
...@@ -1938,7 +1963,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1938,7 +1963,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
StringBuffer xmlString = null; StringBuffer xmlString = null;
StringBuffer detailBuff = null; StringBuffer detailBuff = null;
//StringBuffer xmlString = null; StringBuffer headerBuff = null;
StringBuffer xmlString1 = null; StringBuffer xmlString1 = null;
//Added by Varsha V on 06-08-18 for declaring variable outside try //Added by Varsha V on 06-08-18 for declaring variable outside try
double payAmt = 0.0, netPayable = 0.0, totUnconfAmt = 0.0; double payAmt = 0.0, netPayable = 0.0, totUnconfAmt = 0.0;
...@@ -2086,51 +2111,51 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2086,51 +2111,51 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("tranDate--["+tranDate+"]autoPost--["+autoPost+"]taxEnv--["+taxEnv+"]mExchRatePay--["+mExchRatePay+"]"); System.out.println("tranDate--["+tranDate+"]autoPost--["+autoPost+"]taxEnv--["+taxEnv+"]mExchRatePay--["+mExchRatePay+"]");
//xmlString = new StringBuffer(); headerBuff = new StringBuffer();
xmlString.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">"); headerBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">");
xmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>"); headerBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlString.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>"); headerBuff.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>");
xmlString.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>"); headerBuff.append("<tran_type>").append("<![CDATA[" + tranType + "]]>").append("</tran_type>");
xmlString.append("<ref_no>").append("<![CDATA[" + mRefNo + "]]>").append("</ref_no>"); headerBuff.append("<ref_no>").append("<![CDATA[" + mRefNo + "]]>").append("</ref_no>");
xmlString.append("<ref_no__upto>").append("<![CDATA[" + mRefNoUpto + "]]>").append("</ref_no__upto>"); headerBuff.append("<ref_no__upto>").append("<![CDATA[" + mRefNoUpto + "]]>").append("</ref_no__upto>");
xmlString.append("<bank_code>").append("<![CDATA[" + mBankCode + "]]>").append("</bank_code>"); headerBuff.append("<bank_code>").append("<![CDATA[" + mBankCode + "]]>").append("</bank_code>");
xmlString.append("<noof_confirmed>").append("<![CDATA[0]]>").append("</noof_confirmed>"); headerBuff.append("<noof_confirmed>").append("<![CDATA[0]]>").append("</noof_confirmed>");
xmlString.append("<noof_rejected>").append("<![CDATA[0]]>").append("</noof_rejected>"); headerBuff.append("<noof_rejected>").append("<![CDATA[0]]>").append("</noof_rejected>");
xmlString.append("<acct_code__bal>").append("<![CDATA[" + acctCodeBal + "]]>").append("</acct_code__bal>"); headerBuff.append("<acct_code__bal>").append("<![CDATA[" + acctCodeBal + "]]>").append("</acct_code__bal>");
xmlString.append("<cctr_code__bal>").append("<![CDATA[" + cctrCodeBal + "]]>").append("</cctr_code__bal>"); headerBuff.append("<cctr_code__bal>").append("<![CDATA[" + cctrCodeBal + "]]>").append("</cctr_code__bal>");
xmlString.append("<acct_code__bc>").append("<![CDATA[" + acctCodeBc + "]]>").append("</acct_code__bc>"); headerBuff.append("<acct_code__bc>").append("<![CDATA[" + acctCodeBc + "]]>").append("</acct_code__bc>");
xmlString.append("<cctr_code__bc>").append("<![CDATA[" + cctrCodeBc + "]]>").append("</cctr_code__bc>"); headerBuff.append("<cctr_code__bc>").append("<![CDATA[" + cctrCodeBc + "]]>").append("</cctr_code__bc>");
xmlString.append("<acct_code__cf>").append("<![CDATA[" + acctCodeCf + "]]>").append("</acct_code__cf>"); headerBuff.append("<acct_code__cf>").append("<![CDATA[" + acctCodeCf + "]]>").append("</acct_code__cf>");
xmlString.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>"); headerBuff.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>");
xmlString.append("<cctr_code__cf>").append("<![CDATA[" + cctrCodeCf + "]]>").append("</cctr_code__cf>"); headerBuff.append("<cctr_code__cf>").append("<![CDATA[" + cctrCodeCf + "]]>").append("</cctr_code__cf>");
xmlString.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>"); headerBuff.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>");
xmlString.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>"); headerBuff.append("<acct_code__cf_ap>").append("<![CDATA[" + acctCodeCfAp + "]]>").append("</acct_code__cf_ap>");
xmlString.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>"); headerBuff.append("<cctr_code__cf_ap>").append("<![CDATA[" + cctrCodeCfAp + "]]>").append("</cctr_code__cf_ap>");
xmlString.append("<date__pay>").append("<![CDATA[" + tranDate + "]]>").append("</date__pay>"); headerBuff.append("<date__pay>").append("<![CDATA[" + tranDate + "]]>").append("</date__pay>");
xmlString.append("<date__fr>").append("<![CDATA[" + tranDate + "]]>").append("</date__fr>"); headerBuff.append("<date__fr>").append("<![CDATA[" + tranDate + "]]>").append("</date__fr>");
xmlString.append("<date__to>").append("<![CDATA[" + tranDate + "]]>").append("</date__to>"); headerBuff.append("<date__to>").append("<![CDATA[" + tranDate + "]]>").append("</date__to>");
xmlString.append("<vouch_no__fr>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__fr", headerDom,"1","") + "]]>").append("</vouch_no__fr>"); headerBuff.append("<vouch_no__fr>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__fr", headerDom,"1","") + "]]>").append("</vouch_no__fr>");
xmlString.append("<vouch_no__to>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__to", headerDom,"1","") + "]]>").append("</vouch_no__to>"); headerBuff.append("<vouch_no__to>").append("<![CDATA[" + genericUtility.getColumnValue("vouch_no__to", headerDom,"1","") + "]]>").append("</vouch_no__to>");
xmlString.append("<post>").append("<![CDATA[" + autoPost + "]]>").append("</post>"); headerBuff.append("<post>").append("<![CDATA[" + autoPost + "]]>").append("</post>");
xmlString.append("<tax_env>").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>"); headerBuff.append("<tax_env>").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>");
xmlString.append("<exch_rate>").append("<![CDATA[" + mExchRatePay + "]]>").append("</exch_rate>"); headerBuff.append("<exch_rate>").append("<![CDATA[" + mExchRatePay + "]]>").append("</exch_rate>");
xmlString.append("<site_code__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__fr", headerDom,"1","") + "]]>").append("</site_code__fr>"); headerBuff.append("<site_code__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__fr", headerDom,"1","") + "]]>").append("</site_code__fr>");
xmlString.append("<site_code__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__to", headerDom,"1","") + "]]>").append("</site_code__to>"); headerBuff.append("<site_code__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code__to", headerDom,"1","") + "]]>").append("</site_code__to>");
xmlString.append("<bank_name>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name", headerDom,"1","") + "]]>").append("</bank_name>"); headerBuff.append("<bank_name>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name", headerDom,"1","") + "]]>").append("</bank_name>");
xmlString.append("<sundry_type>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_type", headerDom,"1","") + "]]>").append("</sundry_type>"); headerBuff.append("<sundry_type>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_type", headerDom,"1","") + "]]>").append("</sundry_type>");
xmlString.append("<sundry_code>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_code", headerDom,"1","") + "]]>").append("</sundry_code>"); headerBuff.append("<sundry_code>").append("<![CDATA[" + genericUtility.getColumnValue("sundry_code", headerDom,"1","") + "]]>").append("</sundry_code>");
xmlString.append("<pay_mode>").append("<![CDATA[" + genericUtility.getColumnValue("pay_mode", headerDom,"1","") + "]]>").append("</pay_mode>"); headerBuff.append("<pay_mode>").append("<![CDATA[" + genericUtility.getColumnValue("pay_mode", headerDom,"1","") + "]]>").append("</pay_mode>");
xmlString.append("<entry_batch_no>").append("<![CDATA[" + genericUtility.getColumnValue("entry_batch_no", headerDom,"1","") + "]]>").append("</entry_batch_no>"); headerBuff.append("<entry_batch_no>").append("<![CDATA[" + genericUtility.getColumnValue("entry_batch_no", headerDom,"1","") + "]]>").append("</entry_batch_no>");
xmlString.append("<chq_split>").append("<![CDATA[" + genericUtility.getColumnValue("chq_split", headerDom,"1","") + "]]>").append("</chq_split>"); headerBuff.append("<chq_split>").append("<![CDATA[" + genericUtility.getColumnValue("chq_split", headerDom,"1","") + "]]>").append("</chq_split>");
xmlString.append("<bank_code__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_code__add", headerDom,"1","") + "]]>").append("</bank_code__add>"); headerBuff.append("<bank_code__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_code__add", headerDom,"1","") + "]]>").append("</bank_code__add>");
xmlString.append("<bank_name__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name__add", headerDom,"1","") + "]]>").append("</bank_name__add>"); headerBuff.append("<bank_name__add>").append("<![CDATA[" + genericUtility.getColumnValue("bank_name__add", headerDom,"1","") + "]]>").append("</bank_name__add>");
xmlString.append("<noof_confirmed>").append("<![CDATA[" + genericUtility.getColumnValue("noof_confirmed", headerDom,"1","") + "]]>").append("</noof_confirmed>"); headerBuff.append("<noof_confirmed>").append("<![CDATA[" + genericUtility.getColumnValue("noof_confirmed", headerDom,"1","") + "]]>").append("</noof_confirmed>");
xmlString.append("<noof_rejected>").append("<![CDATA[" + genericUtility.getColumnValue("noof_rejected", headerDom,"1","") + "]]>").append("</noof_rejected>"); headerBuff.append("<noof_rejected>").append("<![CDATA[" + genericUtility.getColumnValue("noof_rejected", headerDom,"1","") + "]]>").append("</noof_rejected>");
xmlString.append("<curr_code>").append("<![CDATA[" + genericUtility.getColumnValue("curr_code", headerDom,"1","") + "]]>").append("</curr_code>"); headerBuff.append("<curr_code>").append("<![CDATA[" + genericUtility.getColumnValue("curr_code", headerDom,"1","") + "]]>").append("</curr_code>");
xmlString.append("<bank_flag>").append("<![CDATA[" + genericUtility.getColumnValue("bank_flag", headerDom,"1","") + "]]>").append("</bank_flag>"); headerBuff.append("<bank_flag>").append("<![CDATA[" + genericUtility.getColumnValue("bank_flag", headerDom,"1","") + "]]>").append("</bank_flag>");
xmlString.append("<site_code_descr__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__fr", headerDom,"1","") + "]]>").append("</site_code_descr__fr>"); headerBuff.append("<site_code_descr__fr>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__fr", headerDom,"1","") + "]]>").append("</site_code_descr__fr>");
xmlString.append("<site_code_descr__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__to", headerDom,"1","") + "]]>").append("</site_code_descr__to>"); headerBuff.append("<site_code_descr__to>").append("<![CDATA[" + genericUtility.getColumnValue("site_code_descr__to", headerDom,"1","") + "]]>").append("</site_code_descr__to>");
xmlString.append("</Detail1>"); headerBuff.append("</Detail1>");
String payModeArray[] = {"Q","N","G","T","C","D"}; String payModeArray[] = {"Q","N","G","T","C","D"};
...@@ -2813,6 +2838,17 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2813,6 +2838,17 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
chqName = ""; chqName = "";
} }
//IF HEADER HAS NO SUNDRY CODE THEN NEED TO BE APPEND.
System.out.println("headerBuff--@@@@@@-["+headerBuff+"]");
Document tempdom = genericUtility.parseString(headerBuff.toString());
setNodeValue(tempdom, "sundry_code", mSundryCode);
String tempStr = genericUtility.serializeDom(tempdom);
headerBuff = null;
headerBuff = new StringBuffer(tempStr );
System.out.println("headerBuff--&&&&&-["+headerBuff+"]");
detailBuff.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>"); detailBuff.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>");
detailBuff.append("<acct_code__ap>").append("<![CDATA[" + mAcctCodeAp + "]]>").append("</acct_code__ap>"); detailBuff.append("<acct_code__ap>").append("<![CDATA[" + mAcctCodeAp + "]]>").append("</acct_code__ap>");
detailBuff.append("<cctr_code__ap>").append("<![CDATA[" + mCctrCodeAp + "]]>").append("</cctr_code__ap>"); detailBuff.append("<cctr_code__ap>").append("<![CDATA[" + mCctrCodeAp + "]]>").append("</cctr_code__ap>");
...@@ -2907,6 +2943,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2907,6 +2943,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
xmlString1.append("</group0>\r\n"); xmlString1.append("</group0>\r\n");
xmlString1.append("</DocumentRoot>\r\n"); xmlString1.append("</DocumentRoot>\r\n");
xmldata.append(xmlString); xmldata.append(xmlString);
xmldata.append(headerBuff);
xmldata.append(detailBuff); xmldata.append(detailBuff);
xmldata.append(xmlString1); xmldata.append(xmlString1);
...@@ -2915,7 +2952,22 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2915,7 +2952,22 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
String returnString = saveData(oSiteCode, xmldata.toString(), loginCode, conn); String returnString = saveData(oSiteCode, xmldata.toString(), loginCode, conn);
System.out.println("returnString------["+returnString+"]"); System.out.println("returnString------["+returnString+"]");
miscPaymentTranID = getTranId(returnString); //miscPaymentTranID = getTranId(returnString);
ArrayList<String> errList = getTranId(returnString);
System.out.println("errList--["+errList+"]");
//mssiscPaymentTranID = getTranId(returnString);
if(errList.get(1).indexOf("NOERROR") > -1)
{
miscPaymentTranID = errList.get(0);
}
else
{
String errCode = errList.get(1);
errString = itmDBAccess.getErrorString( "", errCode , loginCode,"",conn);// changes by Nandkumar Gadkari on 20/07/18
errString = getErrorXml(errString);
return errString;
}
System.out.println("miscPaymentTranID--["+miscPaymentTranID+"]"); System.out.println("miscPaymentTranID--["+miscPaymentTranID+"]");
sql = "update misc_payment set sundry_type = ?, sundry_code = ?, pay_mode = ?, " sql = "update misc_payment set sundry_type = ?, sundry_code = ?, pay_mode = ?, "
...@@ -3014,6 +3066,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3014,6 +3066,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
xmlString1.append("</group0>\r\n"); xmlString1.append("</group0>\r\n");
xmlString1.append("</DocumentRoot>\r\n"); xmlString1.append("</DocumentRoot>\r\n");
xmldata.append(xmlString); xmldata.append(xmlString);
xmldata.append(headerBuff);
xmldata.append(detailBuff); xmldata.append(detailBuff);
xmldata.append(xmlString1); xmldata.append(xmlString1);
...@@ -3021,8 +3074,24 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3021,8 +3074,24 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
String returnString = saveData(oSiteCode, xmldata.toString(), loginCode, conn); String returnString = saveData(oSiteCode, xmldata.toString(), loginCode, conn);
System.out.println("returnString------["+returnString+"]"); System.out.println("returnString------["+returnString+"]");
//miscPaymentTranID = getTranId(returnString);
ArrayList<String> errList = getTranId(returnString);
System.out.println("errList--["+errList+"]");
miscPaymentTranID = getTranId(returnString); //miscPaymentTranID = getTranId(returnString);
if(errList.get(1).indexOf("NOERROR") > -1)
{
miscPaymentTranID = errList.get(0);
}
else
{
String errCode = errList.get(1);
System.out.println("errCode----["+errCode+"]");
errString = itmDBAccess.getErrorString( "", errCode , loginCode,"",conn);// changes by Nandkumar Gadkari on 20/07/18
errString = getErrorXml(errString);
return errString;
}
System.out.println("miscPaymentTranID--["+miscPaymentTranID+"]"); System.out.println("miscPaymentTranID--["+miscPaymentTranID+"]");
sql = "update misc_payment set sundry_type = ?, sundry_code = ?, pay_mode = ?, " sql = "update misc_payment set sundry_type = ?, sundry_code = ?, pay_mode = ?, "
...@@ -3088,15 +3157,19 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3088,15 +3157,19 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
succesString = succesString + "</br>Voucher No. " + miscPaymentTranID+"</br> Pay Amount:- "+payAmt+" Unconfirmed Pay Amount:- "+totUnconfAmt+" Net Payable Amount:- "+netPayable; succesString = succesString + "</br>Voucher No. " + miscPaymentTranID+"</br> Pay Amount:- "+payAmt+" Unconfirmed Pay Amount:- "+totUnconfAmt+" Net Payable Amount:- "+netPayable;
} }
confirmRetString = "";
confirmRetString = succesString+"</br>" + errorString;
errString = confirmRetString;
} }
confirmRetString = ""; /*confirmRetString = "";
confirmRetString = succesString+"\n" + errorString; confirmRetString = succesString+"</br>" + errorString;
errString = confirmRetString;*/
System.out.println("ALL TRANSACTION ---["+confirmRetString+"]"); System.out.println("ALL TRANSACTION ---["+confirmRetString+"]");
if("N".equalsIgnoreCase(autoPost) || "".equalsIgnoreCase(autoPost)) if("N".equalsIgnoreCase(autoPost) || "".equalsIgnoreCase(autoPost))
{ {
confirmRetString = ""; confirmRetString = "";
} }
/*errString = confirmRetString;*/
} }
} }
alreadyExist.clear(); alreadyExist.clear();
...@@ -3307,7 +3380,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3307,7 +3380,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
return retString; return retString;
} }
public String getErrorXML(String message,String messageValue,String errorId, String traceInfo) throws RemoteException,ITMException public String getErrorXML(String message,String messageValue,String errorId, String traceInfo ,String type) throws RemoteException,ITMException
{ {
System.out.println("getErrorXML.........."); System.out.println("getErrorXML..........");
String errString = ""; String errString = "";
...@@ -3316,7 +3389,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3316,7 +3389,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
errString = ""; errString = "";
StringBuffer valueXmlErrorString = new StringBuffer( "<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<Errors>\r\n" ); StringBuffer valueXmlErrorString = new StringBuffer( "<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<Errors>\r\n" );
valueXmlErrorString.append("<error id=\"").append(errorId).append("\" type=\"E\"").append(" column_name=\"description\"").append(">"); valueXmlErrorString.append("<error id=\"").append(errorId).append("\" type=\""+type+"\"").append(" column_name=\"description\"").append(">");
valueXmlErrorString.append("<message><![CDATA[").append(message).append("]]></message>\r\n"); valueXmlErrorString.append("<message><![CDATA[").append(message).append("]]></message>\r\n");
valueXmlErrorString.append("<description><![CDATA[").append(messageValue).append("]]></description>\r\n"); valueXmlErrorString.append("<description><![CDATA[").append(messageValue).append("]]></description>\r\n");
...@@ -3344,11 +3417,14 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3344,11 +3417,14 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
return errString; return errString;
} }
private String getTranId (String xmlString)throws ITMException private ArrayList<String> getTranId (String xmlString)throws ITMException
{ {
String tranId = ""; String tranId = "";
ArrayList<String> retList = null;
String errCode = "";
try try
{ {
retList = new ArrayList<>();
if (xmlString.indexOf("Success") > -1) if (xmlString.indexOf("Success") > -1)
{ {
System.out.println("Inside success"); System.out.println("Inside success");
...@@ -3356,12 +3432,22 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3356,12 +3432,22 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
if ( tranIdNode != null && tranIdNode.getFirstChild() != null) if ( tranIdNode != null && tranIdNode.getFirstChild() != null)
{ {
tranId = tranIdNode.getFirstChild().getNodeValue(); tranId = tranIdNode.getFirstChild().getNodeValue();
retList.add(tranId);
retList.add("NOERROR");
} }
System.out.println("miscPaymentTranID---["+tranId+"]"); System.out.println("miscPaymentTranID---["+tranId+"]");
} }
else else
{ {
tranId = ""; tranId = "ERROR";
Node tranIdNode = new E12GenericUtility().parseString( xmlString ).getElementsByTagName("error").item(0);
if ( tranIdNode != null && tranIdNode.getFirstChild() != null)
{
errCode = tranIdNode.getAttributes().getNamedItem("id").getNodeValue();
System.out.println("errCode from masterstatefull--["+errCode+"]");
retList.add(tranId);
retList.add(errCode);
}
} }
} }
catch(Exception e ) catch(Exception e )
...@@ -3370,7 +3456,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3370,7 +3456,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
return tranId; return retList;
} }
private NodeList getNodebyValue(Document doc, XPath xpath,String name,String columnName) private NodeList getNodebyValue(Document doc, XPath xpath,String name,String columnName)
{ {
...@@ -3455,17 +3541,17 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3455,17 +3541,17 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
String message = ""; String message = "";
String description = ""; String description = "";
String errId = ""; String errId = "";
String msgType = "";
int childNodeLength = 0; int childNodeLength = 0;
int ctr=0; int ctr=0;
try try
{ {
if(retXml.indexOf("<root>") != -1) if(retXml.indexOf("<root>") != -1 || retXml.indexOf("<Root>") != -1 )
{ {
System.out.println("Inside root condition......"); System.out.println("Inside root condition......");
genericUtility = new E12GenericUtility(); genericUtility = new E12GenericUtility();
Document errDom = genericUtility.parseString(retXml); Document errDom = genericUtility.parseString(retXml);
//message = errDom.getElementsByTagName("root");
parentNodeList = errDom.getElementsByTagName("root"); parentNodeList = errDom.getElementsByTagName("root");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
...@@ -3491,13 +3577,19 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3491,13 +3577,19 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
description = genericUtility.getColumnValue("description", errDom); description = genericUtility.getColumnValue("description", errDom);
System.out.println("description--["+description+"]"); System.out.println("description--["+description+"]");
} }
else if("error".equalsIgnoreCase(childNodeName))
{
msgType = childNode.getAttributes().getNamedItem("type").getNodeValue();
System.out.println("msgType--["+msgType+"]");
}
} }
retXml = getErrorXML(message, description, errId, ""); retXml = getErrorXML(message, description, errId, "",msgType);
System.out.println("retXml----[" + retXml + "]"); System.out.println("retXml----[" + retXml + "]");
} }
else else
{ {
retXml = getErrorXML("", retXml, "", ""); retXml = getErrorXML("", retXml, "", "","P");
} }
} }
...@@ -3509,4 +3601,22 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3509,4 +3601,22 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
return retXml; return retXml;
} }
private static void setNodeValue(Document dom, String nodeName,String nodeVal) throws Exception
{
Node tempNode = dom.getElementsByTagName(nodeName).item(0);
if (tempNode != null)
{
if (tempNode.getFirstChild() == null)
{
CDATASection cDataSection = dom.createCDATASection(nodeVal);
tempNode.appendChild(cDataSection);
}
else
{
tempNode.getFirstChild().setNodeValue(nodeVal);
}
}
tempNode = null;
}
} }
SET DEFINE OFF;
update system_events set service_code ='pr_default_2' ,comp_type ='WSR',comp_name ='nvo_bo_miscpay_auto' where obj_name ='miscpay_auto' and event_code ='process';
update system_events set service_code ='gd_default_1' ,comp_type ='WSR',comp_name ='nvo_bo_miscpay_auto' where obj_name ='miscpay_auto' and event_code ='get_data';
update system_events set service_code ='prv_default_1' ,comp_type ='WSR',comp_name ='nvo_bo_miscpay_auto' where obj_name ='miscpay_auto' and event_code ='pre_validate';
update system_events set service_code ='poic_default_1' ,comp_type ='WSR',comp_name ='nvo_bo_miscpay_auto' where obj_name ='miscpay_auto' and event_code ='post_item_change';
--ADDED BY ANJALI R. ON [23/AUG/2018][AUTOMATIC PAYMENT SYSTEM ENTRIES FOR EJB COMPONENT][START]
update system_events set service_code ='prc_miscpayauto' ,comp_type ='JB',comp_name ='ibase.webitm.ejb.fin.MiscPayAutoPrc' where obj_name ='miscpay_auto' and event_code ='process';
update system_events set service_code ='gd_default_2' ,comp_type ='JB',comp_name ='ibase.webitm.ejb.fin.MiscPayAutoPrc' where obj_name ='miscpay_auto' and event_code ='get_data';
update system_events set service_code ='prv_default_ejb' ,comp_type ='JB',comp_name ='ibase.webitm.ejb.fin.MiscPayAutoIC' where obj_name ='miscpay_auto' and event_code ='pre_validate';
update system_events set service_code ='poic_default_ejb' ,comp_type ='JB',comp_name ='ibase.webitm.ejb.fin.MiscPayAutoIC' where obj_name ='miscpay_auto' and event_code ='post_item_change';
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM)
values ('prc_miscpayauto','Action To process the Data','http://localhost/axis/services/ProcessService','Base Information','process','String','S',null,null,SYSDATE,'BASE','BASE');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',1,'COMPONENT_TYPE','I','Component Type','C.String',null,SYSDATE,'BASE','BASE ','JB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',2,'COMPONENT_NAME','I','Component Name','C.String',null,SYSDATE,'BASE','BASE ','ibase.webitm.ejb.fin.MiscPayAutoPrc');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',3,'XML_DATA_1','I','XML data of form no 1','S',null,SYSDATE,'BASE','BASE ',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',4,'XML_DATA_ALL','I','XML data of form no 1','S',null,SYSDATE,'BASE','BASE ',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',5,'OBJ_CONTEXT','I','Window Name','S',null,SYSDATE,'BASE','BASE ',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',6,'XTRA_PARAMS','I','Extra Arguments','S',null,SYSDATE,'BASE','BASE ',null);
COMMIT;
--ADDED BY ANJALI R. ON [23/AUG/2018][AUTOMATIC PAYMENT SYSTEM ENTRIES FOR EJB COMPONENT][END]
\ No newline at end of file
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