gobl 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dccbd5dc331a3ff9ed4331c5ee3a8a0bf01fc09b06c72f435d581a4829cab1b
4
- data.tar.gz: 18cb30024e7658008b6d3a093aeb8ae04016f362354eccb52aee8624eb483826
3
+ metadata.gz: 4713d28b3038a3c64f461a1ec0c2b6253d4bd5933e75831b1068935c64fe0199
4
+ data.tar.gz: e85dd1a93f8fc0e2cf3a0d69eff9d87449c61d7b7616dd20f71e80e905739fba
5
5
  SHA512:
6
- metadata.gz: 5f1e241dd4fef640d5846c895956eb3a3deedd81ab7ce0a61e350e37c29ad090d00cd649a1558f8efd3c36e5c2271a80c4ff9d4c8f5144263683b452a19e71e7
7
- data.tar.gz: 3956067376f62b294ef112dc72ec73352be4d2bf43c8c10bdf4bd713125efe5a8c6b85ef78806ae140c9b09cbcfa52101cb4beb741697ac4ffd6eb1a90249836
6
+ metadata.gz: 33d031c78cbea619d3e9c5c4e773917eb1cc2adae9397a78289fbb858fd70831acce5c4763e659958182dcb840fc0a9f0770c413d138648f84c9897349500c87
7
+ data.tar.gz: '09ec88008c59902e7bc9fbbdcd6f452bdf1c6d4fec0baa36adfcb067821628e9593e84906e29511651619a3c4d02e8c0b49ac957c856409f78281ae648d05c79'
data/data/tax/CO.json CHANGED
@@ -408,7 +408,7 @@
408
408
  {
409
409
  "code": "RR",
410
410
  "name": {
411
- "es": "ReteRenta"
411
+ "es": "Retefuente"
412
412
  },
413
413
  "desc": {
414
414
  "es": "Retención en la fuente por el Impuesto de la Renta"
@@ -50,11 +50,9 @@ module GOBL
50
50
  raise 'exponent too high' if exp > 100
51
51
 
52
52
  p = 10**exp
53
- v1 = value.abs / p
54
- v1 = -v1 if value.negative?
55
- v2 = value - (v1 * p)
56
- v2 = -v2 if v2.negative?
57
- format('%d.%0*d', v1, exp, v2)
53
+ v1, v2 = value.abs.divmod(p)
54
+ sign = value.negative? ? '-' : ''
55
+ format('%s%d.%0*d', sign, v1, exp, v2)
58
56
  end
59
57
 
60
58
  # Rescales each {Amount} in the pair ensuring both have the same exponent
@@ -209,7 +207,7 @@ module GOBL
209
207
  v2 = x[1].to_i
210
208
  e = x[1].length
211
209
  v *= 10**e
212
- v += v.positive? ? v2 : -v2
210
+ v += x[0].start_with?('-') ? -v2 : v2
213
211
  end
214
212
 
215
213
  @value = v
data/lib/gobl/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GOBL
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Lilue
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-11-18 00:00:00.000000000 Z
13
+ date: 2022-11-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport