gobl 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -13
  3. data/data/regimes/es.json +55 -3
  4. data/data/regimes/it.json +1707 -0
  5. data/data/regimes/pt.json +272 -7
  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 +1 -1
  11. data/lib/{gobl → generated/gobl}/bill/line.rb +1 -1
  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 +1 -1
  16. data/lib/{gobl → generated/gobl}/bill/payment.rb +1 -1
  17. data/lib/{gobl → generated/gobl}/bill/preceding.rb +1 -2
  18. data/lib/{gobl → generated/gobl}/bill/tax.rb +1 -1
  19. data/lib/{gobl → generated/gobl}/bill/totals.rb +1 -1
  20. data/lib/{gobl → generated/gobl}/cal/date.rb +1 -1
  21. data/lib/{gobl → generated/gobl}/cal/period.rb +1 -1
  22. data/lib/{gobl → generated/gobl}/cbc/code.rb +1 -1
  23. data/lib/{gobl → generated/gobl}/cbc/key.rb +1 -1
  24. data/lib/{gobl → generated/gobl}/cbc/meta.rb +1 -1
  25. data/lib/generated/gobl/cbc/note.rb +68 -0
  26. data/lib/{gobl → generated/gobl}/cbc/stamp.rb +1 -1
  27. data/lib/{gobl → generated/gobl}/currency/code.rb +1 -1
  28. data/lib/{gobl → generated/gobl}/currency/exchange_rate.rb +1 -1
  29. data/lib/{gobl → generated/gobl}/document.rb +2 -2
  30. data/lib/{gobl → generated/gobl}/dsig/digest.rb +1 -1
  31. data/lib/{gobl → generated/gobl}/dsig/signature.rb +1 -1
  32. data/lib/{gobl → generated/gobl}/envelope.rb +1 -1
  33. data/lib/{gobl → generated/gobl}/header.rb +1 -1
  34. data/lib/{gobl → generated/gobl}/i18n/string.rb +1 -1
  35. data/lib/{gobl → generated/gobl}/l10n/code.rb +1 -1
  36. data/lib/{gobl → generated/gobl}/l10n/country_code.rb +1 -1
  37. data/lib/{gobl → generated/gobl}/note/message.rb +1 -1
  38. data/lib/{gobl → generated/gobl}/org/address.rb +1 -1
  39. data/lib/{gobl → generated/gobl}/org/coordinates.rb +1 -1
  40. data/lib/{gobl → generated/gobl}/org/email.rb +1 -1
  41. data/lib/{gobl → generated/gobl}/org/identity.rb +1 -1
  42. data/lib/{gobl → generated/gobl}/org/image.rb +1 -1
  43. data/lib/{gobl → generated/gobl}/org/inbox.rb +1 -1
  44. data/lib/{gobl → generated/gobl}/org/item.rb +1 -1
  45. data/lib/{gobl → generated/gobl}/org/name.rb +1 -1
  46. data/lib/{gobl → generated/gobl}/org/party.rb +1 -1
  47. data/lib/{gobl → generated/gobl}/org/person.rb +1 -1
  48. data/lib/{gobl → generated/gobl}/org/registration.rb +1 -1
  49. data/lib/{gobl → generated/gobl}/org/telephone.rb +1 -1
  50. data/lib/{gobl → generated/gobl}/org/unit.rb +1 -1
  51. data/lib/{gobl → generated/gobl}/org/website.rb +1 -1
  52. data/lib/{gobl → generated/gobl}/pay/advance.rb +1 -1
  53. data/lib/{gobl → generated/gobl}/pay/card.rb +1 -1
  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 +1 -1
  57. data/lib/{gobl → generated/gobl}/pay/instructions.rb +1 -1
  58. data/lib/{gobl → generated/gobl}/pay/online.rb +1 -1
  59. data/lib/{gobl → generated/gobl}/pay/terms.rb +1 -1
  60. data/lib/{gobl → generated/gobl}/tax/category.rb +1 -1
  61. data/lib/{gobl → generated/gobl}/tax/category_total.rb +1 -1
  62. data/lib/{gobl → generated/gobl}/tax/combo.rb +1 -1
  63. data/lib/{gobl → generated/gobl}/tax/identity.rb +4 -14
  64. data/lib/generated/gobl/tax/identity_type.rb +33 -0
  65. data/lib/{gobl → generated/gobl}/tax/key_definition.rb +1 -1
  66. data/lib/{gobl → generated/gobl}/tax/preceding_definitions.rb +1 -1
  67. data/lib/{gobl → generated/gobl}/tax/rate.rb +1 -1
  68. data/lib/{gobl → generated/gobl}/tax/rate_total.rb +1 -1
  69. data/lib/{gobl → generated/gobl}/tax/rate_total_surcharge.rb +1 -1
  70. data/lib/{gobl → generated/gobl}/tax/rate_value.rb +1 -1
  71. data/lib/{gobl → generated/gobl}/tax/regime.rb +6 -1
  72. data/lib/{gobl → generated/gobl}/tax/scenario.rb +1 -1
  73. data/lib/{gobl → generated/gobl}/tax/scenario_set.rb +1 -1
  74. data/lib/{gobl → generated/gobl}/tax/set.rb +1 -1
  75. data/lib/{gobl → generated/gobl}/tax/tag.rb +1 -1
  76. data/lib/{gobl → generated/gobl}/tax/total.rb +1 -1
  77. data/lib/{gobl → generated/gobl}/tax/zone.rb +1 -1
  78. data/lib/{gobl → generated/gobl}/uuid/uuid.rb +1 -1
  79. data/lib/gobl/version.rb +1 -1
  80. data/lib/gobl.rb +1 -0
  81. metadata +75 -74
  82. data/lib/gobl/cbc/note.rb +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 411d128fa9ef6abe37669b9cef151f814220c867e52a6293ba0d79ffd1b840fd
