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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36695f1d8737ac436e8dec2608a6f420cac392360bfd7b45fe95fcb1363aefe0
4
- data.tar.gz: d1e786d718f025ed8e424e454f25ba9dda392c25d8500a6b0d3a67ec7506ffcc
3
+ metadata.gz: d76de1c75f2a4d040c1ab846d9519939f62aa31b14f211f93acf57c5a145c1dc
4
+ data.tar.gz: 1d888513526b6d285cef7af0fe0a31bc0b75acd97a1a553720667f7770bb4d51
5
5
  SHA512:
6
- metadata.gz: b51a1482c97eaab4ee7eddd9d386e3e5f3eae378b1b4dc340af7cd8697eaa72a6175b26dd80c8c2e95c62e61421a2ee262ad6e5fb0ea3ec01bdfb6be77c77260
7
- data.tar.gz: 80776734b000a0972c8272f58698f6a5130edd96c1596146753e8f40fd094312631a25aafbb7d7f23b84720c984ffa1bdb1552326550dc9cbdc25248fecec6aa
6
+ metadata.gz: 1ef8a70cab87b06bbf82a896a4ba2d7f000490fec2fd123d9eafefc798ad36d1768dc6db29fc69e4c9783e24a015aac66f6a54d3fbed71a41dc0443b51b5033f
7
+ data.tar.gz: 9b0ab2c83dd661d24f0e4d67c3f2e4183c205f253e376964cb56f1af5f8ff631a19a6d665b2950aef149f6f81b6631407f06525872d654dc5f275b81ec356384
data/formulas.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'formulas'
3
- s.version = '0.1.1.2'
3
+ s.version = '0.1.1.3'
4
4
  s.summary = "formulas"
5
5
  s.description = "Home loan formulas"
6
6
  s.authors = ["formulas"]
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 - (annual_gross_pay * send(:levy))
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.2
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-07-31 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest