From e61966a89350cf11940d5bd538a5dda06cb6b437 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 03 十二月 2026 17:01:18 +0800
Subject: [PATCH] 完善个税汇总模块删除记录的问题
---
ruoyi-common/src/main/java/com/ruoyi/common/tax/VatTaxUtils.java | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/tax/VatTaxUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/tax/VatTaxUtils.java
index cc380f2..598d7f9 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/tax/VatTaxUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/tax/VatTaxUtils.java
@@ -13,8 +13,9 @@
* 璧峰緛鐐癸細P < 1010 鍏冩椂 V = C = 0锛圠 = P锛�
* V = round(P 脳 1% / (1 + 1%), 2) 澧炲�肩◣锛堜粠鍚◣閲戦涓环绋庡垎绂伙紝鍥涜垗浜斿叆鍒板垎锛�
* C = round(V 脳 3.5%, 2) 鍩庡缓绋庯紙鍥涜垗浜斿叆鍒板垎锛�
- * L = P - V - C 鍔冲姟绋庡墠锛堜笉鍚鍊肩◣銆佸煄寤虹◣锛�
+ * L = P - V 鍔冲姟绋庡墠锛堜笉鎵e煄寤虹◣锛�
* </pre>
+ * 2026-11-30锛氬姵鍔$◣鍓嶆敼涓� <b>P 鈭� V</b>锛屽煄寤虹◣鏀瑰湪鍔冲姟涓◣妗d綅鍏紡涓墸闄わ紙瑙� {@link TaxtUtils#getTaxation(BigDecimal, BigDecimal)}锛夈��
* 涓◣ T 浠嶆寜褰撴湀绱鍔冲姟绋庡墠 L 璁$畻锛涘姵鍔$◣鍚� N = L - T銆�
* <p>
* 褰曞叆鍔冲姟绋庡悗鏃讹紝鍔冲姟绋庡墠 L 宸茬煡锛岄渶瑕佸弽瑙� P/V/C锛歿@code P = L + V + C}锛�
@@ -134,13 +135,14 @@
}
/**
- * 鍔冲姟绋庡墠 = 绋庡墠閲戦 - 澧炲�肩◣ - 鍩庡缓绋�
+ * 鍔冲姟绋庡墠 = 绋庡墠閲戦 - 澧炲�肩◣
* <p>
- * 閲戦杩囧皬锛堝彇鏁村悗 澧炲�肩◣+鍩庡缓绋� 鈮� 绋庡墠閲戦锛夋椂鎸夆�滀笉鎵g◣鈥濆鐞嗭紝鍔冲姟绋庡墠 = 绋庡墠閲戦锛屼繚璇佷笉鍑虹幇璐熸暟銆�
+ * 2026-11-30 涓氬姟纭锛氬姵鍔$◣鍓�<b>涓嶆墸鍩庡缓绋�</b>锛屽煄寤虹◣鍦ㄥ姵鍔′釜绋庢。浣嶅叕寮忎腑鎵i櫎銆�
+ * 閲戦杩囧皬鏃讹紙V+C 鈮� P锛夋寜鈥滀笉鎵g◣鈥濆鐞嗭紝鍔冲姟绋庡墠 = 绋庡墠閲戦锛屼繚璇佷笉鍑虹幇璐熸暟銆�
*/
public static BigDecimal calcLaborPretax(BigDecimal pretax) {
GrossAmount gross = splitRate(pretax);
- return roundMoney(gross.getPretax().subtract(gross.getVat()).subtract(gross.getCityTax()));
+ return roundMoney(gross.getPretax().subtract(gross.getVat()));
}
/**
@@ -168,11 +170,12 @@
/**
* 宸茬煡鍔冲姟绋庡墠 L锛屽弽瑙g◣鍓嶉噾棰� P銆佸鍊肩◣ V銆佸煄寤虹◣ C
* <p>
- * 寰幆锛歅 鍒濆�煎彇 L锛屽弽澶嶇敤 P 姹� V銆丆锛屽啀鐢� P = L + V + C 淇锛岀洿鍒扮ǔ瀹氥��
- * 鐢变簬 V銆丆 鍥涜垗浜斿叆锛岃凯浠e彲鑳藉仠鍦ㄧ浉閭荤殑涓や釜鏈夋晥瑙d箣涓�锛堝樊 0.01锛夛紝灞炴棦瀹氬彛寰勩��
+ * 2026-11-30 鍙e緞锛歿@code L = P 鈭� V}锛堜笉鍚煄寤虹◣锛夛紝鍥犳寰幆涓�
+ * <b>P = L + V</b>锛孷 = round(P 脳 1% / 1.01)銆丆 = round(V 脳 3.5%)銆�
+ * 鐢变簬鍙栨暣锛岃凯浠e彲鑳藉仠鍦ㄧ浉閭荤殑涓や釜鏈夋晥瑙d箣涓�锛堝樊 0.01锛夛紝灞炴棦瀹氬彛寰勩��
*
* @param laborPretax 鍔冲姟绋庡墠 L
- * @return 婊¤冻 P = L + V + C銆乂 = round(P 脳 1% / 1.01)銆丆 = round(V 脳 3.5%) 鐨勮В
+ * @return 婊¤冻 P = L + V銆乂 = round(P 脳 1% / 1.01)銆丆 = round(V 脳 3.5%) 鐨勮В
*/
public static GrossAmount solveGross(BigDecimal laborPretax) {
BigDecimal l = roundMoney(laborPretax);
@@ -181,19 +184,17 @@
}
BigDecimal p = l;
BigDecimal v = calcVat(p);
- BigDecimal c = calcCityTax(v);
for (int i = 0; i < SOLVE_MAX_LOOP; i++) {
- BigDecimal newP = roundMoney(l.add(v).add(c));
+ BigDecimal newP = roundMoney(l.add(v));
BigDecimal newV = calcVat(newP);
- BigDecimal newC = calcCityTax(newV);
- boolean stable = newP.compareTo(p) == 0 && newV.compareTo(v) == 0 && newC.compareTo(c) == 0;
+ boolean stable = newP.compareTo(p) == 0 && newV.compareTo(v) == 0;
p = newP;
v = newV;
- c = newC;
if (stable) {
break;
}
}
+ BigDecimal c = calcCityTax(v);
log.debug("鍙嶈В绋庡墠锛歀={} -> P={}, V={}, C={}", l, p, v, c);
return new GrossAmount(p, v, c);
}
@@ -229,10 +230,10 @@
}
/**
- * 鍔冲姟绋庡墠 = 绋庡墠閲戦 - 澧炲�肩◣ - 鍩庡缓绋�
+ * 鍔冲姟绋庡墠 = 绋庡墠閲戦 - 澧炲�肩◣锛堜笉鎵e煄寤虹◣锛�2026-11-30 鍙e緞锛�
*/
public BigDecimal getLaborPretax() {
- return roundMoney(pretax.subtract(vat).subtract(cityTax));
+ return roundMoney(pretax.subtract(vat));
}
}
}
--
Gitblit v1.9.3