Commit de5623ec authored by msalla's avatar msalla

Unconfirmed PDC unable to edit

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@208877 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 988d2454
......@@ -159,7 +159,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String effBankStr = "", rcpacctAmt = "", tranDateStr = null;
String refType = "", guid = "", custbankref = null, tranid, tranidhdr, exchrate, amtStr;
String refType = "", guid = "", custbankref = null, tranid, tranidhdr, exchrate, amtStr,rcpNo=null,rfDateS;
String amountbc;
double advAmtd,confAmt = 0;
double rcpacctAmtdbl = 0, osamt = 0,amtbc,exrate;
......@@ -172,7 +172,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
conn = getConnection();
connDriver = null;
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
System.out.println("user ID form XtraParam : "+userId);
//System.out.println("user ID form XtraParam : "+userId);
loginSiteDescr = (genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
if(objContext != null && objContext.trim().length()>0)
......@@ -200,7 +200,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
tranDate = Timestamp.valueOf(genericUtility.getValidDateString(tranDateS,
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("trandate is :"+tranDate);
// System.out.println("trandate is :"+tranDate);
if (tranDate == null)
{
errCode = "VMTRANDT";
......@@ -213,7 +213,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
{
bankCodedep = this.genericUtility.getColumnValue("bank_code__dep", dom);
siteCode = this.genericUtility.getColumnValue("site_code", dom);
System.out.println("bank cpde:"+bankCodedep+" site code is: "+siteCode);
//System.out.println("bank cpde:"+bankCodedep+" site code is: "+siteCode);
if (bankCodedep != null && bankCodedep.trim().length() > 0)
{
//errCode = isBankCode(bankCodedep, siteCode, "FIN"); // done
......@@ -231,7 +231,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
{
sundryType = this.genericUtility.getColumnValue("sundry_type", dom);
System.out.println("sundry type:"+sundryType);
//System.out.println("sundry type:"+sundryType);
if (sundryType == null && sundryType.trim().length() == 0)
{
errCode = "VTSUNTYPE";
......@@ -259,15 +259,17 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
else if(childNodeName.equalsIgnoreCase("ref_no"))
{
System.out.println("this id ref no block");
//System.out.println("this id ref no block");
refNo = this.genericUtility.getColumnValue("ref_no", dom);
refSer = this.genericUtility.getColumnValue("ref_ser", dom);
custCode=this.genericUtility.getColumnValue("sundry_code", dom);
tranDateS = this.genericUtility.getColumnValue("tran_date", dom);
tranid = this.genericUtility.getColumnValue("tran_id", dom);
tranDate = Timestamp.valueOf(genericUtility.getValidDateString(tranDateS,
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
amount = this.genericUtility.getColumnValue("amount", dom);
System.out.println("ref no:"+refNo);
//System.out.println("ref no:"+refNo);
if(amount!= null && amount.trim().length()>0)
{
......@@ -280,9 +282,9 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
// for ref no duplicate value check--
if(refNo!= null && refNo.trim().length() > 0)
{
{ //COMMENETD BY MONIKA 03-10-2019 TO CHECK REF NO
//System.out.println("enter ref no is 1"+refNo);
sql = "select count(*) from pdc_received where ref_no=? and status not in ('X','P')";
/*sql = "select count(*) from pdc_received where ref_no=? and status not in ('X','P')";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refNo);
rs = pstmt.executeQuery();
......@@ -298,17 +300,39 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
System.out.println("@V@ pdc_received no count:- [" + cnt + "]");
if(cnt > 0 && tranid != null && tranid.trim().length() > 0)
{*///commented by monika
//Added by monika 3 oct 2019 TO CHECK DUPLICATE REF_NO REF NO
//sql = "select tran_id from receipt where ref_no=? and confirmed='Y'";
if(tranid != null && tranid.trim().length() > 0)
{
sql = "select tran_id from receipt where cust_code=? and ref_no=? and confirmed='Y'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, refNo);
rs = pstmt.executeQuery();
if(rs.next())
{
System.out.println("enter ref no is 1"+refNo);
tranIdRcp=checkNull(rs.getString("tran_id"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// System.out.println("@V@ Tran id receipt :- ["+tranIdRcp+"]");
// System.out.println("enter ref no is 1"+refNo);
sql = "select count(*) from rcpdishnr where receipt_no=? and tran_ser='R'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranid);
// pstmt.setString(1, tranid);
pstmt.setString(1, tranIdRcp);//end
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
System.out.println("@V@ pdc_received no count11:- [" + cnt + "]");
// System.out.println("@V@ pdc_received no count11:- [" + cnt + "]");
rs.close();
rs = null;
......@@ -321,40 +345,51 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
sql = "select count(*) from receipt where ref_no=? and tran_id <> ?";
/*sql = "select count(*) from receipt where ref_no=? and tran_id <> ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refNo);
pstmt.setString(2, tranid);
// pstmt.setString(2, tranid);
pstmt.setString(2, tranIdRcp);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
System.out.println("@V@ pdc_received no count22:- [" + cnt + "]");
System.out.println("@V@ pdc_received no count22:- [" + cnt + "]")
*/
sql = "select count(*) from pdc_received where ref_no=? and tran_id <> ? and status not in ('X','P')" ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refNo);
pstmt.setString(2,tranid);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// System.out.println("@V@ pdc_received no count22:- [" + cnt + "]");
if(cnt > 0)
{
System.out.println("@V@ received:- [" + cnt + "]");
//System.out.println("@V@ received:- [" + cnt + "]");
errCode = "VTPDCREC";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}//closing of tran_id if condition
}//closing is ref_no condition
}
}
}
else if(childNodeName.equalsIgnoreCase("curr_code"))
{
currCode = this.genericUtility.getColumnValue("curr_code",dom);
System.out.println("currCide is:::"+currCode);
//System.out.println("currCide is:::"+currCode);
if (currCode != null && currCode.trim().length() > 0)
{
sql = "select count(*) from currency where curr_code =?";
......@@ -376,7 +411,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
rs = null;
pstmt.close();
pstmt = null;
System.out.println("currcode..."+currCode);
//System.out.println("currcode..."+currCode);
}
else
{
......@@ -604,7 +639,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
valueXmlString.append("</Detail1>");
}
// close tag
System.out.println(" itemchanged case 1 valueXmlString : "+valueXmlString);
// System.out.println(" itemchanged case 1 valueXmlString : "+valueXmlString);
break;
case 2 :
......@@ -646,20 +681,20 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
else if(childNodeName.equalsIgnoreCase("ref_no"))
{
System.out.println("welcomne refno");
//System.out.println("welcomne refno");
refNo = this.genericUtility.getColumnValue("ref_no", dom);
refSer = this.genericUtility.getColumnValue("ref_ser", dom);
tranDateS = this.genericUtility.getColumnValue("tran_date", dom1);
System.out.println("trandate id 11:;:"+tranDateS);
//System.out.println("trandate id 11:;:"+tranDateS);
tranid = this.genericUtility.getColumnValue("tran_id", dom1);
tranDate = Timestamp.valueOf(genericUtility.getValidDateString(tranDateS,
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("trandate id :;:"+tranDate);
//System.out.println("trandate id :;:"+tranDate);
amount = this.genericUtility.getColumnValue("amount", dom);
System.out.println("hello amount"+amount);
//System.out.println("hello amount"+amount);
if(amount!= null && amount.trim().length()>0)
{
......@@ -670,7 +705,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
amt=0;
}
System.out.println("amount is==="+amt);
//System.out.println("amount is==="+amt);
sql = "select count(*), sum(tot_Amt - adj_amt) from receivables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
......@@ -688,7 +723,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
pstmt.close();
pstmt = null;
System.out.println("totamt::"+osamt);
// System.out.println("totamt::"+osamt);
if(cnt == 0)
{
......@@ -717,7 +752,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
{
confAmt=0;
}
System.out.println("confamount:::"+confAmt);
//System.out.println("confamount:::"+confAmt);
rs.close();
rs = null;
pstmt.close();
......@@ -746,7 +781,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
else if (childNodeName.trim().equalsIgnoreCase("exch_rate"))
{
exchrate = this.genericUtility.getColumnValue("exch_rate", dom);
System.out.println("ex rate::"+exchrate);
//System.out.println("ex rate::"+exchrate);
if (exchrate == null)
{
errCode = "VTINVEXR";
......@@ -758,7 +793,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
else if(childNodeName.equalsIgnoreCase("amount"))
{
amount = this.genericUtility.getColumnValue("amount", dom);
System.out.println("amount 111:"+amount);
//System.out.println("amount 111:"+amount);
if(amount != null && amount.trim().length()>0)
{
......@@ -769,7 +804,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
amt=0;
}
System.out.println("amount 112:"+amt);
//System.out.println("amount 112:"+amt);
refNo = this.genericUtility.getColumnValue("ref_no", dom);
htranId = this.genericUtility.getColumnValue("tran_id", dom1);
......@@ -786,7 +821,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
cnt = rs.getInt(1);
osamt = rs.getDouble(2);
}
System.out.println("amount in detail 2:"+osamt);
//System.out.println("amount in detail 2:"+osamt);
rs.close();
rs = null;
pstmt.close();
......@@ -867,7 +902,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
amountbc =this.genericUtility.getColumnValue("amount__bc", dom);
refSer = this.genericUtility.getColumnValue("ref_ser", dom);
refNo = this.genericUtility.getColumnValue("ref_no", dom);
System.out.println("amount is:::"+amountbc);
//System.out.println("amount is:::"+amountbc);
sql = "select count(*),sum(tot_Amt - adj_amt) from receivables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
......@@ -892,7 +927,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
{
amtbc=0;
}
System.out.println("amount is 222:::"+amountbc);
//System.out.println("amount is 222:::"+amountbc);
if (amtbc < 0 && osamt > 0)
{
errCode = "VMAMT";
......@@ -914,23 +949,23 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
errListSize = errList.size();
cnt = 0;
String errFldName = null;
System.out.println("errListSize [" + errListSize + "] errFields size [" + errFields.size() + "]");
//System.out.println("errListSize [" + errListSize + "] errFields size [" + errFields.size() + "]");
if ((errList != null) && (errListSize > 0))
{
for (cnt = 0; cnt < errListSize; cnt++)
{
errCode = (String)errList.get(cnt);
System.out.println("errCode :"+errCode);
//System.out.println("errCode :"+errCode);
int pos = errCode.indexOf("~");
System.out.println("pos :"+pos);
//System.out.println("pos :"+pos);
if(pos>-1)
{
errCode=errCode.substring(0,pos);
}
System.out.println("error code is :"+errCode);
//System.out.println("error code is :"+errCode);
errFldName = (String)errFields.get(cnt);
System.out.println(" cnt [" + cnt + "] errCode [" + errCode + "] errFldName [" + errFldName + "]");
// System.out.println(" cnt [" + cnt + "] errCode [" + errCode + "] errFldName [" + errFldName + "]");
errString = getErrorString(errFldName, errCode, userId);
errorType = errorType(conn, errCode);
if (errString.length() > 0)
......@@ -960,7 +995,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception ::"+ e.getMessage());
//System.out.println("Exception ::"+ e.getMessage());
throw new ITMException(e);
}
finally
......@@ -990,8 +1025,8 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
}
}// end of finally statement
return errStringXml.toString();
}
public String itemChanged(String xmlString, String xmlString1, String objContext,
}
public String itemChanged(String xmlString, String xmlString1, String objContext,
String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException {
String errString = "";
Document dom = null;
......@@ -999,7 +1034,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
Document domAll = null;
String retString = "";
try {
System.out.println("************** Inside itemChanged method ****************");
//System.out.println("************** Inside itemChanged method ****************");
if (xmlString != null && xmlString.trim().length() > 0) {
dom = genericUtility.parseString(xmlString);
}
......@@ -1008,17 +1043,17 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
}
retString = itemChanged(dom, domhr, objContext, currentColumn, editFlag, xtraParams);
System.out.println("retString::::::::::" + retString);
// System.out.println("retString::::::::::" + retString);
} catch (Exception e) {
System.out.println(":::" + getClass().getSimpleName() + "::" + e.getMessage());
//System.out.println(":::" + getClass().getSimpleName() + "::" + e.getMessage());
e.getMessage();
}
return retString;
}
}
public String itemChanged(Document dom, Document dom1, String objContext, String currentColumn,
public String itemChanged(Document dom, Document dom1, String objContext, String currentColumn,
String editFlag, String xtraParams) throws RemoteException, ITMException
{
{
Connection conn = null;
// Added by sarita on 01/06/2017
ConnDriver connDriver = null;
......@@ -1089,7 +1124,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
System.out.println("first receipt mode ------>"+genericUtility.getColumnValue("rcp_mode", dom));
// System.out.println("first receipt mode ------>"+genericUtility.getColumnValue("rcp_mode", dom));
do
{
childNode = childNodeList.item(ctr);
......@@ -1171,7 +1206,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
pstmt.close();
pstmt = null;
System.out.println("site_code::::"+descr1+" finentity:::"+finent+"bancode:::"+bankcode);
//System.out.println("site_code::::"+descr1+" finentity:::"+finent+"bancode:::"+bankcode);
valueXmlString.append("<site_descr>").append("<![CDATA[" + descr1 + "]]>").append("</site_descr>");
......@@ -1204,12 +1239,12 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
pstmt.close();
pstmt = null;
System.out.println("curr_code11::::"+mcurr);
//System.out.println("curr_code11::::"+mcurr);
valueXmlString.append("<bank_code__dep>").append("<![CDATA[" + bankcode + "]]>").append("</bank_code__dep>");
valueXmlString.append("<bank_name>").append("<![CDATA[" + bankdescr + "]]>").append("</bank_name>");
valueXmlString.append("<curr_code>").append("<![CDATA[" + mcurr + "]]>").append("</curr_code>");
System.out.println("currency..."+mcurr);
//System.out.println("currency..."+mcurr);
}
......@@ -1449,7 +1484,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
valueXmlString.append("<acct_code__adv>").append("<![CDATA[" + acctCodeAdv + "]]>").append("</acct_code__adv>");
valueXmlString.append("<cctr_code__adv>").append("<![CDATA[" + cctrCodeAdv + "]]>").append("</cctr_code__adv>");
System.out.println("currency code2---"+currCode);
// System.out.println("currency code2---"+currCode);
if ((loginSite == null || loginSite.trim().length() == 0) && sitecode.trim().length() > 0)
{
valueXmlString.append("<site_code>").append("<![CDATA[" + sitecode + "]]>").append("</site_code>");
......@@ -1531,7 +1566,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
childNodeListLength = childNodeList.getLength();
System.out.println("currentColumn-------->>[" + currentColumn + "]");
//System.out.println("currentColumn-------->>[" + currentColumn + "]");
valueXmlString.append("<Detail2>");
if ("itm_default".equalsIgnoreCase(currentColumn.trim()))
{
......@@ -1597,7 +1632,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
sql = "select descr from currency where curr_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode);
System.out.println("test2 currncy"+currCode);
// System.out.println("test2 currncy"+currCode);
rs = pstmt.executeQuery();
if (rs.next())
{
......@@ -1607,13 +1642,13 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
rs = null;
pstmt.close();
pstmt = null;
/* Changed by -monika-8 aug-2019
/* Changed by -monika-8 aug-2019
if(adjAmt == 0)
{
amt= totAmt - adjAmt;
adjAmtBc = amt* exrate;
}
*/
*/
amt= totAmt - adjAmt;
adjAmtBc = amt* exrate;
valueXmlString.append("<curr_code>").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
......@@ -1651,7 +1686,7 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
exrate=0;
}
amtBc= amt * exrate;
System.out.println("adjamt::"+amtBc);
//System.out.println("adjamt::"+amtBc);
valueXmlString.append("<amount__bc>").append("<![CDATA[" +amtBc + "]]>").append("</amount__bc>");
}
valueXmlString.append("</Detail2>");
......@@ -1687,9 +1722,9 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
}
}
return valueXmlString.toString();
}
}
private String errorType(Connection conn, String errorCode) throws ITMException {
private String errorType(Connection conn, String errorCode) throws ITMException {
String msgType = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
......@@ -1727,13 +1762,13 @@ public class PdcReceivedIC extends ValidatorEJB implements PdcReceivedRemote, Pd
}
}
return msgType;
}
}
private double checkDouble(String input) {
private double checkDouble(String input) {
if (input == null || input.trim().length() == 0) {
return 0;
} else {
return Double.parseDouble(input);
}
}
}
}
\ 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