fiscalizer 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fiscalizer/tax.rb +36 -46
- data/lib/fiscalizer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93910f6f4a1a2690c1555b9816acd56d7100564f
|
4
|
+
data.tar.gz: e4a9c175caba575afbdf9d1c5728d68633e88754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02011656ce76e0c7e7a86d5df035456f719a2c5bb08e4f71454c5a4ab7f250d5a6477d18e2482a628b3643f80cb344d5b70beaec59da4f62a077ea62fea90e75
|
7
|
+
data.tar.gz: a1d9e1eb6c33fb3294e579f8c78690665b44629a6fffb8e80125ca65942f69dca2d80fe8f00dae7e95f4ca6610333275efb1449fbe368c2bdbdf3c42a9667655
|
data/lib/fiscalizer/tax.rb
CHANGED
@@ -1,47 +1,37 @@
|
|
1
1
|
class Fiscalizer
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
def total_str
|
39
|
-
return ("%15.2f" % total).strip
|
40
|
-
end # total_str
|
41
|
-
|
42
|
-
def summed_str
|
43
|
-
return ("%15.2f" % summed ).strip
|
44
|
-
end # summed_str
|
45
|
-
|
46
|
-
end # Tax
|
47
|
-
end # Fiscalizer
|
2
|
+
class Tax
|
3
|
+
attr_accessor :base, :rate, :name, :total, :summed
|
4
|
+
|
5
|
+
def initialize(base: 0.0, rate: 0.0, name: '', total: nil, summed: nil)
|
6
|
+
@base = base
|
7
|
+
@rate = rate
|
8
|
+
@name = name
|
9
|
+
@total = total
|
10
|
+
@summed = summed
|
11
|
+
end
|
12
|
+
|
13
|
+
def total
|
14
|
+
@total || (base.to_f * (rate.to_f / 100.0)).round(2)
|
15
|
+
end
|
16
|
+
|
17
|
+
def summed
|
18
|
+
@summed || (base.to_f + total.to_f).round(2)
|
19
|
+
end
|
20
|
+
|
21
|
+
def base_str
|
22
|
+
format('%15.2f', base).strip
|
23
|
+
end
|
24
|
+
|
25
|
+
def rate_str
|
26
|
+
format('%3.2f', rate).strip
|
27
|
+
end
|
28
|
+
|
29
|
+
def total_str
|
30
|
+
format('%15.2f', total).strip
|
31
|
+
end
|
32
|
+
|
33
|
+
def summed_str
|
34
|
+
format('%15.2f', summed).strip
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/fiscalizer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fiscalizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanko Krtalić Rusendić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.5.1
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: A gem that automatically handles fiscalization
|