gobl 0.9.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -13
  3. data/data/regimes/co.json +55 -1
  4. data/data/regimes/es.json +570 -64
  5. data/data/regimes/it.json +1182 -0
  6. data/lib/{gobl → generated/gobl}/bill/charge.rb +1 -1
  7. data/lib/{gobl → generated/gobl}/bill/delivery.rb +1 -1
  8. data/lib/{gobl → generated/gobl}/bill/discount.rb +1 -1
  9. data/lib/{gobl → generated/gobl}/bill/document_reference.rb +1 -1
  10. data/lib/{gobl → generated/gobl}/bill/invoice.rb +19 -8
  11. data/lib/{gobl → generated/gobl}/bill/line.rb +3 -3
  12. data/lib/{gobl → generated/gobl}/bill/line_charge.rb +1 -1
  13. data/lib/{gobl → generated/gobl}/bill/line_discount.rb +1 -1
  14. data/lib/{gobl → generated/gobl}/bill/ordering.rb +1 -1
  15. data/lib/{gobl → generated/gobl}/bill/outlay.rb +3 -3
  16. data/lib/{gobl → generated/gobl}/bill/payment.rb +1 -1
  17. data/lib/{gobl → generated/gobl}/bill/preceding.rb +23 -23
  18. data/lib/{gobl → generated/gobl}/bill/tax.rb +4 -4
  19. data/lib/{gobl → generated/gobl}/bill/totals.rb +5 -5
  20. data/lib/{gobl → generated/gobl}/cal/date.rb +2 -2
  21. data/lib/{gobl → generated/gobl}/cal/period.rb +3 -3
  22. data/lib/{gobl → generated/gobl}/cbc/code.rb +3 -3
  23. data/lib/{gobl → generated/gobl}/cbc/key.rb +2 -2
  24. data/lib/{gobl → generated/gobl}/cbc/meta.rb +1 -1
  25. data/lib/{gobl → generated/gobl}/cbc/note.rb +6 -6
  26. data/lib/{gobl → generated/gobl}/cbc/stamp.rb +3 -3
  27. data/lib/{gobl → generated/gobl}/currency/code.rb +7 -4
  28. data/lib/{gobl → generated/gobl}/currency/exchange_rate.rb +3 -3
  29. data/lib/generated/gobl/document.rb +16 -0
  30. data/lib/{gobl → generated/gobl}/dsig/digest.rb +3 -3
  31. data/lib/{gobl → generated/gobl}/dsig/signature.rb +2 -2
  32. data/lib/{gobl → generated/gobl}/envelope.rb +5 -5
  33. data/lib/{gobl → generated/gobl}/header.rb +4 -4
  34. data/lib/{gobl → generated/gobl}/i18n/string.rb +1 -1
  35. data/lib/{gobl → generated/gobl}/l10n/code.rb +2 -2
  36. data/lib/{gobl → generated/gobl}/l10n/country_code.rb +7 -4
  37. data/lib/{gobl → generated/gobl}/note/message.rb +4 -4
  38. data/lib/{gobl → generated/gobl}/org/address.rb +2 -2
  39. data/lib/{gobl → generated/gobl}/org/coordinates.rb +1 -1
  40. data/lib/{gobl → generated/gobl}/org/email.rb +2 -2
  41. data/lib/generated/gobl/org/identity.rb +38 -0
  42. data/lib/{gobl → generated/gobl}/org/image.rb +1 -1
  43. data/lib/{gobl → generated/gobl}/org/inbox.rb +3 -3
  44. data/lib/{gobl → generated/gobl}/org/item.rb +10 -10
  45. data/lib/{gobl → generated/gobl}/org/name.rb +3 -3
  46. data/lib/{gobl → generated/gobl}/org/party.rb +7 -7
  47. data/lib/{gobl → generated/gobl}/org/person.rb +2 -7
  48. data/lib/{gobl → generated/gobl}/org/registration.rb +1 -1
  49. data/lib/{gobl → generated/gobl}/org/telephone.rb +2 -2
  50. data/lib/{gobl → generated/gobl}/org/unit.rb +8 -3
  51. data/lib/{gobl → generated/gobl}/org/website.rb +2 -2
  52. data/lib/{gobl → generated/gobl}/pay/advance.rb +3 -3
  53. data/lib/{gobl → generated/gobl}/pay/card.rb +3 -3
  54. data/lib/{gobl → generated/gobl}/pay/credit_transfer.rb +1 -1
  55. data/lib/{gobl → generated/gobl}/pay/direct_debit.rb +1 -1
  56. data/lib/{gobl → generated/gobl}/pay/due_date.rb +3 -3
  57. data/lib/{gobl → generated/gobl}/pay/instructions.rb +19 -4
  58. data/lib/{gobl → generated/gobl}/pay/online.rb +2 -2
  59. data/lib/{gobl → generated/gobl}/pay/terms.rb +19 -4
  60. data/lib/{gobl → generated/gobl}/tax/category.rb +14 -4
  61. data/lib/{gobl → generated/gobl}/tax/category_total.rb +5 -5
  62. data/lib/{gobl → generated/gobl}/tax/combo.rb +7 -2
  63. data/lib/{gobl → generated/gobl}/tax/identity.rb +16 -6
  64. data/lib/generated/gobl/tax/key_definition.rb +38 -0
  65. data/lib/generated/gobl/tax/preceding_definitions.rb +27 -0
  66. data/lib/{gobl → generated/gobl}/tax/rate.rb +11 -4
  67. data/lib/{gobl → generated/gobl}/tax/rate_total.rb +4 -4
  68. data/lib/{gobl → generated/gobl}/tax/rate_total_surcharge.rb +3 -3
  69. data/lib/{gobl → generated/gobl}/tax/rate_value.rb +2 -2
  70. data/lib/{gobl → generated/gobl}/tax/regime.rb +19 -9
  71. data/lib/generated/gobl/tax/scenario.rb +37 -0
  72. data/lib/generated/gobl/tax/scenario_set.rb +29 -0
  73. data/lib/{gobl → generated/gobl}/tax/set.rb +1 -1
  74. data/lib/generated/gobl/tax/tag.rb +33 -0
  75. data/lib/{gobl → generated/gobl}/tax/total.rb +2 -2
  76. data/lib/{gobl → generated/gobl}/tax/zone.rb +2 -2
  77. data/lib/{gobl → generated/gobl}/uuid/uuid.rb +2 -2
  78. data/lib/gobl/enum.rb +8 -56
  79. data/lib/gobl/version.rb +1 -1
  80. data/lib/gobl.rb +1 -0
  81. metadata +75 -76
  82. data/lib/gobl/bill/invoice_type.rb +0 -30
  83. data/lib/gobl/cbc/note_key.rb +0 -48
  84. data/lib/gobl/document.rb +0 -13
  85. data/lib/gobl/org/item_code.rb +0 -28
  86. data/lib/gobl/pay/method_key.rb +0 -30
  87. data/lib/gobl/pay/term_key.rb +0 -33
  88. data/lib/gobl/tax/scheme.rb +0 -44
  89. data/lib/gobl/tax/source_key.rb +0 -28
  90. data/lib/gobl/value.rb +0 -77
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e14eb326a6bbca1237cdc6782714e9dbcacbe53e3bcb0028e52acefbb83ea5b
4
- data.tar.gz: fb366c4ba614d652d14938a7d99f85522db3dc2845b32b611fc78d8bb9761ead
3
+ metadata.gz: bff66b8750d72848acd28331e82d9c91a951d093331400a0d2942119d83b2f9b
4
+ data.tar.gz: 23d17b39a899ddc36293d2b070338bc30f4011acf08b299854f027ee06f8f758
5
5
  SHA512:
