Commit 5ee4f752 authored by msalla's avatar msalla

1)In bank receipt if the header amount of Amount receipt is less than the...

1)In bank receipt if the header amount of Amount receipt is less than the amount of selected invoice in detail then system should update the header amount in the detail receipt amount.

2)In bank reconcilation entry -  vision software does not Pop-up the error window if the entries do not match with consolidated amount whereas the Base software was throwing the Error window (Example: if a consolidation amount of a cheque is Rs.50,000 and therein 5 transactions are involved, and if the aggregate of said 5 transactions exceeds or low then the Vision software does not throw Error Window whereas the Base was doing.

3)Validation for Item_Ser to be added in Bank receipt.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@207277 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1b3800c9
......@@ -10,6 +10,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import javax.ejb.Stateless;
......@@ -19,6 +20,8 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.itextpdf.text.log.SysoCounter;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
......@@ -153,6 +156,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
double totAmt = 0.0D;
double pendingAmt = 0.0D;
double adjAmt = 0.0D;
double chqAmount=0.0D;
Timestamp rfDate=null,today = null;
String tranIdHdr=null,advBkId=null,currCodeHdr=null,chaqueAmtStr=null,exchRatestr=null,amt=null,amountBcStr=null,diffAmtBcStr=null;
int ctr = 0;
......@@ -160,6 +164,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
int cnt = 0;
int crt = 0;
int Idays = 0;
String itemSer=null;
java.util.Date tranDate = null;
java.util.Date effDate = null;
java.util.Date refDate = null;
......@@ -178,7 +183,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String effBankStr="",rcpacctAmt="";
String refType = "",guid = "";
String refType = "",guid = "",chqAmt;
double rcpacctAmtdbl=0;
//Calendar currentDate = Calendar.getInstance();--by monika
......@@ -203,7 +208,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
//start manish
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
today = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0");
//end
//end
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDate = sdf.format(currentDate.getTime());
......@@ -1116,6 +1121,35 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
}
}
}
// Added by PriyankaC item_ser validation on 11Sep2019[Start]
else if (childNodeName.equalsIgnoreCase("item_ser"))
{
itemSer= this.genericUtility.getColumnValue("item_ser",dom);
if(itemSer!= null && itemSer.trim().length() > 0)
{
sql = "select count(*) from ITEMSER where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSer);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
if(cnt == 0)
{
errCode = "INVIEMSER";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
// Added by PriyankaC item_ser validation.11Sep2019[END]
/**
* VALLABH KADAM [01/OCT/15]
* END
......@@ -1130,6 +1164,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail2>");
childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
......@@ -1453,6 +1488,16 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
refNo = this.genericUtility.getColumnValue("ref_no", dom);
refSer = this.genericUtility.getColumnValue("ref_ser", dom);
lineNoRef = this.genericUtility.getColumnValue("line_no__ref", dom);
//added by monika-04 sept 2019
chqAmt=this.genericUtility.getColumnValue("chq_amt", dom1);
if(chqAmt != null && chqAmt.trim().length()>0)
{
chqAmount=Double.parseDouble(chqAmt);
}
else
{
chqAmount=0;
}
if (rcpAmt == 0.0D)
{
errCode = "VTRCAMT";
......@@ -1544,12 +1589,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
}
}
//added by akhilesh on 31/july/13 for tax provision
else if(childNodeName.equalsIgnoreCase("tax_class"))
{
taxClass = checkNull(genericUtility.getColumnValue("tax_class", dom));
......@@ -2976,6 +3020,15 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
PreparedStatement pstmt = null;
String hCurrCode = "",reStr="";
ResultSet rs = null;
String itemValue = "",lineNo = "",lineValue= "",updateFlag = "", invTrace = " ",rcpdetamt="";
int lineNoInt = 0,lineValueInt = 0;
//NodeList itemNodeList = null,lineNoList = null,detail2List = null,childDetilList = null;
//Node itemNode = null,lineNoNode = null,detailNode = null,chidDetailNode = null;
NodeList itemNodeList = null,lineNoList = null,detail2List = null,childDetilList = null; //Variables added by Mahesh Saggam on 17-June-2019
Node itemNode = null,lineNoNode = null,detailNode = null,chidDetailNode = null; //Variables added by Mahesh Saggam on 17-June-2019
double rcpdetAmount=0.0,totAmtdet=0.0,diffvalue=0.0;
// GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
UtilMethods utl = new UtilMethods();
......@@ -3777,6 +3830,8 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
billDisc = "N";
refNo = genericUtility.getColumnValue("ref_no", dom);
refSer = genericUtility.getColumnValue("ref_ser", dom);
//added by monika 10 sept 2019
chequeAmt = doublevalue(genericUtility.getColumnValue("chq_amt", dom1));
sql = "select count(*) from receivables where tran_ser = ? and ref_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refSer);
......@@ -3954,20 +4009,95 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
valueXmlString.append("<bad_debt_amt>").append("<![CDATA[" + utl.getReqDecString(badDebtAmt, 3) + "]]>").append("</bad_debt_amt>");
advAmt = doublevalue(genericUtility.getColumnValue("adv_amt", dom1));
Double diffvalue = Double.valueOf(totAmt - adjAmt);
if((advAmt < diffvalue.doubleValue()) && (advAmt != 0.0) && (Sing(advAmt) == Sing(diffvalue.doubleValue())))
diffvalue = Double.valueOf(totAmt - adjAmt);
// if((advAmt < diffvalue.doubleValue()) && (advAmt != 0.0) && (Sing(advAmt) == Sing(diffvalue.doubleValue())))
if((advAmt < diffvalue) && (advAmt != 0.0) && (Sing(advAmt) == Sing(diffvalue)))
{
//valueXmlString.append("<rcp_amt>").append("<![CDATA[" + getReqDecimal(advAmt, 3) + "]]>").append("</rcp_amt>");
valueXmlString.append("<rcp_amt>").append("<![CDATA[" + utl.getReqDecString(advAmt, 3) + "]]>").append("</rcp_amt>"); // added by pavan rane on 02/aug/19
rcpAmt = advAmt;
System.out.println("Rcp Amt if(advAmt < diffvalue)"+ rcpAmt);
//System.out.println("Rcp Amt if(advAmt < diffvalue)"+ rcpAmt);
}
else
{
System.out.println("Rcp Amt from else" + rcpAmt);
/*System.out.println("Rcp Amt from else" + rcpAmt);
//valueXmlString.append("<rcp_amt>").append("<![CDATA[" + getReqDecimal((totAmt - adjAmt), 3) + "]]>").append("</rcp_amt>");
valueXmlString.append("<rcp_amt>").append("<![CDATA[" + utl.getReqDecString(((totAmt - adjAmt)), 3) + "]]>").append("</rcp_amt>"); // added by pavan rane on 02/aug/19
rcpAmt = totAmt - adjAmt;
}*/ //commented by monika 10 sept 2019
//ADDED BY MONIKA 10 SEPT 2019-TO CHECK HEADER AMOUNT WITH DETAIL AMOUNT
childNodeListLength = childNodeList.getLength();
detail2List = dom2.getElementsByTagName("Detail2");
lineNo = genericUtility.getColumnValue("line_no",dom);
// System.out.println("Detail 2 List "+detail2List);
//System.out.println("DOM2 in case 1 ----->>["+genericUtility.serializeDom(dom2).toString()+"]");
if(lineNo != null && lineNo.trim().length() > 0)
{
//System.out.println("line no::::"+lineNo);
lineNoInt = Integer.parseInt(lineNo.trim());
}
for(int t =0; t < detail2List.getLength(); t++ )
{
detailNode = detail2List.item(t);
childDetilList = detailNode.getChildNodes();
for(int p =0; p < childDetilList.getLength(); p++ )
{
chidDetailNode = childDetilList.item(p);
// System.out.println("current child node>>>>>>>>>> " + chidDetailNode.getNodeName() );
if(chidDetailNode.getNodeName().equalsIgnoreCase("line_no") )
{
//System.out.println("line node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
lineValue = chidDetailNode.getFirstChild().getNodeValue();
if(lineValue != null && lineValue.trim().length() > 0)
{
lineValueInt = Integer.parseInt(lineValue.trim());
}
//System.out.println("current child line value node>>>>>>>>>> "+lineValueInt);
}
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("attribute") )
{
//System.out.println("operation node found >>>>>" + chidDetailNode.getNodeName());
updateFlag = chidDetailNode.getAttributes().getNamedItem("updateFlag").getNodeValue();
// System.out.println("Update flag is......."+updateFlag);
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("rcp_amt") )
{
//System.out.println("invoiceTrace node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
rcpdetamt = chidDetailNode.getFirstChild().getNodeValue();
if(rcpdetamt != null && rcpdetamt.trim().length() > 0)
{
rcpdetAmount = Double.parseDouble(rcpdetamt.trim());
}
if(!updateFlag.equalsIgnoreCase("D") && lineNoInt != lineValueInt)
{
totAmtdet=totAmtdet+rcpdetAmount;
}
}
}
}
}
//System.out.println("diffvalue:::]]]"+diffvalue+" CHEQUE AMOUNT:::]]]"+chequeAmt+" TOTAMT]]]]"+totAmtdet);
if(diffvalue>(chequeAmt-totAmtdet))
{
valueXmlString.append("<rcp_amt>").append("<![CDATA[" + utl.getReqDecString((chequeAmt-totAmtdet), 3) + "]]>").append("</rcp_amt>"); // added by pavan rane on 02/aug/19
//rcpAmt =chequeAmt-totAmtdet;
//System.out.println("total amt in if...:::"+(chequeAmt-totAmtdet)+"...rcpAmt in if--"+rcpAmt);
}
else
{
valueXmlString.append("<rcp_amt>").append("<![CDATA[" + utl.getReqDecString((diffvalue), 3) + "]]>").append("</rcp_amt>"); // added by pavan rane on 02/aug/19
//rcpAmt = chequeAmt-totAmtdet;
//System.out.println("total amt in else :::"+diffvalue+"...rcp amount in else"+rcpAmt);
//System.out.println("cheque amt 111+++"+(chequeAmt-(chequeAmt-totAmtdet)));
}//end
chequeAmt=chequeAmt-totAmtdet;//END
}
valueXmlString.append("<acct_code__ar>").append("<![CDATA[" + acctCode + "]]>").append("</acct_code__ar>");
valueXmlString.append("<accounts_descr>").append("<![CDATA[" + accDescr + "]]>").append("</accounts_descr>");
......@@ -3984,7 +4114,6 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
//diffAmtExch = (rcpAmt * exchRate - rcpAmt * discExchRate)-((Double.parseDouble(lcBillDescAmt) * exchRate) - (Double.parseDouble(lcBillDescAmt) * discExchRate));
diffAmtExch = (rcpAmt * exchRate - rcpAmt * discExchRate)+((Double.parseDouble(lcBillDescAmt)-rcpAmt)*(exchRate-discExchRate));//Changed by Manoj dtd 22/08/2014 to Consider Bill Discount Exchrate difference
// valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>");
valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + utl.getReqDecString(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>"); // added by pavan rane on 02/aug/19
}
else
......@@ -3993,8 +4122,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
//valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>");
valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + utl.getReqDecString(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>"); // added by pavan rane on 02/aug/19
}
System.out.println("rcpAmt["+rcpAmt+"]exchRate["+exchRate+"]discExchRate["+discExchRate+"]diffAmtExch["+diffAmtExch+"]");
//System.out.println("rcpAmt["+rcpAmt+"]exchRate["+exchRate+"]discExchRate["+discExchRate+"]diffAmtExch["+diffAmtExch+"]");
valueXmlString.append("<site_code protect = \"1\" >").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
valueXmlString.append("<cust_code protect = \"1\">").append("<![CDATA[" + custCode + "]]>").append("</cust_code>");
valueXmlString.append("<curr_code protect = \"1\" >").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
......@@ -4085,12 +4213,27 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
}
}
}
}
else if ((currentColumn.trim().equalsIgnoreCase("exch_rate")) || (currentColumn.trim().equalsIgnoreCase("rcp_amt")))
{
//added by monika
double totDomAmt = 0.0, dDomQty = 0.0,hdrAmtdb=0.0,domAmountdb=0.0;
HashMap<String, String> curDomDataHMap= new HashMap<String, String>();
String curDomCustCode = "", curDomRefSer = "", curDomLotNo = "", hdrAmt="",curDomSiteCode = "", curDomInvoiceId = "";
double balAmt=0.0;
String domCustCode = "", domRefSer = "", domLotNo = "", domSiteCode = "", domAmount = "", domInvoiceId = "";
NodeList detail1NList = null, detail2NList = null;
Node detail1Node = null;
String curDomDocKey = "", domDocKey = "";
String domLineNo = "", curDomLineNo = "";
Node eachDetail2Node = null;
billDisc = "N";
refNo = genericUtility.getColumnValue("ref_no", dom);
refSer = genericUtility.getColumnValue("ref_ser", dom);
hdrAmtdb= Double.parseDouble(genericUtility.getColumnValue("chq_amt", dom1));
rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom));
sql = "select bill_disc FROM receivables where tran_ser = ? and ref_no = ?";
......@@ -4254,6 +4397,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
}
}
}
}
valueXmlString.append("</Detail2>");
......@@ -4556,8 +4700,10 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{
valueXmlString.append("<exch_rate protect = \"0\">").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate>");
}
int lineNo= Integer.parseInt(genericUtility.getColumnValue("line_no", dom));
if(lineNo > 0)
//int lineNo= Integer.parseInt(genericUtility.getColumnValue("line_no", dom));
int lineNoint= Integer.parseInt(genericUtility.getColumnValue("line_no", dom));
if(lineNoint > 0)
{
deteditflag = "E";
}
......
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