income-tax 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5eff04c9bad9eb3a9181cae31fa8e90a058a62b5
4
- data.tar.gz: 5629b5a76ffb589ad3e8e130266b4825a6212ac3
3
+ metadata.gz: 0e467161dc0c59928355a621df1a0de57afc1f31
4
+ data.tar.gz: 0393350cb2551033442c34738c4c5c42e9216209
5
5
  SHA512:
6
- metadata.gz: f516c8121d16ad66fdd4414ad470d04a839cfa1fa643a5c25b1cf221362e35d8df35fab60fe4f60c09f39cf582fb19f1571825a7cd8681d2c82389b25de5f936
7
- data.tar.gz: 26223c389b23bdacc52bdc41b46b63fbdc0fed4b6f93a02255eecf500d7c5ca572250f76b9e839bbde09425386ca25095855b04dd07620efea4a9c18d34e3ce1
6
+ metadata.gz: c64e76403b59f8401bf858e43cd0e9fd399c5c6c0177742ee23f7831e9591798d3cbcb0f97db4d6ec42fb6cfa283a6966410d10aab9bbebfbe01eac2c21032ba
7
+ data.tar.gz: 80bab2064fa9cf7c37bbf4577ab8c003855c1c9c967c11359581c727d2092d99d002b576753942a46c3d75b3ee63d0845344623e607bd948be676d2f22e7b33e
@@ -4,10 +4,12 @@ module IncomeTax
4
4
  register "Norway", "NO", "NOR"
5
5
  currency "NOK"
6
6
 
7
- level 84420, "0%"
8
- level 456400, "28%"
9
- level 741700, "37%"
10
- remainder "40%"
7
+ fixed = Rate.new("25%")
8
+ level 159_800, fixed
9
+ level 224_900, fixed + Rate.new("0.44%")
10
+ level 565_400, fixed + Rate.new("1.7%")
11
+ level 909_500, fixed + Rate.new("10.7%")
12
+ remainder fixed + Rate.new("13.7%")
11
13
  end
12
14
  end
13
15
  end
@@ -1,3 +1,3 @@
1
1
  module IncomeTax
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -16,37 +16,28 @@ describe IncomeTax::Countries::Norway do
16
16
  describe "from gross income of 1000" do
17
17
  let(:tax_year) { 2015 }
18
18
  let(:income) { 1000 }
19
- its(:rate) { should be == Rational(0, 1) }
19
+ its(:rate) { should be == Rational(1, 4) }
20
20
  its(:gross_income) { should be == 1000 }
21
- its(:net_income) { should be == 1000 }
22
- its(:taxes) { should be == 0 }
21
+ its(:net_income) { should be == 750 }
22
+ its(:taxes) { should be == 250 }
23
23
  end
24
24
 
25
25
  describe "from gross income of 10000" do
26
26
  let(:tax_year) { 2015 }
27
27
  let(:income) { 10000 }
28
- its(:rate) { should be == Rational(0, 1) }
28
+ its(:rate) { should be == Rational(1, 4) }
29
29
  its(:gross_income) { should be == 10000 }
30
- its(:net_income) { should be == 10000 }
31
- its(:taxes) { should be == 0 }
32
- end
33
-
34
- describe "from gross income of 100000" do
35
- let(:tax_year) { 2015 }
36
- let(:income) { 100000 }
37
- its(:rate) { should be == Rational(13, 298) }
38
- its(:gross_income) { should be == 100000 }
39
- its(:net_income) { should be == "95637.6".to_d }
40
- its(:taxes) { should be == "4362.4".to_d }
30
+ its(:net_income) { should be == 7500 }
31
+ its(:taxes) { should be == 2500 }
41
32
  end
42
33
 
43
34
  describe "from gross income of 100000000" do
44
35
  let(:tax_year) { 2015 }
45
36
  let(:income) { 100000000 }
46
- its(:rate) { should be == Rational(91, 228) }
37
+ its(:rate) { should be == Rational(95, 246) }
47
38
  its(:gross_income) { should be == 100000000 }
48
- its(:net_income) { should be == "60086964.6".to_d }
49
- its(:taxes) { should be == "39913035.4".to_d }
39
+ its(:net_income) { should be == "61381707.86".to_d }
40
+ its(:taxes) { should be == "38618292.14".to_d }
50
41
  end
51
42
 
52
43
  describe "from net income of 0" do
@@ -58,45 +49,5 @@ describe IncomeTax::Countries::Norway do
58
49
  its(:net_income) { should be == 0 }
59
50
  its(:taxes) { should be == 0 }
60
51
  end
61
-
62
- describe "from net income of 1000" do
63
- let(:type) { :net }
64
- let(:tax_year) { 2015 }
65
- let(:income) { 1000 }
66
- its(:rate) { should be == Rational(0, 1) }
67
- its(:gross_income) { should be == 1000 }
68
- its(:net_income) { should be == 1000 }
69
- its(:taxes) { should be == 0 }
70
- end
71
-
72
- describe "from net income of 10000" do
73
- let(:type) { :net }
74
- let(:tax_year) { 2015 }
75
- let(:income) { 10000 }
76
- its(:rate) { should be == Rational(0, 1) }
77
- its(:gross_income) { should be == 10000 }
78
- its(:net_income) { should be == 10000 }
79
- its(:taxes) { should be == 0 }
80
- end
81
-
82
- describe "from net income of 100000" do
83
- let(:type) { :net }
84
- let(:tax_year) { 2015 }
85
- let(:income) { 100000 }
86
- its(:rate) { should be == Rational(65, 1138) }
87
- its(:gross_income) { should be == "106058.888888888889".to_d }
88
- its(:net_income) { should be == 100000 }
89
- its(:taxes) { should be == "6058.8888888888889".to_d }
90
- end
91
-
92
- describe "from net income of 100000000" do
93
- let(:type) { :net }
94
- let(:tax_year) { 2015 }
95
- let(:income) { 100000000 }
96
- its(:rate) { should be == Rational(151, 378) }
97
- its(:gross_income) { should be == "166521725.666666667".to_d }
98
- its(:net_income) { should be == 100000000 }
99
- its(:taxes) { should be == "66521725.6666666667".to_d }
100
- end
101
52
  end
102
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: income-tax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-11 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Estimate Income Tax for different Countries
14
14
  email: income-tax-gem@rkh.im
@@ -766,7 +766,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
766
766
  version: '0'
767
767
  requirements: []
768
768
  rubyforge_project:
769
- rubygems_version: 2.5.1
769
+ rubygems_version: 2.4.4
770
770
  signing_key:
771
771
  specification_version: 4
772
772
  summary: Given a country and a gross or net income, estimate personal income tax.