From 5d1ada4f57b77067cb3a58d8a38858ba73982a48 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 30 六月 2023 13:52:55 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/opo into yingxh
---
ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java | 44 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java
index 3a78e57..894d7f4 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java
@@ -41,7 +41,7 @@
// 褰揦>4000鏃�
//(1)褰揦*(1-20%)<=20000鏃讹紝涓◣T=X*(1-20%)*20%
if (money.doubleValue() > 4000 && multiply.doubleValue() <= 20000) {
- taxMoney = multiply.multiply(new BigDecimal(0.8));
+ taxMoney = multiply.multiply(new BigDecimal(0.2));
}
//(2)褰�20000<X*(1-20%)<=50000鏃讹紝涓◣T=X*(1-20%)*30%-2000
@@ -58,9 +58,47 @@
return format;
}
+ /**
+ * 閫氳繃绋庡悗宸ヨ祫锛岀畻鍑虹◣鍓嶅伐璧�
+ *
+ * @param money
+ * @return
+ */
+ public static String getTaxationBefore(BigDecimal money) {
+ //褰揦<=800鏃讹紝涓◣T=0
+ BigDecimal taxMoney = new BigDecimal(0.0);
+
+ if (money.doubleValue() > 800 && money.doubleValue() <= 3360) {
+ taxMoney = money.divide(new BigDecimal(0.2),2,BigDecimal.ROUND_DOWN).add(new BigDecimal(800));
+ }
+
+ if (money.doubleValue() > 3360 && money.doubleValue() <= 21000) {
+ taxMoney = money.divide(new BigDecimal(0.84),2,BigDecimal.ROUND_DOWN);
+ }
+
+ if (money.doubleValue() > 21000 && money.doubleValue() <= 40000) {
+ money = money.subtract(new BigDecimal(2000));
+ taxMoney = money.divide(new BigDecimal(0.76),2,BigDecimal.ROUND_DOWN);
+ }
+
+ if (money.doubleValue() > 40000) {
+ money = money.subtract(new BigDecimal(7000));
+ taxMoney = money.divide(new BigDecimal(0.68),2,BigDecimal.ROUND_DOWN);
+ }
+
+
+ DecimalFormat decimalFormat = new DecimalFormat("#.00");
+ String format = decimalFormat.format(taxMoney);
+ return format;
+ }
+
+
public static void main(String[] args) {
- String taxation = getTaxation(new BigDecimal(70000));
- System.out.println(taxation);
+ String taxation = getTaxation(new BigDecimal(21000));
+ String taxationBefore = getTaxationBefore(new BigDecimal(52000));
+
+
+ System.out.println(taxation + " " + taxationBefore);
}
}
--
Gitblit v1.9.3