Commit 4c88c12b authored by msalla's avatar msalla

Fin charge not picking in bank receipt

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@214876 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 45f75014
......@@ -4276,13 +4276,13 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
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;
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;
rcpAmt =diffvalue ;
//System.out.println("total amt in else :::"+diffvalue+"...rcp amount in else"+rcpAmt);
//System.out.println("cheque amt 111+++"+(chequeAmt-(chequeAmt-totAmtdet)));
}//end
......@@ -4345,6 +4345,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
rs = null;
pstmt.close();
pstmt = null;
// System.out.println("rcpamount ["+rcpAmt+" ]transer ["+tranSer+" ] ctr"+ctr);
// if((tranSer == "S-INV") || (ctr == 1))commented by monika-30-july-2019
//added by monika salla-30-07-2019-
......@@ -4365,35 +4366,50 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
pstmt = null;
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom1));
if (tranDate.before(dueDate))
if (dueDate.before(tranDate))
{
days = (int)(dueDate.getTime() - tranDate.getTime()) / 361440000;
// days = (int)(dueDate.getTime() - tranDate.getTime()) / 361440000;//COMMENETED BY MONIKA ON 09 JAN 2019-TO SET DAYS DIFFERENCE THROUGH DaysAfterMETHOD
days=utl.DaysAfter(dueDate,tranDate);
if (days > 0)
{
sql = "select fchg_type,case when fin_chg is null then 0 else fin_chg end from crtermfc where (min_day <= ? and max_day >= ? ) and cr_term = ?";
sql = "select fchg_type,case when fin_chg is null then 0 else fin_chg end as fin_chg from crtermfc where (min_day <= ? and max_day >= ? ) and cr_term = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, days);
pstmt.setInt(2, days);
pstmt.setString(3, crTrem);
rs = pstmt.executeQuery();
if (rs.next())
if(rs.next())
{
finChg = rs.getDouble(1);
fchgType = rs.getString(2);
/*finChg = rs.getDouble(1);
fchgType = rs.getString(2);*///COMMENETD BY MONIKA 0N 09 JAN 2020-wrong type sepecified
fchgType = rs.getString("fchg_type");//ADDED BY MONIKA 0N 09 JAN 2020-
finChg = rs.getDouble("fin_chg");//END
if (finChg == 0.0D) finChg = 0.0D;
if (discountLc == 0.0D) discountLc = 0.0D;
if ("P".equals(fchgType))
if (finChg == 0.0D)
{
finChg = 0.0D;
}
if (discountLc == 0.0D)
{
discountLc = 0.0D;
}
// System.out.println("indise p fchgtype ["+fchgType+"] rcpAMOUNT ["+rcpAmt+"] finChg ["+finChg+"] DAYS["+days+"]");
if("P".equals(fchgType))
{
discountLc = rcpAmt * (finChg / 36500.0D) * days;
//System.out.println("discount lc "+discountLc);
}
else
{
// System.out.println("inside else disocunt"+discountLc);
discountLc = finChg;
}
discountLc = Math.round(discountLc) * -1L;
valueXmlString.append("<fin_chg>").append("<![CDATA[" + getReqDecimal(discountLc, 3) + "]]>").append("</fin_chg>");
// System.out.println("fin charges disocunt"+discountLc);
valueXmlString.append("<fin_chg>").append("<![CDATA[" + utl.getReqDecString(discountLc, 3) + "]]>").append("</fin_chg>");
}
rs.close();
rs = null;
......@@ -4418,7 +4434,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
NodeList detail1NList = null, detail2NList = null;
Node detail1Node = null;
String curDomDocKey = "", domDocKey = "";
String domLineNo = "", curDomLineNo = "";
String domLineNo = "", curDomLineNo = "",rcpAmtstr=null;
Node eachDetail2Node = null;
billDisc = "N";
......@@ -4534,11 +4550,24 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
rs = null;
pstmt.close();
pstmt = null;
rcpAmt = Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom));
// rcpAmt =Double.parseDouble(genericUtility.getColumnValue("rcp_amt", dom));commented by monika 9 jan 2020
rcpAmtstr =genericUtility.getColumnValue("rcp_amt", dom);//ADDED by monika 9 jan 2020-TO SET STRING TO DOUBLE
if(rcpAmtstr != null && rcpAmtstr.trim().length()>0)
{
rcpAmt=Double.parseDouble(rcpAmtstr);
}
else
{
rcpAmt=0;
}//END
//System.out.println("rcpamount ["+rcpAmt+" ]transer ["+refSer+" ] ctr"+ctr);
//if ((tranSer == "S-INV") || (ctr == 1))//commeneted by monika-30 july-19
//added by monika 30 july-19
if(("S-INV".equals(tranSer.trim())) || (ctr == 1))//end
//if(("S-INV".equals(tranSer.trim())) || (ctr == 1))//end//commented by monika 9 jan 2020 -no value for transer .IT SHOULD BE REFSER INSTEAD OF TRANSER
if(("S-INV".equals(refSer.trim())) || (ctr == 1))//ADDED BY MONIKA 0N 09 JAN 2020-
{
sql = "select due_date,cr_term from invoice where invoice_id = ?";
pstmt = conn.prepareStatement(sql);
......@@ -4553,14 +4582,17 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
rs = null;
pstmt.close();
pstmt = null;
// tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom));//COMMENETD BY MONIKA 0N 09 JAN 2020-TO TAKE VALUE FROM DOM1
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom1));//ADDED BY MONIKA 0N 09 JAN 2020-
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom));
if (tranDate.before(dueDate))
//System.out.println("tran_date ["+tranDate+"]duedate["+dueDate);//END
if (dueDate.before(tranDate))
{
days = (int)(dueDate.getTime() - tranDate.getTime()) / 361440000;
//days = (int)(dueDate.getTime() - tranDate.getTime()) / 361440000;//COMMENETD BY MONIKA 0N 09 JAN 2020- DAYS CALCULATED WRONGLY IT SHOULD BE CALCULATED BY USING DaysAfter METHOD
days=utl.DaysAfter(dueDate,tranDate);
if (days > 0)
{
sql = "select fchg_type,case when fin_chg is null then 0 else fin_chg end from crtermfc where (min_day <= ? and max_day >= ? ) and cr_term = ?";
sql = "select fchg_type,case when fin_chg is null then 0 else fin_chg end as fin_chg from crtermfc where (min_day <= ? and max_day >= ? ) and cr_term = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, days);
......@@ -4569,28 +4601,46 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
rs = pstmt.executeQuery();
if (rs.next())
{
finChg = rs.getDouble(1);
fchgType = rs.getString(2);
/*finChg = rs.getDouble(1);
fchgType = rs.getString(2);*///COMMENETD BY MONIKA 0N 09 JAN 2020-wrong type sepecified
fchgType = rs.getString("fchg_type");//ADDED BY MONIKA 0N 09 JAN 2020-
finChg = rs.getDouble("fin_chg");//END
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (finChg == 0.0D) finChg = 0.0D;
if (discountLc == 0.0D) discountLc = 0.0D;
if (finChg == 0.0D)
{
finChg = 0.0D;
}
if (discountLc == 0.0D)
{
discountLc = 0.0D;
}
//if (fchgType == "P")
//commeneted by monika-30 july-19
//added bt monika 30 july-19
if ("P".equals(fchgType))
// System.out.println("indise p2fchgtype ["+fchgType+"] rcpAMOUNT ["+rcpAmt+"] finChg ["+finChg+"] DAYS["+days+"]");
if("P".equals(fchgType))
{
// System.out.println("indise p11 fchgtype ["+fchgType+"] rcpAMOUNT ["+rcpAmt+"] finChg ["+finChg+"] DAYS["+days+"]");
discountLc = rcpAmt * (finChg / 36500.0D) * days;
// System.out.println("discount lc1 "+discountLc);
}
else
{
//System.out.println("indise else 1 fchgtype"+finChg);
discountLc = finChg;
//System.out.println("indise else 13 fchgtype"+discountLc);
}
discountLc = Math.round(discountLc) * -1L;
// System.out.println("indise discnt23e"+discountLc);
//valueXmlString.append("<fin_chg>").append("<![CDATA[" + getReqDecimal(discountLc, 3) + "]]>").append("</fin_chg>");
valueXmlString.append("<fin_chg>").append("<![CDATA[" + utl.getReqDecString(discountLc, 3) + "]]>").append("</fin_chg>"); // added by pavan rane on 02/aug/19
......
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