Commit 34b7cea5 authored by spawar's avatar spawar

Added Changes for reverse tax calculation based on tax_chap, tax_env and tax_class


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100200 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 213cb5bf
...@@ -38,6 +38,8 @@ import org.w3c.dom.NodeList; ...@@ -38,6 +38,8 @@ import org.w3c.dom.NodeList;
public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote, DDPorderWizEJBLocal public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote, DDPorderWizEJBLocal
{ {
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
//Changed by samadhan for round off
DistCommon distComm = new DistCommon();
@Override @Override
public String wfValData(String xmlString, String xmlString1, public String wfValData(String xmlString, String xmlString1,
String xmlString2, String objContext, String editFlag, String xmlString2, String objContext, String editFlag,
...@@ -1113,6 +1115,7 @@ public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote ...@@ -1113,6 +1115,7 @@ public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote
exchRate = checkNullAndTrim(rs2.getString("EXCH_RATE__BUY")); exchRate = checkNullAndTrim(rs2.getString("EXCH_RATE__BUY"));
}*/ }*/
//Changed by manish on 21/01/16 for setting Exchange Rate from FinnCommon [start]
java.util.Date currDate = new java.util.Date(); java.util.Date currDate = new java.util.Date();
String currDateStr = dateFormat.format(currDate); String currDateStr = dateFormat.format(currDate);
System.out.println("TODAY IS="+currDateStr); System.out.println("TODAY IS="+currDateStr);
...@@ -1148,6 +1151,7 @@ public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote ...@@ -1148,6 +1151,7 @@ public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote
//conn2.close(); conn2 = null; //conn2.close(); conn2 = null;
System.out.println("Exchange Rate is="+exchRate); System.out.println("Exchange Rate is="+exchRate);
//Changed by manish on 21/01/16 for setting Exchange Rate from FinnCommon [end]
} }
}//end supp_code }//end supp_code
...@@ -1612,6 +1616,9 @@ public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote ...@@ -1612,6 +1616,9 @@ public class DDPorderWizEJB extends ValidatorEJB implements DDPorderWizEJBRemote
} }
System.out.println("Final Rate CLG="+rateClg); System.out.println("Final Rate CLG="+rateClg);
amount= quan * rate; amount= quan * rate;
System.out.println("Actual Amount:"+amount);
//Changed by samadhan for rounding amount
amount = distComm.getRndamt(amount, "R", 0.01);
lineNoOrd = " " + ctr; lineNoOrd = " " + ctr;
lineNoOrd = lineNoOrd.substring( lineNoOrd.length()-3 ); lineNoOrd = lineNoOrd.substring( lineNoOrd.length()-3 );
......
...@@ -591,9 +591,24 @@ public class DDPorderWizPosEJB extends ValidatorEJB implements DDPorderWizPosEJB ...@@ -591,9 +591,24 @@ public class DDPorderWizPosEJB extends ValidatorEJB implements DDPorderWizPosEJB
//sql1 = "select rate from taxrate where tax_set in (select tax_set from taxset where tax_code in " + //sql1 = "select rate from taxrate where tax_set in (select tax_set from taxset where tax_code in " +
// "(select tax_code from tenvseq where tax_env = ? ))"; // "(select tax_code from tenvseq where tax_env = ? ))";
sql1 = "select rate from taxrate where tax_set = ?"; //Changed by samadhan on 15/02/2016 for tax rate calculation start
// sql1 = "select rate from taxrate where tax_set = ?";
// pstmt1 = conn.prepareStatement(sql1);
// pstmt1.setString(1, taxEnv);
sql1 = "select a.rate from taxrate a, taxset b,tax c where a.tax_set in " +
"(select tax_set from taxset where tax_code in " +
"(select tax_code from tenvseq where TAX_ENV = ?) AND TAX_CLASS = ? " +
"AND TAX_CHAP = ? ) and a.Tax_set=b.tax_set and b.tax_code = c.tax_code " +
"and c.tax_type= ? and ? between b.eff_from and b.valid_upto ";
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, taxEnv); pstmt1.setString(1, taxEnv);
pstmt1.setString(2, taxClass);
pstmt1.setString(3, taxChap);
pstmt1.setString(4, "S");
pstmt1.setTimestamp(5, java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(ordDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
//Changed by samadhan on 15/02/2016 for tax rate calculation end
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if( rs1.next() ) if( rs1.next() )
{ {
...@@ -603,7 +618,9 @@ public class DDPorderWizPosEJB extends ValidatorEJB implements DDPorderWizPosEJB ...@@ -603,7 +618,9 @@ public class DDPorderWizPosEJB extends ValidatorEJB implements DDPorderWizPosEJB
rs1.close(); rs1.close();
pstmt1.close(); pstmt1.close();
System.out.println("Rate with tax:= "+rate); System.out.println("Rate with tax:= "+rate);
rateWithOutTax = Double.valueOf(String.format("%.3f", (rate*100)/(100+taxRate))); //rateWithOutTax = Double.valueOf(String.format("%.3f", (rate*100)/(100+taxRate)));
rateWithOutTax = (rate*100)/(100+taxRate);
rateWithOutTax = distComm.getRndamt(rateWithOutTax, "R", 0.001);
System.out.println("Rate without tax:= "+rateWithOutTax); System.out.println("Rate without tax:= "+rateWithOutTax);
//Changed by Samadhan on 25/06/2015 D15CKAT025 End //Changed by Samadhan on 25/06/2015 D15CKAT025 End
......
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