From 173807f2f48466b20aacfc052a8c2ee8530437e0 Mon Sep 17 00:00:00 2001 From: xiezhiwen Date: Mon, 13 Aug 2018 21:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=AD=E8=AF=812018/08/13=E7=A7=91=E7=9B=AE?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContractOtherMoneyNoTax.java | 43 +++++++++++++++++++ ...Just.java => ContractOtherMoneyToTax.java} | 22 +++++++--- .../FirstPaymentToTaxToJust.java | 28 ------------ .../CreateVoucherLoan/OtherFees.java | 2 +- 4 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractOtherMoneyNoTax.java rename src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/{ContractCapitalToTaxToJust.java => ContractOtherMoneyToTax.java} (55%) delete mode 100644 src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/FirstPaymentToTaxToJust.java diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractOtherMoneyNoTax.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractOtherMoneyNoTax.java new file mode 100644 index 000000000..8f7ff2843 --- /dev/null +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractOtherMoneyNoTax.java @@ -0,0 +1,43 @@ +package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoan; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.comm.exception.BusinessException; +import com.tenwa.voucher.service.VoucherJavaParamService; +/** + * 其他(购置税/保险/装饰装潢等)(不含税)+GPS(不含税) + * @author xiezhiwen + */ +public class ContractOtherMoneyNoTax implements VoucherJavaParamService{ + + @Override + public Map getJavaParam(JBOTransaction tx, + Map param) throws BusinessException { + MapreturnValue=new HashMap(); + returnValue.putAll(param); + // 保险费 + String INSURANCE_PREMIUM=param.get("INSURANCE_PREMIUM")==null?"0.00":param.get("INSURANCE_PREMIUM"); + // 购置税 + String PURCHASE_TAX=param.get("PURCHASE_TAX")==null?"0.00":param.get("PURCHASE_TAX"); + // 杂费 + String INCIDENTAL=param.get("INCIDENTAL")==null?"0.00":param.get("INCIDENTAL"); + // 装潢费 + String TABLEWARE_FEE=param.get("TABLEWARE_FEE")==null?"0.00":param.get("TABLEWARE_FEE"); + // GPS + String GPS_FEE_FINANCE=param.get("GPS_FEE_FINANCE")==null?"0.00":param.get("GPS_FEE_FINANCE"); + BigDecimal sumMoney=new BigDecimal(INSURANCE_PREMIUM) + .add(new BigDecimal(PURCHASE_TAX)) + .add(new BigDecimal(INCIDENTAL)) + .add(new BigDecimal(TABLEWARE_FEE)) + .add(new BigDecimal(GPS_FEE_FINANCE)); + + String tax="1.06"; + BigDecimal divisor= new BigDecimal(tax); + BigDecimal factmoney=sumMoney.divide(divisor, 2, BigDecimal.ROUND_HALF_UP); + returnValue.put("MONEY",factmoney.toString()); + return returnValue; + } +} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractCapitalToTaxToJust.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractOtherMoneyToTax.java similarity index 55% rename from src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractCapitalToTaxToJust.java rename to src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractOtherMoneyToTax.java index 0754e365c..2ffd00033 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractCapitalToTaxToJust.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/ContractOtherMoneyToTax.java @@ -8,19 +8,31 @@ import com.amarsoft.are.jbo.JBOTransaction; import com.tenwa.comm.exception.BusinessException; import com.tenwa.voucher.service.VoucherJavaParamService; /** - * 车款-首付款的税金 + * 本金的税金(车款-首付款+其他+GPS的税金) * @author xiezhiwen */ -public class ContractCapitalToTaxToJust implements VoucherJavaParamService{ +public class ContractOtherMoneyToTax implements VoucherJavaParamService{ public Map getJavaParam(JBOTransaction tx,Map param) throws BusinessException { MapreturnValue=new HashMap(); returnValue.putAll(param); - String FIRST_PAYMENT=param.get("FIRST_PAYMENT")==null?"0.00":param.get("FIRST_PAYMENT"); + // 车款 String EQUIP_AMT=param.get("EQUIP_AMT")==null?"0.00":param.get("EQUIP_AMT"); + // 首付款 + String FIRST_PAYMENT=param.get("FIRST_PAYMENT")==null?"0.00":param.get("FIRST_PAYMENT"); + // 杂费 + String INCIDENTAL=param.get("INCIDENTAL")==null?"0.00":param.get("INCIDENTAL"); + // GPS + String GPS_FEE_FINANCE=param.get("GPS_FEE_FINANCE")==null?"0.00":param.get("GPS_FEE_FINANCE"); + BigDecimal sumMoney=new BigDecimal(EQUIP_AMT) + .subtract(new BigDecimal(FIRST_PAYMENT)) + .add(new BigDecimal(INCIDENTAL)) + .add(new BigDecimal(GPS_FEE_FINANCE)); + String tax="1.06"; BigDecimal divisor= new BigDecimal(tax); - BigDecimal sumMoney=new BigDecimal(EQUIP_AMT).subtract(new BigDecimal(FIRST_PAYMENT)); - BigDecimal taxMoney=sumMoney.subtract(sumMoney.divide(divisor, 2, BigDecimal.ROUND_HALF_UP)); + BigDecimal noTaxMoney=sumMoney.divide(divisor, 2, BigDecimal.ROUND_HALF_UP); + BigDecimal taxMoney = sumMoney.subtract(noTaxMoney); + returnValue.put("FUNDTYPE","01"); returnValue.put("MONEY",taxMoney.toString()); return returnValue; diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/FirstPaymentToTaxToJust.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/FirstPaymentToTaxToJust.java deleted file mode 100644 index 4ff052b47..000000000 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/FirstPaymentToTaxToJust.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.tenwa.voucher.CreateVoucherProcess.CreateVoucherLoan; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; - -import com.amarsoft.are.jbo.JBOTransaction; -import com.tenwa.comm.exception.BusinessException; -import com.tenwa.voucher.service.VoucherJavaParamService; -/** - * 获取首付款的税金 - * @author xiezhiwen - */ -public class FirstPaymentToTaxToJust implements VoucherJavaParamService{ - - @Override - public Map getJavaParam(JBOTransaction tx, - Map param) throws BusinessException { - MapreturnValue=new HashMap(); - returnValue.putAll(param); - String FIRST_PAYMENT=param.get("FIRST_PAYMENT")==null?"0.00":param.get("FIRST_PAYMENT"); - String tax="1.06"; - BigDecimal divisor= new BigDecimal(tax); - BigDecimal factmoney=new BigDecimal(FIRST_PAYMENT).subtract(new BigDecimal(FIRST_PAYMENT).divide(divisor, 2, BigDecimal.ROUND_HALF_UP)); - returnValue.put("MONEY",factmoney.toString()); - return returnValue; - } -} diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/OtherFees.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/OtherFees.java index 4dad7805e..d4ce07279 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/OtherFees.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoan/OtherFees.java @@ -23,7 +23,7 @@ public class OtherFees implements VoucherJavaParamService{ String INCIDENTAL=param.get("INCIDENTAL")==null?"0.00":param.get("INCIDENTAL"); // 装潢费 String TABLEWARE_FEE=param.get("TABLEWARE_FEE")==null?"0.00":param.get("TABLEWARE_FEE"); - // gps + // GPS String GPS_FEE_FINANCE=param.get("GPS_FEE_FINANCE")==null?"0.00":param.get("GPS_FEE_FINANCE"); BigDecimal factmoney=new BigDecimal(INSURANCE_PREMIUM).add(new BigDecimal(PURCHASE_TAX)).add(new BigDecimal(INCIDENTAL)).add(new BigDecimal(TABLEWARE_FEE)).add(new BigDecimal(GPS_FEE_FINANCE)); returnValue.putAll(param);