gobl 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/tax/CO.json +420 -0
- data/data/tax/ES.json +61 -0
- data/lib/gobl/num/amount.rb +3 -2
- data/lib/gobl/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dccbd5dc331a3ff9ed4331c5ee3a8a0bf01fc09b06c72f435d581a4829cab1b
|
4
|
+
data.tar.gz: 18cb30024e7658008b6d3a093aeb8ae04016f362354eccb52aee8624eb483826
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f1e241dd4fef640d5846c895956eb3a3deedd81ab7ce0a61e350e37c29ad090d00cd649a1558f8efd3c36e5c2271a80c4ff9d4c8f5144263683b452a19e71e7
|
7
|
+
data.tar.gz: 3956067376f62b294ef112dc72ec73352be4d2bf43c8c10bdf4bd713125efe5a8c6b85ef78806ae140c9b09cbcfa52101cb4beb741697ac4ffd6eb1a90249836
|
data/data/tax/CO.json
ADDED
@@ -0,0 +1,420 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://gobl.org/draft-0/tax/region",
|
3
|
+
"name": {
|
4
|
+
"en": "Colombia",
|
5
|
+
"es": "Colombia"
|
6
|
+
},
|
7
|
+
"country": "CO",
|
8
|
+
"localities": [
|
9
|
+
{
|
10
|
+
"code": "AMA",
|
11
|
+
"name": {
|
12
|
+
"es": "Amazonas"
|
13
|
+
},
|
14
|
+
"meta": {
|
15
|
+
"post": "91"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"code": "ANT",
|
20
|
+
"name": {
|
21
|
+
"es": "Antioquia"
|
22
|
+
},
|
23
|
+
"meta": {
|
24
|
+
"post": "05"
|
25
|
+
}
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"code": "ARA",
|
29
|
+
"name": {
|
30
|
+
"es": "Arauca"
|
31
|
+
},
|
32
|
+
"meta": {
|
33
|
+
"post": "81"
|
34
|
+
}
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"code": "ATL",
|
38
|
+
"name": {
|
39
|
+
"es": "Atlántico"
|
40
|
+
},
|
41
|
+
"meta": {
|
42
|
+
"post": "08"
|
43
|
+
}
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"code": "DC",
|
47
|
+
"name": {
|
48
|
+
"es": "Bogotá"
|
49
|
+
},
|
50
|
+
"meta": {
|
51
|
+
"post": "11"
|
52
|
+
}
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"code": "BOL",
|
56
|
+
"name": {
|
57
|
+
"es": "Bolívar"
|
58
|
+
},
|
59
|
+
"meta": {
|
60
|
+
"post": "13"
|
61
|
+
}
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"code": "BOY",
|
65
|
+
"name": {
|
66
|
+
"es": "Boyacá"
|
67
|
+
},
|
68
|
+
"meta": {
|
69
|
+
"post": "15"
|
70
|
+
}
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"code": "CAL",
|
74
|
+
"name": {
|
75
|
+
"es": "Caldas"
|
76
|
+
},
|
77
|
+
"meta": {
|
78
|
+
"post": "17"
|
79
|
+
}
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"code": "CAQ",
|
83
|
+
"name": {
|
84
|
+
"es": "Caquetá"
|
85
|
+
},
|
86
|
+
"meta": {
|
87
|
+
"post": "18"
|
88
|
+
}
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"code": "CAS",
|
92
|
+
"name": {
|
93
|
+
"es": "Casanare"
|
94
|
+
},
|
95
|
+
"meta": {
|
96
|
+
"post": "85"
|
97
|
+
}
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"code": "CAU",
|
101
|
+
"name": {
|
102
|
+
"es": "Cauca"
|
103
|
+
},
|
104
|
+
"meta": {
|
105
|
+
"post": "19"
|
106
|
+
}
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"code": "CES",
|
110
|
+
"name": {
|
111
|
+
"es": "Cesar"
|
112
|
+
},
|
113
|
+
"meta": {
|
114
|
+
"post": "20"
|
115
|
+
}
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"code": "CHO",
|
119
|
+
"name": {
|
120
|
+
"es": "Chocó"
|
121
|
+
},
|
122
|
+
"meta": {
|
123
|
+
"post": "27"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"code": "COR",
|
128
|
+
"name": {
|
129
|
+
"es": "Córdoba"
|
130
|
+
},
|
131
|
+
"meta": {
|
132
|
+
"post": "23"
|
133
|
+
}
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"code": "CUN",
|
137
|
+
"name": {
|
138
|
+
"es": "Cundinamarca"
|
139
|
+
},
|
140
|
+
"meta": {
|
141
|
+
"post": "25"
|
142
|
+
}
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"code": "GUA",
|
146
|
+
"name": {
|
147
|
+
"es": "Guainía"
|
148
|
+
},
|
149
|
+
"meta": {
|
150
|
+
"post": "94"
|
151
|
+
}
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"code": "GUV",
|
155
|
+
"name": {
|
156
|
+
"es": "Guaviare"
|
157
|
+
},
|
158
|
+
"meta": {
|
159
|
+
"post": "95"
|
160
|
+
}
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"code": "HUI",
|
164
|
+
"name": {
|
165
|
+
"es": "Huila"
|
166
|
+
},
|
167
|
+
"meta": {
|
168
|
+
"post": "41"
|
169
|
+
}
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"code": "LAG",
|
173
|
+
"name": {
|
174
|
+
"es": "La Guajira"
|
175
|
+
},
|
176
|
+
"meta": {
|
177
|
+
"post": "44"
|
178
|
+
}
|
179
|
+
},
|
180
|
+
{
|
181
|
+
"code": "MAG",
|
182
|
+
"name": {
|
183
|
+
"es": "Magdalena"
|
184
|
+
},
|
185
|
+
"meta": {
|
186
|
+
"post": "47"
|
187
|
+
}
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"code": "MET",
|
191
|
+
"name": {
|
192
|
+
"es": "Meta"
|
193
|
+
},
|
194
|
+
"meta": {
|
195
|
+
"post": "50"
|
196
|
+
}
|
197
|
+
},
|
198
|
+
{
|
199
|
+
"code": "NAR",
|
200
|
+
"name": {
|
201
|
+
"es": "Nariño"
|
202
|
+
},
|
203
|
+
"meta": {
|
204
|
+
"post": "52"
|
205
|
+
}
|
206
|
+
},
|
207
|
+
{
|
208
|
+
"code": "NSA",
|
209
|
+
"name": {
|
210
|
+
"es": "Norte de Santander"
|
211
|
+
},
|
212
|
+
"meta": {
|
213
|
+
"post": "54"
|
214
|
+
}
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"code": "PUT",
|
218
|
+
"name": {
|
219
|
+
"es": "Putumayo"
|
220
|
+
},
|
221
|
+
"meta": {
|
222
|
+
"post": "86"
|
223
|
+
}
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"code": "QUI",
|
227
|
+
"name": {
|
228
|
+
"es": "Quindío"
|
229
|
+
},
|
230
|
+
"meta": {
|
231
|
+
"post": "63"
|
232
|
+
}
|
233
|
+
},
|
234
|
+
{
|
235
|
+
"code": "RIS",
|
236
|
+
"name": {
|
237
|
+
"es": "Risaralda"
|
238
|
+
},
|
239
|
+
"meta": {
|
240
|
+
"post": "66"
|
241
|
+
}
|
242
|
+
},
|
243
|
+
{
|
244
|
+
"code": "SAP",
|
245
|
+
"name": {
|
246
|
+
"es": "San Andrés y Providencia"
|
247
|
+
},
|
248
|
+
"meta": {
|
249
|
+
"post": "88"
|
250
|
+
}
|
251
|
+
},
|
252
|
+
{
|
253
|
+
"code": "SAN",
|
254
|
+
"name": {
|
255
|
+
"es": "Santander"
|
256
|
+
},
|
257
|
+
"meta": {
|
258
|
+
"post": "68"
|
259
|
+
}
|
260
|
+
},
|
261
|
+
{
|
262
|
+
"code": "SUC",
|
263
|
+
"name": {
|
264
|
+
"es": "Sucre"
|
265
|
+
},
|
266
|
+
"meta": {
|
267
|
+
"post": "70"
|
268
|
+
}
|
269
|
+
},
|
270
|
+
{
|
271
|
+
"code": "TOL",
|
272
|
+
"name": {
|
273
|
+
"es": "Tolima"
|
274
|
+
},
|
275
|
+
"meta": {
|
276
|
+
"post": "73"
|
277
|
+
}
|
278
|
+
},
|
279
|
+
{
|
280
|
+
"code": "VAC",
|
281
|
+
"name": {
|
282
|
+
"es": "Valle de Cauca"
|
283
|
+
},
|
284
|
+
"meta": {
|
285
|
+
"post": "76"
|
286
|
+
}
|
287
|
+
},
|
288
|
+
{
|
289
|
+
"code": "VAU",
|
290
|
+
"name": {
|
291
|
+
"es": "Vaupés"
|
292
|
+
},
|
293
|
+
"meta": {
|
294
|
+
"post": "97"
|
295
|
+
}
|
296
|
+
},
|
297
|
+
{
|
298
|
+
"code": "VID",
|
299
|
+
"name": {
|
300
|
+
"es": "Vichada"
|
301
|
+
},
|
302
|
+
"meta": {
|
303
|
+
"post": "99"
|
304
|
+
}
|
305
|
+
}
|
306
|
+
],
|
307
|
+
"currency": "COP",
|
308
|
+
"categories": [
|
309
|
+
{
|
310
|
+
"code": "VAT",
|
311
|
+
"name": {
|
312
|
+
"en": "VAT",
|
313
|
+
"es": "IVA"
|
314
|
+
},
|
315
|
+
"desc": {
|
316
|
+
"en": "Value Added Tax",
|
317
|
+
"es": "Impuesto al Valor Agregado"
|
318
|
+
},
|
319
|
+
"rates": [
|
320
|
+
{
|
321
|
+
"key": "zero",
|
322
|
+
"name": {
|
323
|
+
"en": "Zero Rate",
|
324
|
+
"es": "Zero"
|
325
|
+
},
|
326
|
+
"values": [
|
327
|
+
{
|
328
|
+
"percent": "0.0%"
|
329
|
+
}
|
330
|
+
]
|
331
|
+
},
|
332
|
+
{
|
333
|
+
"key": "standard",
|
334
|
+
"name": {
|
335
|
+
"en": "Standard Rate",
|
336
|
+
"es": "Estándar"
|
337
|
+
},
|
338
|
+
"values": [
|
339
|
+
{
|
340
|
+
"since": "2017-01-01",
|
341
|
+
"percent": "19.0%"
|
342
|
+
},
|
343
|
+
{
|
344
|
+
"since": "2006-01-01",
|
345
|
+
"percent": "16.0%"
|
346
|
+
}
|
347
|
+
]
|
348
|
+
},
|
349
|
+
{
|
350
|
+
"key": "reduced",
|
351
|
+
"name": {
|
352
|
+
"en": "Reduced Rate",
|
353
|
+
"es": "Reducido"
|
354
|
+
},
|
355
|
+
"values": [
|
356
|
+
{
|
357
|
+
"since": "2006-01-01",
|
358
|
+
"percent": "5.0%"
|
359
|
+
}
|
360
|
+
]
|
361
|
+
}
|
362
|
+
]
|
363
|
+
},
|
364
|
+
{
|
365
|
+
"code": "IC",
|
366
|
+
"name": {
|
367
|
+
"es": "IC"
|
368
|
+
},
|
369
|
+
"desc": {
|
370
|
+
"en": "Consumption Tax",
|
371
|
+
"es": "Impuesto sobre Consumo"
|
372
|
+
},
|
373
|
+
"rates": []
|
374
|
+
},
|
375
|
+
{
|
376
|
+
"code": "ICA",
|
377
|
+
"name": {
|
378
|
+
"es": "ICA"
|
379
|
+
},
|
380
|
+
"desc": {
|
381
|
+
"en": "Industry and Commerce Tax",
|
382
|
+
"es": "Impuesto de Industria y Comercio"
|
383
|
+
},
|
384
|
+
"rates": []
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"code": "RVAT",
|
388
|
+
"name": {
|
389
|
+
"es": "ReteIVA"
|
390
|
+
},
|
391
|
+
"desc": {
|
392
|
+
"es": "Retención en la fuente por el Impuesto al Valor Agregado"
|
393
|
+
},
|
394
|
+
"retained": true,
|
395
|
+
"rates": []
|
396
|
+
},
|
397
|
+
{
|
398
|
+
"code": "RICA",
|
399
|
+
"name": {
|
400
|
+
"es": "ReteICA"
|
401
|
+
},
|
402
|
+
"desc": {
|
403
|
+
"es": "Retención en la fuente por el Impuesto de Industria y Comercio"
|
404
|
+
},
|
405
|
+
"retained": true,
|
406
|
+
"rates": []
|
407
|
+
},
|
408
|
+
{
|
409
|
+
"code": "RR",
|
410
|
+
"name": {
|
411
|
+
"es": "ReteRenta"
|
412
|
+
},
|
413
|
+
"desc": {
|
414
|
+
"es": "Retención en la fuente por el Impuesto de la Renta"
|
415
|
+
},
|
416
|
+
"retained": true,
|
417
|
+
"rates": []
|
418
|
+
}
|
419
|
+
]
|
420
|
+
}
|
data/data/tax/ES.json
CHANGED
@@ -759,6 +759,67 @@
|
|
759
759
|
}
|
760
760
|
]
|
761
761
|
},
|
762
|
+
{
|
763
|
+
"code": "IGIC",
|
764
|
+
"name": {
|
765
|
+
"en": "IGIC",
|
766
|
+
"es": "IGIC"
|
767
|
+
},
|
768
|
+
"desc": {
|
769
|
+
"en": "Canary Island General Indirect Tax",
|
770
|
+
"es": "Impuesto General Indirecto Canario"
|
771
|
+
},
|
772
|
+
"rates": [
|
773
|
+
{
|
774
|
+
"key": "zero",
|
775
|
+
"name": {
|
776
|
+
"en": "Zero Rate",
|
777
|
+
"es": "Tipo Zero"
|
778
|
+
},
|
779
|
+
"values": [
|
780
|
+
{
|
781
|
+
"percent": "0.0%"
|
782
|
+
}
|
783
|
+
]
|
784
|
+
},
|
785
|
+
{
|
786
|
+
"key": "standard",
|
787
|
+
"name": {
|
788
|
+
"en": "Standard Rate",
|
789
|
+
"es": "Tipo General"
|
790
|
+
},
|
791
|
+
"values": [
|
792
|
+
{
|
793
|
+
"percent": "7.0%"
|
794
|
+
}
|
795
|
+
]
|
796
|
+
},
|
797
|
+
{
|
798
|
+
"key": "reduced",
|
799
|
+
"name": {
|
800
|
+
"en": "Reduced Rate",
|
801
|
+
"es": "Tipo Reducido"
|
802
|
+
},
|
803
|
+
"values": [
|
804
|
+
{
|
805
|
+
"percent": "3.0%"
|
806
|
+
}
|
807
|
+
]
|
808
|
+
}
|
809
|
+
]
|
810
|
+
},
|
811
|
+
{
|
812
|
+
"code": "IPSI",
|
813
|
+
"name": {
|
814
|
+
"en": "IPSI",
|
815
|
+
"es": "IPSI"
|
816
|
+
},
|
817
|
+
"desc": {
|
818
|
+
"en": "Production, Services, and Import Tax",
|
819
|
+
"es": "Impuesto sobre la Producción, los Servicios y la Importación"
|
820
|
+
},
|
821
|
+
"rates": []
|
822
|
+
},
|
762
823
|
{
|
763
824
|
"code": "IRPF",
|
764
825
|
"name": {
|
data/lib/gobl/num/amount.rb
CHANGED
@@ -50,7 +50,8 @@ module GOBL
|
|
50
50
|
raise 'exponent too high' if exp > 100
|
51
51
|
|
52
52
|
p = 10**exp
|
53
|
-
v1 = value / p
|
53
|
+
v1 = value.abs / p
|
54
|
+
v1 = -v1 if value.negative?
|
54
55
|
v2 = value - (v1 * p)
|
55
56
|
v2 = -v2 if v2.negative?
|
56
57
|
format('%d.%0*d', v1, exp, v2)
|
@@ -208,7 +209,7 @@ module GOBL
|
|
208
209
|
v2 = x[1].to_i
|
209
210
|
e = x[1].length
|
210
211
|
v *= 10**e
|
211
|
-
v += v2
|
212
|
+
v += v.positive? ? v2 : -v2
|
212
213
|
end
|
213
214
|
|
214
215
|
@value = v
|
data/lib/gobl/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.1
|
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-
|
13
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -74,6 +74,7 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- data/tax/CO.json
|
77
78
|
- data/tax/ES.json
|
78
79
|
- data/tax/FR.json
|
79
80
|
- data/tax/GB.json
|
@@ -193,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
194
|
- !ruby/object:Gem::Version
|
194
195
|
version: 3.1.4
|
195
196
|
requirements: []
|
196
|
-
rubygems_version: 3.
|
197
|
+
rubygems_version: 3.3.7
|
197
198
|
signing_key:
|
198
199
|
specification_version: 4
|
199
200
|
summary: Minimalist ruby version of the GOBL library
|