]> gitweb.factorcode.org Git - factor.git/blob - extra/taxes/usa/mn/mn.factor
8bb629efcd3e12fc24bc2ea7915a33e5551ede85
[factor.git] / extra / taxes / usa / mn / mn.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays assocs kernel math math.intervals
4 namespaces sequences money math.order usa-cities
5 taxes.usa taxes.usa.w4 ;
6 IN: taxes.usa.mn
7
8 ! Minnesota
9 : mn-single ( -- triples )
10     {
11         {     0  1950  DECIMAL: 0     }
12         {  1950 23750  DECIMAL: .0535 }
13         { 23750 73540  DECIMAL: .0705 }
14         { 73540 1/0.   DECIMAL: .0785 }
15     } ;
16
17 : mn-married ( -- triples )
18     {
19         {      0   7400 DECIMAL: 0     }
20         {   7400  39260 DECIMAL: .0535 }
21         {  39260 133980 DECIMAL: .0705 }
22         { 133980   1/0. DECIMAL: .0785 }
23     } ;
24
25 : <mn> ( -- obj )
26     MN mn-single mn-married <tax-table> ;
27
28 M: MN adjust-allowances* ( salary w4 collector entity -- newsalary )
29     2drop calculate-w4-allowances - ;
30
31 M: MN withholding* ( salary w4 collector entity -- x )
32     drop
33     [ adjust-allowances ] 2keep marriage-table tax ;