Steuertabellen 2026 für DE, AT, CH (Bund) und LI (Land) zu tax

This commit is contained in:
wkh
2026-10-11 22:44:45 +02:00
parent 6c0d675c5d
commit f83d1bd6f8
10 changed files with 412 additions and 0 deletions
+37
View File
@@ -723,3 +723,40 @@ class PickTest < RdbCase
assert_equal '', table
end
end
class TaxTablesTest < RdbCase
def tax(income, table) = rdb('tax', income.to_s, file: table).to_i
def test_at_2026
assert_equal 0, tax(13_539, 'taxAT2026')
assert_equal 11_447, tax(50_000, 'taxAT2026') # 6 030.40 + 13 542 * 40 %
assert_equal 33_818, tax(100_000, 'taxAT2026')
end
def test_ch_federal_2026
assert_equal 0, tax(15_200, 'taxCH2026')
assert_equal 401, tax(50_000, 'taxCH2026')
assert_equal 2684, tax(100_000, 'taxCH2026')
assert_equal 91_310, tax(794_000, 'taxCH2026')
end
def test_li_landessteuer_2026
assert_equal 996, tax(50_000, 'taxLI2026') # 0,04 * x - 1 004
assert_equal 3256, tax(100_000, 'taxLI2026') # 0,05 * x - 1 744
assert_equal 10_464, tax(211_400, 'taxLI2026')
assert_equal 0, tax(15_855, 'taxLI2026')
end
# § 32a EStG: the table is a straight-line approximation of the curved zones
def test_de_2026_follows_the_formula
[12_348, 14_000, 17_799, 20_000, 33_333, 50_000, 69_878, 100_000, 277_825, 300_000].each do |x|
exact = if x <= 12_348 then 0
elsif x <= 17_799 then y = (x - 12_348) / 10_000.0; ((914.51 * y) + 1400) * y
elsif x <= 69_878 then z = (x - 17_799) / 10_000.0; (((173.10 * z) + 2397) * z) + 1034.87
elsif x <= 277_825 then (0.42 * x) - 11_135.63
else (0.45 * x) - 19_470.38
end
assert_in_delta exact.floor, tax(x, 'taxDE2026'), 1, "income #{x}"
end
end
end