4
- data.tar.gz: 7580b135c8bba421d242f09c6273cc9ab12a29aaef1b5766a4b2cd47b8cb6e28
3
+ metadata.gz: d162daa116b9e2561aaed411ca059fcb926f150685dfd0682d403f5c0885f88c
4
+ data.tar.gz: 3aa58e456a8cbaa5bf1330020eeb6aca7b5a8afcbd151e414464dacd007899bf
5
5
  SHA512:
6
- metadata.gz: 90592d49b7ca8e7e52092c3c378770868efb59c07661dba09301df3bd33fab5653f3bd5ff9e9d35100d421a2894584a13221eb84e8b02fce675701aeace261eb
7
- data.tar.gz: b703c64f4c26d39dc24576c9875af0aaa4e25bfd42d46c19a6d322bc738d8d3c2aff31ddbd3e57ab4276bd2eae5aae1872622abc99f038dd7d5abf16a155ff49
6
+ metadata.gz: 7f2bd0ce77302a5286172352dd6d438ef6f36258ff7633a7aaf59b73f51b2c822c7051f29cfb09cdaf850fff6b225bc681c8a23287e2aa9d78fdbb1fae839850
7
+ data.tar.gz: dc18b7b9ea9ad8003da892bd91f3e4f78340f5b457322732f89d36400b142f118a339675d47b747bd97fd9a0d3fc1ded1a76784a738bc5c70a2e3a186ee96252
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/es.json CHANGED
@@ -503,6 +503,58 @@
503
503
  }
504
504
  ],
505
505
  "currency": "EUR",
506
+ "identity_types": [
507
+ {
508
+ "key": "fiscal",
509
+ "name": {
510
+ "en": "National Tax Identity",
511
+ "es": "Número de Identificación Fiscal"
512
+ },
513
+ "meta": {
514
+ "ticketbai-id-type": "02"
515
+ }
516
+ },
517
+ {
518
+ "key": "passport",
519
+ "name": {
520
+ "en": "Passport",
521
+ "es": "Pasaporte"
522
+ },
523
+ "meta": {
524
+ "ticketbai-id-type": "03"
525
+ }
526
+ },
527
+ {
528
+ "key": "foreign",
529
+ "name": {
530
+ "en": "National ID Card or similar from a foreign country",
531
+ "es": "Documento oficial de identificación expedido por el país o territorio de residencia"
532
+ },
533
+ "meta": {
534
+ "ticketbai-id-type": "04"
535
+ }
536
+ },
537
+ {
538
+ "key": "resident",
539
+ "name": {
540
+ "en": "Residential permit",
541
+ "es": "Certificado de residencia"
542
+ },
543
+ "meta": {
544
+ "ticketbai-id-type": "05"
545
+ }
546
+ },
547
+ {
548
+ "key": "other",
549
+ "name": {
550
+ "en": "An other type of source not listed",
551
+ "es": "Otro documento probatorio"
552
+ },
553
+ "meta": {
554
+ "ticketbai-id-type": "06"
555
+ }
556
+ }
557
+ ],
506
558
  "tags": [
507
559
  {
508
560
  "key": "simplified",
@@ -1171,10 +1223,10 @@
1171
1223
  ],
1172
1224
  "tags": [
1173
1225
  {
1174
- "key": "provider",
1226
+ "key": "resale",
1175
1227
  "name": {
1176
- "en": "Operation in equivalence surcharge or simplified regime",
1177
- "es": "Operacion en recargo de equivalencia o regimen simplificado"
1228
+ "en": "Resale of goods without modification by vendor in the simplified regime",
1229
+ "es": "Reventa de bienes sin modificación por vendedor en regimen simplificado"
1178
1230
  }
1179
1231
  },
1180
1232
  {