formulas 0.1.1.2 → 0.1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/formulas.gemspec +1 -1
- data/lib/formulas/paye.rb +6 -0
- data/lib/formulas/withholding_tax.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d76de1c75f2a4d040c1ab846d9519939f62aa31b14f211f93acf57c5a145c1dc
|
4
|
+
data.tar.gz: 1d888513526b6d285cef7af0fe0a31bc0b75acd97a1a553720667f7770bb4d51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ef8a70cab87b06bbf82a896a4ba2d7f000490fec2fd123d9eafefc798ad36d1768dc6db29fc69e4c9783e24a015aac66f6a54d3fbed71a41dc0443b51b5033f
|
7
|
+
data.tar.gz: 9b0ab2c83dd661d24f0e4d67c3f2e4183c205f253e376964cb56f1af5f8ff631a19a6d665b2950aef149f6f81b6631407f06525872d654dc5f275b81ec356384
|
data/formulas.gemspec
CHANGED
data/lib/formulas/paye.rb
CHANGED
@@ -19,6 +19,8 @@ module Formulas
|
|
19
19
|
[[180_000], 39]
|
20
20
|
]
|
21
21
|
|
22
|
+
MAX_ACC_LEVY_PAYABLE = 130_911
|
23
|
+
|
22
24
|
def initialize(gross_pay:, frequency: Formulas::MONTHLY)
|
23
25
|
super(gross_pay, frequency, TAX_RATES)
|
24
26
|
end
|
@@ -30,5 +32,9 @@ module Formulas
|
|
30
32
|
def levy
|
31
33
|
0.0139
|
32
34
|
end
|
35
|
+
|
36
|
+
def acc_payable
|
37
|
+
annual_gross_pay > MAX_ACC_LEVY_PAYABLE ? MAX_ACC_LEVY_PAYABLE : annual_gross_pay
|
38
|
+
end
|
33
39
|
end
|
34
40
|
end
|
@@ -6,17 +6,18 @@ module Formulas
|
|
6
6
|
|
7
7
|
attr_reader :origin_frequency
|
8
8
|
|
9
|
-
def initialize(gross_pay, origin_frequency, tax_rate)
|
9
|
+
def initialize(gross_pay, origin_frequency, tax_rate, options: {})
|
10
10
|
@gross_pay = gross_pay
|
11
11
|
@origin_frequency = origin_frequency
|
12
12
|
@tax_rate = tax_rate
|
13
|
+
@options = options
|
13
14
|
end
|
14
15
|
|
15
16
|
def net_pay(request_frequency:)
|
16
17
|
annual_pay_after_tax = annual_gross_pay - calculate_tax(Formulas::ANNUALLY)
|
17
18
|
|
18
19
|
if respond_to?(:levy)
|
19
|
-
net_pay = annual_pay_after_tax - (
|
20
|
+
net_pay = annual_pay_after_tax - (acc_payable * send(:levy))
|
20
21
|
end
|
21
22
|
|
22
23
|
return net_pay if request_frequency.to_s == Formulas::ANNUALLY.to_s
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formulas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- formulas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|