const WAYDEAR_INCOME_SEIZETABLE = [ [0, 1259.99, 0, 0, 0, 0, 0, 0], [1260, 1269.99, 5.15, 0, 0, 0, 0, 0], [1270, 1279.99, 12.15, 0, 0, 0, 0, 0], [1280, 1289.99, 19.15, 0, 0, 0, 0, 0], [1290, 1299.99, 26.15, 0, 0, 0, 0, 0], [1300, 1309.99, 33.15, 0, 0, 0, 0, 0], [1310, 1319.99, 40.15, 0, 0, 0, 0, 0], [1320, 1329.99, 47.15, 0, 0, 0, 0, 0], [1330, 1339.99, 54.15, 0, 0, 0, 0, 0], [1340, 1349.99, 61.15, 0, 0, 0, 0, 0], [1350, 1359.99, 68.15, 0, 0, 0, 0, 0], [1360, 1369.99, 75.15, 0, 0, 0, 0, 0], [1370, 1379.99, 82.15, 0, 0, 0, 0, 0], [1380, 1389.99, 89.15, 0, 0, 0, 0, 0], [1390, 1399.99, 96.15, 0, 0, 0, 0, 0], [1400, 1409.99, 103.15, 0, 0, 0, 0, 0], [1410, 1419.99, 110.15, 0, 0, 0, 0, 0], [1420, 1429.99, 117.15, 0, 0, 0, 0, 0], [1430, 1439.99, 124.15, 0, 0, 0, 0, 0], [1440, 1449.99, 131.15, 0, 0, 0, 0, 0], [1450, 1459.99, 138.15, 0, 0, 0, 0, 0], [1460, 1469.99, 145.15, 0, 0, 0, 0, 0], [1470, 1479.99, 152.15, 0, 0, 0, 0, 0], [1480, 1489.99, 159.15, 0, 0, 0, 0, 0], [1490, 1499.99, 166.15, 0, 0, 0, 0, 0], [1500, 1509.99, 173.15, 0, 0, 0, 0, 0], [1510, 1519.99, 180.15, 0, 0, 0, 0, 0], [1520, 1529.99, 187.15, 0, 0, 0, 0, 0], [1530, 1539.99, 194.15, 0, 0, 0, 0, 0], [1540, 1549.99, 201.15, 0, 0, 0, 0, 0], [1550, 1559.99, 208.15, 0, 0, 0, 0, 0], [1560, 1569.99, 215.15, 0, 0, 0, 0, 0], [1570, 1579.99, 222.15, 0, 0, 0, 0, 0], [1580, 1589.99, 229.15, 0, 0, 0, 0, 0], [1590, 1599.99, 236.15, 0, 0, 0, 0, 0], [1600, 1609.99, 243.15, 0, 0, 0, 0, 0], [1610, 1619.99, 250.15, 0, 0, 0, 0, 0], [1620, 1629.99, 257.15, 0, 0, 0, 0, 0], [1630, 1639.99, 264.15, 0, 0, 0, 0, 0], [1640, 1649.99, 271.15, 0, 0, 0, 0, 0], [1650, 1659.99, 278.15, 0, 0, 0, 0, 0], [1660, 1669.99, 285.15, 0, 0, 0, 0, 0], [1670, 1679.99, 292.15, 0, 0, 0, 0, 0], [1680, 1689.99, 299.15, 0, 0, 0, 0, 0], [1690, 1699.99, 306.15, 0, 0, 0, 0, 0], [1700, 1709.99, 313.15, 0, 0, 0, 0, 0], [1710, 1719.99, 320.15, 0, 0, 0, 0, 0], [1720, 1729.99, 327.15, 0, 0, 0, 0, 0], [1730, 1739.99, 334.15, 2.96, 0, 0, 0, 0], [1740, 1749.99, 341.15, 7.96, 0, 0, 0, 0], [1750, 1759.99, 348.15, 12.96, 0, 0, 0, 0], [1760, 1769.99, 355.15, 17.96, 0, 0, 0, 0], [1770, 1779.99, 362.15, 22.96, 0, 0, 0, 0], [1780, 1789.99, 369.15, 27.96, 0, 0, 0, 0], [1790, 1799.99, 376.15, 32.96, 0, 0, 0, 0], [1800, 1809.99, 383.15, 37.96, 0, 0, 0, 0], [1810, 1819.99, 390.15, 42.96, 0, 0, 0, 0], [1820, 1829.99, 397.15, 47.96, 0, 0, 0, 0], [1830, 1839.99, 404.15, 52.96, 0, 0, 0, 0], [1840, 1849.99, 411.15, 57.96, 0, 0, 0, 0], [1850, 1859.99, 418.15, 62.96, 0, 0, 0, 0], [1860, 1869.99, 425.15, 67.96, 0, 0, 0, 0], [1870, 1879.99, 432.15, 72.96, 0, 0, 0, 0], [1880, 1889.99, 439.15, 77.96, 0, 0, 0, 0], [1890, 1899.99, 446.15, 82.96, 0, 0, 0, 0], [1900, 1909.99, 453.15, 87.96, 0, 0, 0, 0], [1910, 1919.99, 460.15, 92.96, 0, 0, 0, 0], [1920, 1929.99, 467.15, 97.96, 0, 0, 0, 0], [1930, 1939.99, 474.15, 102.96, 0, 0, 0, 0], [1940, 1949.99, 481.15, 107.96, 0, 0, 0, 0], [1950, 1959.99, 488.15, 112.96, 0, 0, 0, 0], [1960, 1969.99, 495.15, 117.96, 0, 0, 0, 0], [1970, 1979.99, 502.15, 122.96, 0, 0, 0, 0], [1980, 1989.99, 509.15, 127.96, 0, 0, 0, 0], [1990, 1999.99, 516.15, 132.96, 1.31, 0, 0, 0], [2000, 2009.99, 523.15, 137.96, 5.31, 0, 0, 0], [2010, 2019.99, 530.15, 142.96, 9.31, 0, 0, 0], [2020, 2029.99, 537.15, 147.96, 13.31, 0, 0, 0], [2030, 2039.99, 544.15, 152.96, 17.31, 0, 0, 0], [2040, 2049.99, 551.15, 157.96, 21.31, 0, 0, 0], [2050, 2059.99, 558.15, 162.96, 25.31, 0, 0, 0], [2060, 2069.99, 565.15, 167.96, 29.31, 0, 0, 0], [2070, 2079.99, 572.15, 172.96, 33.31, 0, 0, 0], [2080, 2089.99, 579.15, 177.96, 37.31, 0, 0, 0], [2090, 2099.99, 586.15, 182.96, 41.31, 0, 0, 0], [2100, 2109.99, 593.15, 187.96, 45.31, 0, 0, 0], [2110, 2119.99, 600.15, 192.96, 49.31, 0, 0, 0], [2120, 2129.99, 607.15, 197.96, 53.31, 0, 0, 0], [2130, 2139.99, 614.15, 202.96, 57.31, 0, 0, 0], [2140, 2149.99, 621.15, 207.96, 61.31, 0, 0, 0], [2150, 2159.99, 628.15, 212.96, 65.31, 0, 0, 0], [2160, 2169.99, 635.15, 217.96, 69.31, 0, 0, 0], [2170, 2179.99, 642.15, 222.96, 73.31, 0, 0, 0], [2180, 2189.99, 649.15, 227.96, 77.31, 0, 0, 0], [2190, 2199.99, 656.15, 232.96, 81.31, 0, 0, 0], [2200, 2209.99, 663.15, 237.96, 85.31, 0, 0, 0], [2210, 2219.99, 670.15, 242.96, 89.31, 0, 0, 0], [2220, 2229.99, 677.15, 247.96, 93.31, 0, 0, 0], [2230, 2239.99, 684.15, 252.96, 97.31, 0, 0, 0], [2240, 2249.99, 691.15, 257.96, 101.31, 0, 0, 0], [2250, 2259.99, 698.15, 262.96, 105.31, 0.19, 0, 0], [2260, 2269.99, 705.15, 267.96, 109.31, 3.19, 0, 0], [2270, 2279.99, 712.15, 272.96, 113.31, 6.19, 0, 0], [2280, 2289.99, 719.15, 277.96, 117.31, 9.19, 0, 0], [2290, 2299.99, 726.15, 282.96, 121.31, 12.19, 0, 0], [2300, 2309.99, 733.15, 287.96, 125.31, 15.19, 0, 0], [2310, 2319.99, 740.15, 292.96, 129.31, 18.19, 0, 0], [2320, 2329.99, 747.15, 297.96, 133.31, 21.19, 0, 0], [2330, 2339.99, 754.15, 302.96, 137.31, 24.19, 0, 0], [2340, 2349.99, 761.15, 307.96, 141.31, 27.19, 0, 0], [2350, 2359.99, 768.15, 312.96, 145.31, 30.19, 0, 0], [2360, 2369.99, 775.15, 317.96, 149.31, 33.19, 0, 0], [2370, 2379.99, 782.15, 322.96, 153.31, 36.19, 0, 0], [2380, 2389.99, 789.15, 327.96, 157.31, 39.19, 0, 0], [2390, 2399.99, 796.15, 332.96, 161.31, 42.19, 0, 0], [2400, 2409.99, 803.15, 337.96, 165.31, 45.19, 0, 0], [2410, 2419.99, 810.15, 342.96, 169.31, 48.19, 0, 0], [2420, 2429.99, 817.15, 347.96, 173.31, 51.19, 0, 0], [2430, 2439.99, 824.15, 352.96, 177.31, 54.19, 0, 0], [2440, 2449.99, 831.15, 357.96, 181.31, 57.19, 0, 0], [2450, 2459.99, 838.15, 362.96, 185.31, 60.19, 0, 0], [2460, 2469.99, 845.15, 367.96, 189.31, 63.19, 0, 0], [2470, 2479.99, 852.15, 372.96, 193.31, 66.19, 0, 0], [2480, 2489.99, 859.15, 377.96, 197.31, 69.19, 0, 0], [2490, 2499.99, 866.15, 382.96, 201.31, 72.19, 0, 0], [2500, 2509.99, 873.15, 387.96, 205.31, 75.19, 0, 0], [2510, 2519.99, 880.15, 392.96, 209.31, 78.19, 0, 0], [2520, 2529.99, 887.15, 397.96, 213.31, 81.19, 1.59, 0], [2530, 2539.99, 894.15, 402.96, 217.31, 84.19, 3.59, 0], [2540, 2549.99, 901.15, 407.96, 221.31, 87.19, 5.59, 0], [2550, 2559.99, 908.15, 412.96, 225.31, 90.19, 7.59, 0], [2560, 2569.99, 915.15, 417.96, 229.31, 93.19, 9.59, 0], [2570, 2579.99, 922.15, 422.96, 233.31, 96.19, 11.59, 0], [2580, 2589.99, 929.15, 427.96, 237.31, 99.19, 13.59, 0], [2590, 2599.99, 936.15, 432.96, 241.31, 102.19, 15.59, 0], [2600, 2609.99, 943.15, 437.96, 245.31, 105.19, 17.59, 0], [2610, 2619.99, 950.15, 442.96, 249.31, 108.19, 19.59, 0], [2620, 2629.99, 957.15, 447.96, 253.31, 111.19, 21.59, 0], [2630, 2639.99, 964.15, 452.96, 257.31, 114.19, 23.59, 0], [2640, 2649.99, 971.15, 457.96, 261.31, 117.19, 25.59, 0], [2650, 2659.99, 978.15, 462.96, 265.31, 120.19, 27.59, 0], [2660, 2669.99, 985.15, 467.96, 269.31, 123.19, 29.59, 0], [2670, 2679.99, 992.15, 472.96, 273.31, 126.19, 31.59, 0], [2680, 2689.99, 999.15, 477.96, 277.31, 129.19, 33.59, 0], [2690, 2699.99, 1006.15, 482.96, 281.31, 132.19, 35.59, 0], [2700, 2709.99, 1013.15, 487.96, 285.31, 135.19, 37.59, 0], [2710, 2719.99, 1020.15, 492.96, 289.31, 138.19, 39.59, 0], [2720, 2729.99, 1027.15, 497.96, 293.31, 141.19, 41.59, 0], [2730, 2739.99, 1034.15, 502.96, 297.31, 144.19, 43.59, 0], [2740, 2749.99, 1041.15, 507.96, 301.31, 147.19, 45.59, 0], [2750, 2759.99, 1048.15, 512.96, 305.31, 150.19, 47.59, 0], [2760, 2769.99, 1055.15, 517.96, 309.31, 153.19, 49.59, 0], [2770, 2779.99, 1062.15, 522.96, 313.31, 156.19, 51.59, 0], [2780, 2789.99, 1069.15, 527.96, 317.31, 159.19, 53.59, 0.53], [2790, 2799.99, 1076.15, 532.96, 321.31, 162.19, 55.59, 1.53], [2800, 2809.99, 1083.15, 537.96, 325.31, 165.19, 57.59, 2.53], [2810, 2819.99, 1090.15, 542.96, 329.31, 168.19, 59.59, 3.53], [2820, 2829.99, 1097.15, 547.96, 333.31, 171.19, 61.59, 4.53], [2830, 2839.99, 1104.15, 552.96, 337.31, 174.19, 63.59, 5.53], [2840, 2849.99, 1111.15, 557.96, 341.31, 177.19, 65.59, 6.53], [2850, 2859.99, 1118.15, 562.96, 345.31, 180.19, 67.59, 7.53], [2860, 2869.99, 1125.15, 567.96, 349.31, 183.19, 69.59, 8.53], [2870, 2879.99, 1132.15, 572.96, 353.31, 186.19, 71.59, 9.53], [2880, 2889.99, 1139.15, 577.96, 357.31, 189.19, 73.59, 10.53], [2890, 2899.99, 1146.15, 582.96, 361.31, 192.19, 75.59, 11.53], [2900, 2909.99, 1153.15, 587.96, 365.31, 195.19, 77.59, 12.53], [2910, 2919.99, 1160.15, 592.96, 369.31, 198.19, 79.59, 13.53], [2920, 2929.99, 1167.15, 597.96, 373.31, 201.19, 81.59, 14.53], [2930, 2939.99, 1174.15, 602.96, 377.31, 204.19, 83.59, 15.53], [2940, 2949.99, 1181.15, 607.96, 381.31, 207.19, 85.59, 16.53], [2950, 2959.99, 1188.15, 612.96, 385.31, 210.19, 87.59, 17.53], [2960, 2969.99, 1195.15, 617.96, 389.31, 213.19, 89.59, 18.53], [2970, 2979.99, 1202.15, 622.96, 393.31, 216.19, 91.59, 19.53], [2980, 2989.99, 1209.15, 627.96, 397.31, 219.19, 93.59, 20.53], [2990, 2999.99, 1216.15, 632.96, 401.31, 222.19, 95.59, 21.53], [3000, 3009.99, 1223.15, 637.96, 405.31, 225.19, 97.59, 22.53], [3010, 3019.99, 1230.15, 642.96, 409.31, 228.19, 99.59, 23.53], [3020, 3029.99, 1237.15, 647.96, 413.31, 231.19, 101.59, 24.53], [3030, 3039.99, 1244.15, 652.96, 417.31, 234.19, 103.59, 25.53], [3040, 3049.99, 1251.15, 657.96, 421.31, 237.19, 105.59, 26.53], [3050, 3059.99, 1258.15, 662.96, 425.31, 240.19, 107.59, 27.53], [3060, 3069.99, 1265.15, 667.96, 429.31, 243.19, 109.59, 28.53], [3070, 3079.99, 1272.15, 672.96, 433.31, 246.19, 111.59, 29.53], [3080, 3089.99, 1279.15, 677.96, 437.31, 249.19, 113.59, 30.53], [3090, 3099.99, 1286.15, 682.96, 441.31, 252.19, 115.59, 31.53], [3100, 3109.99, 1293.15, 687.96, 445.31, 255.19, 117.59, 32.53], [3110, 3119.99, 1300.15, 692.96, 449.31, 258.19, 119.59, 33.53], [3120, 3129.99, 1307.15, 697.96, 453.31, 261.19, 121.59, 34.53], [3130, 3139.99, 1314.15, 702.96, 457.31, 264.19, 123.59, 35.53], [3140, 3149.99, 1321.15, 707.96, 461.31, 267.19, 125.59, 36.53], [3150, 3159.99, 1328.15, 712.96, 465.31, 270.19, 127.59, 37.53], [3160, 3169.99, 1335.15, 717.96, 469.31, 273.19, 129.59, 38.53], [3170, 3179.99, 1342.15, 722.96, 473.31, 276.19, 131.59, 39.53], [3180, 3189.99, 1349.15, 727.96, 477.31, 279.19, 133.59, 40.53], [3190, 3199.99, 1356.15, 732.96, 481.31, 282.19, 135.59, 41.53], [3200, 3209.99, 1363.15, 737.96, 485.31, 285.19, 137.59, 42.53], [3210, 3219.99, 1370.15, 742.96, 489.31, 288.19, 139.59, 43.53], [3220, 3229.99, 1377.15, 747.96, 493.31, 291.19, 141.59, 44.53], [3230, 3239.99, 1384.15, 752.96, 497.31, 294.19, 143.59, 45.53], [3240, 3249.99, 1391.15, 757.96, 501.31, 297.19, 145.59, 46.53], [3250, 3259.99, 1398.15, 762.96, 505.31, 300.19, 147.59, 47.53], [3260, 3269.99, 1405.15, 767.96, 509.31, 303.19, 149.59, 48.53], [3270, 3279.99, 1412.15, 772.96, 513.31, 306.19, 151.59, 49.53], [3280, 3289.99, 1419.15, 777.96, 517.31, 309.19, 153.59, 50.53], [3290, 3299.99, 1426.15, 782.96, 521.31, 312.19, 155.59, 51.53], [3300, 3309.99, 1433.15, 787.96, 525.31, 315.19, 157.59, 52.53], [3310, 3319.99, 1440.15, 792.96, 529.31, 318.19, 159.59, 53.53], [3320, 3329.99, 1447.15, 797.96, 533.31, 321.19, 161.59, 54.53], [3330, 3339.99, 1454.15, 802.96, 537.31, 324.19, 163.59, 55.53], [3340, 3349.99, 1461.15, 807.96, 541.31, 327.19, 165.59, 56.53], [3350, 3359.99, 1468.15, 812.96, 545.31, 330.19, 167.59, 57.53], [3360, 3369.99, 1475.15, 817.96, 549.31, 333.19, 169.59, 58.53], [3370, 3379.99, 1482.15, 822.96, 553.31, 336.19, 171.59, 59.53], [3380, 3389.99, 1489.15, 827.96, 557.31, 339.19, 173.59, 60.53], [3390, 3399.99, 1496.15, 832.96, 561.31, 342.19, 175.59, 61.53], [3400, 3409.99, 1503.15, 837.96, 565.31, 345.19, 177.59, 62.53], [3410, 3419.99, 1510.15, 842.96, 569.31, 348.19, 179.59, 63.53], [3420, 3429.99, 1517.15, 847.96, 573.31, 351.19, 181.59, 64.53], [3430, 3439.99, 1524.15, 852.96, 577.31, 354.19, 183.59, 65.53], [3440, 3449.99, 1531.15, 857.96, 581.31, 357.19, 185.59, 66.53], [3450, 3459.99, 1538.15, 862.96, 585.31, 360.19, 187.59, 67.53], [3460, 3469.99, 1545.15, 867.96, 589.31, 363.19, 189.59, 68.53], [3470, 3479.99, 1552.15, 872.96, 593.31, 366.19, 191.59, 69.53], [3480, 3489.99, 1559.15, 877.96, 597.31, 369.19, 193.59, 70.53], [3490, 3499.99, 1566.15, 882.96, 601.31, 372.19, 195.59, 71.53], [3500, 3509.99, 1573.15, 887.96, 605.31, 375.19, 197.59, 72.53], [3510, 3519.99, 1580.15, 892.96, 609.31, 378.19, 199.59, 73.53], [3520, 3529.99, 1587.15, 897.96, 613.31, 381.19, 201.59, 74.53], [3530, 3539.99, 1594.15, 902.96, 617.31, 384.19, 203.59, 75.53], [3540, 3549.99, 1601.15, 907.96, 621.31, 387.19, 205.59, 76.53], [3550, 3559.99, 1608.15, 912.96, 625.31, 390.19, 207.59, 77.53], [3560, 3569.99, 1615.15, 917.96, 629.31, 393.19, 209.59, 78.53], [3570, 3579.99, 1622.15, 922.96, 633.31, 396.19, 211.59, 79.53], [3580, 3589.99, 1629.15, 927.96, 637.31, 399.19, 213.59, 80.53], [3590, 3599.99, 1636.15, 932.96, 641.31, 402.19, 215.59, 81.53], [3600, 3609.99, 1643.15, 937.96, 645.31, 405.19, 217.59, 82.53], [3610, 3619.99, 1650.15, 942.96, 649.31, 408.19, 219.59, 83.53], [3620, 3629.99, 1657.15, 947.96, 653.31, 411.19, 221.59, 84.53], [3630, 3639.99, 1664.15, 952.96, 657.31, 414.19, 223.59, 85.53], [3640, 3649.99, 1671.15, 957.96, 661.31, 417.19, 225.59, 86.53], [3650, 3659.99, 1678.15, 962.96, 665.31, 420.19, 227.59, 87.53], [3660, 3669.99, 1685.15, 967.96, 669.31, 423.19, 229.59, 88.53], [3670, 3679.99, 1692.15, 972.96, 673.31, 426.19, 231.59, 89.53], [3680, 3689.99, 1699.15, 977.96, 677.31, 429.19, 233.59, 90.53], [3690, 3699.99, 1706.15, 982.96, 681.31, 432.19, 235.59, 91.53], [3700, 3709.99, 1713.15, 987.96, 685.31, 435.19, 237.59, 92.53], [3710, 3719.99, 1720.15, 992.96, 689.31, 438.19, 239.59, 93.53], [3720, 3729.99, 1727.15, 997.96, 693.31, 441.19, 241.59, 94.53], [3730, 3739.99, 1734.15, 1002.96, 697.31, 444.19, 243.59, 95.53], [3740, 3749.99, 1741.15, 1007.96, 701.31, 447.19, 245.59, 96.53], [3750, 3759.99, 1748.15, 1012.96, 705.31, 450.19, 247.59, 97.53], [3760, 3769.99, 1755.15, 1017.96, 709.31, 453.19, 249.59, 98.53], [3770, 3779.99, 1762.15, 1022.96, 713.31, 456.19, 251.59, 99.53], [3780, 3789.99, 1769.15, 1027.96, 717.31, 459.19, 253.59, 100.53], [3790, 3799.99, 1776.15, 1032.96, 721.31, 462.19, 255.59, 101.53], [3800, 3809.99, 1783.15, 1037.96, 725.31, 465.19, 257.59, 102.53], [3810, 3819.99, 1790.15, 1042.96, 729.31, 468.19, 259.59, 103.53], [3820, 3829.99, 1797.15, 1047.96, 733.31, 471.19, 261.59, 104.53], [3830, 3839.99, 1804.15, 1052.96, 737.31, 474.19, 263.59, 105.53], [3840, 3840.08, 1811.15, 1057.96, 741.31, 477.19, 265.59, 106.53] ]; const WAYDEAR_BANK_BASE = 1252.64; const WAYDEAR_BANK_FIRST_PERSON = 471.44; const WAYDEAR_BANK_ADD_PERSON = 262.65; const WAYDEAR_INCOME_SEIZE_THRESHOLD = 3840.08; const WAYDEAR_ON_CHANGE_LISTEN_EVENTS = 'input keyup paste change'; const WAYDEAR_COOKIE_USAGE = { de: 'Wir verwenden Cookies um die Nutzung zu verbessern. Bei der weiteren Nutzung von unserer Webseite stimmen Sie dem zu.' } function CalculateIncomeSeizable(income, persons) { persons = parseInt(persons); income = parseFloat(income); var seizeAmount = 0; var totalSeizeThreshold = WAYDEAR_INCOME_SEIZE_THRESHOLD; if (income > totalSeizeThreshold) { var row = WAYDEAR_INCOME_SEIZETABLE[WAYDEAR_INCOME_SEIZETABLE.length - 1]; seizeAmount = row[persons + 2]; seizeAmount += income - totalSeizeThreshold; return seizeAmount; } WAYDEAR_INCOME_SEIZETABLE.forEach(row => { var min = row[0]; var max = row[1]; if (income >= min && income <= max) { seizeAmount = row[persons + 2]; } }); return seizeAmount; } function CalculateBankAllowance(married, assistantMoney = 0, children = null, addChildPay = 0, addPersons = 0) { var base = WAYDEAR_BANK_BASE; var total = WAYDEAR_BANK_BASE; var AddFreibetrag = WAYDEAR_BANK_FIRST_PERSON; var AddFreibetrag2 = WAYDEAR_BANK_ADD_PERSON; var totalAddPersons = 0; var MaxAddFreibetrag2 = AddFreibetrag2 * 4; if (married) { total += AddFreibetrag; AddFreibetrag = 0; totalAddPersons++; } if (assistantMoney) { total += assistantMoney } if (children) { var childrencount = children.length; if (childrencount > 0) { totalAddPersons += childrencount; total += CalculateChildMoney(children, addChildPay); } } if (addPersons > 0) { totalAddPersons += addPersons; } if (totalAddPersons < 1) total = total; else if (totalAddPersons == 1) { total += AddFreibetrag; } else if (totalAddPersons > 1 && totalAddPersons <= 5) { total += AddFreibetrag; total += AddFreibetrag2 * (totalAddPersons - 1); } else if (totalAddPersons > 1 && totalAddPersons > 5) { total += AddFreibetrag; total += MaxAddFreibetrag2; } total = Math.round(total * 100) / 100; return total; } function CalculateChildMoney(children, addChildPay = 0) { total = 0; if (children) { var childrencount = children.length; if (childrencount > 0) { for (var i = 0; i < childrencount; i++) { if (children[i]) { if (i + 1 < 3) total += 219; else if (i + 1 == 3) total += 225; else if (i + 1 > 3) total += 250; } } if (addChildPay > 0) { total += addChildPay; } } } return total; } function Month2Text(month) { month++; switch (month) { case 1: return 'Januar'; case 2: return 'Februar'; case 3: return 'März'; case 4: return 'April'; case 5: return 'Mai'; case 6: return 'Juni'; case 7: return 'Juli'; case 8: return 'August'; case 9: return 'September'; case 10: return 'Oktober'; case 11: return 'November'; case 12: return 'Dezember'; } } function Day2Text(day) { switch (day) { case 1: return 'Mo'; case 2: return 'Di'; case 3: return 'Mi'; case 4: return 'Do'; case 5: return 'Fr'; case 6: return 'Sa'; case 7: return 'So'; } } function prettyFormatDecimal(value, cutzeros = false) { var s = value.toString(); var parts = s.split('.'); if (parts.length == 1) parts.push("0"); var formattedTotal = parts[0]; if (parts[1] == "0") { parts[1] = parts[1] + '0'; } else if (parts[1].length == 1) parts[1] = parts[1] + '0'; formattedTotal = formattedTotal.replace(/\B(?=(\d{3})+(?!\d))/g, ".") + ',' + parts[1]; if (cutzeros && parts[1] == '00') { formattedTotal = formattedTotal.substring(0, formattedTotal.indexOf(',')); } return formattedTotal; } function smoothScrollToTarget(target, offset = 20) { $('html, body').animate({ scrollTop: target.offset().top - offset }, 1000, function () { var $target = $(target); }); } function isEmpty(str) { return (str.length === 0 || !str.trim()); }; function htmlspecialchars(str) { if (typeof (str) == "string") { str = str.replace(/&/g, "&"); /* must do & first */ str = str.replace(/"/g, """); str = str.replace(/'/g, "'"); str = str.replace(//g, ">"); } return str; }