Change the Shop::Tax system to be hierarchial.

Update all sample tax tables and tests.
This commit is contained in:
Colin Kuskie 2008-03-06 22:34:21 +00:00
parent cbe9cc29df
commit d956e58bd7
11 changed files with 190 additions and 131 deletions

View file

@ -1,3 +1,7 @@
country,state,city,zip,taxRate
USA,,,,0.0
USA,Wisconsin,,,5.0
USA,Wisconsin,Madison,53701,0.5
where,value,taxRates
state,5.0
code,53701,0.5

1 where,value,taxRates country,state,city,zip,taxRate
1 country,state,city,zip,taxRate
2 USA,,,,0.0
3 USA,Wisconsin,,,5.0
4 USA,Wisconsin,Madison,53701,0.5
5 where,value,taxRates where,value,taxRates
6 state,5.0 state,5.0
7 code,53701,0.5 code,53701,0.5

View file

@ -1,3 +1,4 @@
field,value,taxRate
state,5.0
code,53701,0.5
country,state,city,code,taxRate
USA,,,,0.0,
USA,Wisconsin,,,5.0
USA,Wisconsin,Madison,53701,0.5

1 field,value,taxRate country,state,city,code,taxRate
2 state,5.0 USA,,,,0.0,
3 code,53701,0.5 USA,Wisconsin,,,5.0
4 USA,Wisconsin,Madison,53701,0.5

View file

@ -1,8 +1,9 @@
taxRate,value,field
country,state,city,code,taxRate
#header lines above
#This is just a zip code.
0.5,53701,code
#This is just a country.
USA,,,,0.0
USA,Wisconsin,,,5.0 #Wisconsin is expensive
5.0,Wisconsin,state #Wisconsin is expensive!
USA,Wisconsin,Madison,53701,0.5

1 taxRate,value,field country,state,city,code,taxRate
2 #header lines above #header lines above
3 #This is just a zip code. #This is just a country.
4 0.5,53701,code USA,,,,0.0
5 5.0,Wisconsin,state #Wisconsin is expensive! USA,Wisconsin,,,5.0 #Wisconsin is expensive
6 USA,Wisconsin,Madison,53701,0.5
7
8
9

View file

@ -1,3 +1,3 @@
field,value,taxRate
country,state,city,code,taxRate
#state,Wisconsin,5.0
#code,53701,0.5

1 field country,state,city,code,taxRate value taxRate
2 #state #state,Wisconsin,5.0 Wisconsin 5.0
3 #code #code,53701,0.5 53701 0.5

View file

@ -1,3 +1,4 @@
field,value,taxRate
state,Wisconsin,5.0
code,53701,0.5
country,state,city,code,taxRate
USA,,,,0.0
USA,Wisconsin,,,5.0
USA,Wisconsin,Madison,53701,0.5

1 field country value state city code taxRate
2 state USA Wisconsin 5.0 0.0
3 code USA 53701 Wisconsin 0.5 5.0
4 USA Wisconsin Madison 53701 0.5

View file

@ -1,8 +1,9 @@
field,value,taxRate
state,WI,5.0
code,53701,0.5
code,53702,0.5
code,53703,0.5
code,53704,0.5
state,CA,7.25
code,97123,0.0
country,state,city,code,taxRate
USA,,,,0.0
USA,WI,,,5.0
USA,WI,,53701,0.5
USA,WI,,53702,0.5
USA,WI,,53703,0.5
USA,WI,,53704,0.5
USA,CA,,,7.25
USA,,,97123,0.0

1 field country value state city code taxRate
2 state USA WI 5.0 0.0
3 code USA 53701 WI 0.5 5.0
4 code USA 53702 WI 53701 0.5
5 code USA 53703 WI 53702 0.5
6 code USA 53704 WI 53703 0.5
7 state USA CA WI 53704 7.25 0.5
8 code USA 97123 CA 0.0 7.25
9 USA 97123 0.0

View file

@ -1,3 +1,4 @@
field,taxRate
state,5.0
code,53701,0.5
country,city,code,taxRate
USA,,,,0.0
USA,Wisconsin,,,5.0
USA,Wisconsin,Madison,53701,0.5

1 field,taxRate country,city,code,taxRate
2 state,5.0 USA,,,,0.0
3 code,53701,0.5 USA,Wisconsin,,,5.0
4 USA,Wisconsin,Madison,53701,0.5

View file

@ -1,3 +1,4 @@
taxRate,value,field
5.0,Wisconsin,state
0.5,53701,code
taxRate,country,state,city,code
0.0,USA,,,
5.0,USA,Wisconsin,,
0.5,USA,Wisconsin,Madison,53701

1 taxRate value country field state city code
2 5.0 0.0 Wisconsin USA state
3 0.5 5.0 53701 USA code Wisconsin
4 0.5 USA Wisconsin Madison 53701