| | |
| | | * 起征点:P < 1010 元时 V = C = 0(L = P) |
| | | * V = round(P × 1% / (1 + 1%), 2) 增值税(从含税金额中价税分离,四舍五入到分) |
| | | * C = round(V × 3.5%, 2) 城建税(四舍五入到分) |
| | | * L = P - V - C 劳务税前(不含增值税、城建税) |
| | | * L = P - V 劳务税前(不扣城建税) |
| | | * </pre> |
| | | * 2026-11-30:劳务税前改为 <b>P − V</b>,城建税改在劳务个税档位公式中扣除(见 {@link TaxtUtils#getTaxation(BigDecimal, BigDecimal)})。 |
| | | * 个税 T 仍按当月累计劳务税前 L 计算;劳务税后 N = L - T。 |
| | | * <p> |
| | | * 录入劳务税后时,劳务税前 L 已知,需要反解 P/V/C:{@code P = L + V + C}, |
| | |
| | | } |
| | | |
| | | /** |
| | | * 劳务税前 = 税前金额 - 增值税 - 城建税 |
| | | * 劳务税前 = 税前金额 - 增值税 |
| | | * <p> |
| | | * 金额过小(取整后 增值税+城建税 ≥ 税前金额)时按“不扣税”处理,劳务税前 = 税前金额,保证不出现负数。 |
| | | * 2026-11-30 业务确认:劳务税前<b>不扣城建税</b>,城建税在劳务个税档位公式中扣除。 |
| | | * 金额过小时(V+C ≥ P)按“不扣税”处理,劳务税前 = 税前金额,保证不出现负数。 |
| | | */ |
| | | 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())); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 已知劳务税前 L,反解税前金额 P、增值税 V、城建税 C |
| | | * <p> |
| | | * 循环:P 初值取 L,反复用 P 求 V、C,再用 P = L + V + C 修正,直到稳定。 |
| | | * 由于 V、C 四舍五入,迭代可能停在相邻的两个有效解之一(差 0.01),属既定口径。 |
| | | * 2026-11-30 口径:{@code L = P − V}(不含城建税),因此循环为 |
| | | * <b>P = L + V</b>,V = round(P × 1% / 1.01)、C = round(V × 3.5%)。 |
| | | * 由于取整,迭代可能停在相邻的两个有效解之一(差 0.01),属既定口径。 |
| | | * |
| | | * @param laborPretax 劳务税前 L |
| | | * @return 满足 P = L + V + C、V = round(P × 1% / 1.01)、C = round(V × 3.5%) 的解 |
| | | * @return 满足 P = L + V、V = round(P × 1% / 1.01)、C = round(V × 3.5%) 的解 |
| | | */ |
| | | public static GrossAmount solveGross(BigDecimal laborPretax) { |
| | | BigDecimal l = roundMoney(laborPretax); |
| | |
| | | } |
| | | 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("反解税前:L={} -> P={}, V={}, C={}", l, p, v, c); |
| | | return new GrossAmount(p, v, c); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 劳务税前 = 税前金额 - 增值税 - 城建税 |
| | | * 劳务税前 = 税前金额 - 增值税(不扣城建税,2026-11-30 口径) |
| | | */ |
| | | public BigDecimal getLaborPretax() { |
| | | return roundMoney(pretax.subtract(vat).subtract(cityTax)); |
| | | return roundMoney(pretax.subtract(vat)); |
| | | } |
| | | } |
| | | } |