singapore_charitable_donations 1.0.0 → 1.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5007963d5123d417bfe408fddf372a8322355673
|
4
|
+
data.tar.gz: e7ab809df3b4987cfe98b27faa27763240aee021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9de067d6f6010ed6860aaeaeb4b4a8893ec3c4bd40019a0246208ae0a782fac90fb476185eec45dc3ff56e94976f79e82ccdc2231b63b3bb5152e7c2ff1134d5
|
7
|
+
data.tar.gz: 05474badcdf92252053fd6b135d4d2172d88a62ffa3718d2b69482ef47837d90cddc88d92f555b6d9fe294f86fe988a901c0ee28231332bececb43f5fde2562d
|
data/README.md
CHANGED
@@ -33,9 +33,9 @@ Currently supported charitable donation types:
|
|
33
33
|
* SINDA - Singapore Indian Development Association Fund
|
34
34
|
|
35
35
|
```ruby
|
36
|
-
calculator = SingaporeCharitableDonations::
|
37
|
-
|
38
|
-
|
36
|
+
calculator = SingaporeCharitableDonations::Calculators.get date: Date.new(2014, 12, 7),
|
37
|
+
type: "CDAC"
|
38
|
+
calculator.calculate(2_000.00) #=> 1.00
|
39
39
|
```
|
40
40
|
|
41
41
|
## Contributing
|
@@ -6,22 +6,21 @@ module SingaporeCharitableDonations
|
|
6
6
|
module Year2009Calculator
|
7
7
|
class << self
|
8
8
|
|
9
|
-
# @param [BigDecimal]
|
9
|
+
# @param [BigDecimal] total_wages
|
10
10
|
# @return [BigDecimal] contribution amount
|
11
11
|
def calculate(total_wages)
|
12
|
-
rounded_total_wages = total_wages.round
|
13
12
|
case
|
14
|
-
when
|
13
|
+
when total_wages <= 200.00
|
15
14
|
BigDecimal "0.00"
|
16
|
-
when
|
15
|
+
when total_wages < 1_001.00
|
17
16
|
BigDecimal "2.00"
|
18
|
-
when
|
17
|
+
when total_wages < 2_001.00
|
19
18
|
BigDecimal "3.50"
|
20
|
-
when
|
19
|
+
when total_wages < 3_001.00
|
21
20
|
BigDecimal "5.00"
|
22
|
-
when
|
21
|
+
when total_wages < 4_001.00
|
23
22
|
BigDecimal "12.50"
|
24
|
-
else # total_wages
|
23
|
+
else # total_wages >= 4_001.00
|
25
24
|
BigDecimal "16.00"
|
26
25
|
end
|
27
26
|
end
|
@@ -37,4 +36,4 @@ module SingaporeCharitableDonations
|
|
37
36
|
end
|
38
37
|
end
|
39
38
|
end
|
40
|
-
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singapore_charitable_donations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Paca
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -137,4 +137,3 @@ test_files:
|
|
137
137
|
- spec/singapore_charitable_donations/calculators/sinda/year_2015_calculator_spec.rb
|
138
138
|
- spec/singapore_charitable_donations/calculators_spec.rb
|
139
139
|
- spec/spec_helper.rb
|
140
|
-
has_rdoc:
|