6
- metadata.gz: 2109bb654d767070f4261cd45b85d97bd7e7ebbb9d03ea83b8af5fd61f73434d0e5ebd2d13f35aa368d154d68fef3742116d8b405eec1611bd7799c410bce124
7
- data.tar.gz: 63d05794780f7e4a200490b56f1477fb4fb14dc11e4aab0ce2e81358ff58d2f02175318e16f13ea46098edd1f8a045ceefe51de9a5b384913450a09103b5796f
6
+ metadata.gz: 2cc83e91eeefd2ef016b1a7a079e158c4b40cd1ba88b995b13ea46926dd7dbce06cc27547f755d18acb1e74b6ea1c81af99b7c6e5a190ecaeba1f596e9185a37
7
+ data.tar.gz: 22cfc2a7a0eb8c2c244bc04589033bd3f0a7e0fa6d77a76704c6775d79ba9f53bcd9ce8e84e225430a651da788a36ab8679e06e0ded107b773636479e93dec95
data/README.md CHANGED
@@ -215,28 +215,22 @@ The command `mage setup` fetches and installs all the required dependencies to u
215
215
 
216
216
  #### Code generation
217
217
 
218
- Ensure all the GOBL JSON Schema files are available by manually copying the base GOBL project's `build/schemas` path to the `data/schemas` path in this repository. Schemas are _.gitignored_, and you must copy them every time you want to update the generated code:
218
+ Ensure all the GOBL JSON Schema and Regime files are available by manually copying the [base GOBL project](https://github.com/invopop/gobl)'s `build/` path to the `data/` path in this repository. For example, assuming you have GOBL at `../gobl/`, you can run this:
219
219
 
220
220
  ```bash
221
- rm -rf ./data/schemas
222
- cp -r ../gobl/build/schemas ./data
221
+ rm -rf ./data/*
222
+ cp -r ../gobl/build/* ./data
223
223
  ```
224
224
 
225
- You can also update the regimes data with:
225
+ Please note that `schemas` is _.gitignored_ as we only need it to generate the code. However, the previous command also copies `regimes` which content is used by the library and so, it is part of the git repo and the gem.
226
226
 
227
- ```bash
228
- rm -rf ./data/regimes
229
- cp -r ../gobl/build/regimes ./data
230
- ```
231
-
232
- Now you can delete any previously generated code with
227
+ Now, with the help of [the GOBL generator](https://github.com/invopop/gobl.generator), you can regenerate the code. For example, assuming the GOBL generator is at `../gobl.generator`, you can run this:
233
228
 
234
229
  ```bash
235
- find lib -name "*.rb" -exec grep -l "Generated with GOBL" {} \; | xargs rm
230
+ rm -rf lib/generated/gobl
231
+ ../gobl.generator/bin/generate -l ruby -o lib/generated/gobl/
236
232
  ```
237
233
 
238
- The command `mage -v generate` generates the Ruby files from the JSON Schema. If the schema is updated, it will update the Ruby files.
239
-
240
234
  #### Tests
241
235
 
242
236
  Use the `mage spec` command to run the entire test suite.
data/data/regimes/co.json CHANGED
@@ -14581,6 +14581,60 @@
14581
14581
  }
14582
14582
  ],
14583
14583
  "currency": "COP",
14584
+ "preceding": {
14585
+ "correction_methods": [
14586
+ {
14587
+ "key": "partial",
14588
+ "desc": {
14589
+ "en": "Partial refund of part of the goods or services.",
14590
+ "es": "Devolución de parte de los bienes; no aceptación de partes del servicio."
14591
+ },
14592
+ "meta": {
14593
+ "dian": "1"
14594
+ }
14595
+ },
14596
+ {
14597
+ "key": "revoked",
14598
+ "desc": {
14599
+ "en": "Previous document has been completely cancelled.",
14600
+ "es": "Anulación de la factura anterior."
14601
+ },
14602
+ "meta": {
14603
+ "dian": "2"
14604
+ }
14605
+ },
14606
+ {
14607
+ "key": "discount",
14608
+ "desc": {
14609
+ "en": "Partial or total discount.",
14610
+ "es": "Rebaja o descuento parcial o total."
14611
+ },
14612
+ "meta": {
14613
+ "dian": "3"
14614
+ }
14615
+ },
14616
+ {
14617
+ "key": "price-adjustment",
14618
+ "desc": {
14619
+ "en": "Ajuste de precio.",
14620
+ "es": "Price adjustment."
14621
+ },
14622
+ "meta": {
14623
+ "dian": "4"
14624
+ }
14625
+ },
14626
+ {
14627
+ "key": "other",
14628
+ "desc": {
14629
+ "en": "Otros.",
14630
+ "es": "Other."
14631
+ },
14632
+ "meta": {
14633
+ "dian": "5"
14634
+ }
14635
+ }
14636
+ ]
14637
+ },
14584
14638
  "categories": [
14585
14639
  {
14586
14640
  "code": "VAT",
@@ -14597,7 +14651,7 @@
14597
14651
  "key": "zero",
14598
14652
  "name": {
14599
14653
  "en": "Zero Rate",
14600
- "es": "Zero"
14654
+ "es": "Cero"
14601
14655
  },
14602
14656
  "values": [
14603
14657
  {