unova_factur_x 0.1.5 → 0.1.6

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: ea40c89024db0ae23f9c9ae3810842a3287fca547b7e71173cdad0a76484cef2
4
- data.tar.gz: 8e7fa13a6e7231e3c45b54d3d79c295355712546aac6341e0d055ed05171fcf5
3
+ metadata.gz: 299829abad969a5b27fb8e6a8d71d9974a0e1b7a71acb568df9dd4f758a71f10
4
+ data.tar.gz: c27542e2be6c3221796d51cba1a87c6145674be35ed009f66d133defde167a39
5
5
  SHA512:
6
- metadata.gz: a77cfcd8c5d379ed7db10607c23f992cc3e09d335b84a1bf3286611ef89b4997395ccfbde90e68f84ecde8672420d9a394d0b08f0b6e0dd2d6c293ba8e98da5d
7
- data.tar.gz: 0bb7a2cbc4cd9bedc7ff7a5e69e1048fabde9484d91f1e45001fd558dc11df0bf02b3b9feb1c21693310c2400a651c2068488b1ae197a70fe295df2e3e1b3268
6
+ metadata.gz: 998a32b89c7dde38d84f700184cab81a886ee1395f4bbb4fee1fbe21e9b865fd9c81bd5365b0dd75b3592bac9a2fb873bed46acba788f45747c4aead801f2071
7
+ data.tar.gz: ffccb78fcac8459b1ba135eeafea47bebc4e4867a27c64347fbae75e47f27fa5f446033e07d45b9d660943a238468a1eae2dfbff0253f9aa45093b2a285909b9
data/README.md CHANGED
@@ -31,9 +31,12 @@ The method accepts the following parameters:
31
31
  - `:credit` for a credit note,
32
32
  - [optional] with_validations: `true` or `false`, default as `true`. If true, the generated XML file will be checked using the validator. **WARNING: Java is required for this to work**
33
33
  - [optional] currency: To configure the used currency (Default is euros 'EUR').
34
+ - [optional] validator_profile: The validator used if with_validations is true:
35
+ - `:br_fr` for the French one (default value),
36
+ - `:en16931` for the global one
34
37
  ```ruby
35
38
  # Usage example:
36
- send_data UnovaFacturX.generate(pdf: pdf, document_hash: document_hash, type: :invoice, with_validations: true, currency: "USD"),
39
+ send_data UnovaFacturX.generate(pdf: pdf, document_hash: document_hash, type: :invoice, with_validations: true, currency: "USD", validator_profile: :en16931),
37
40
  filename: "Factur-X.pdf",
38
41
  type: 'application/pdf',
39
42
  disposition: 'attachment'
@@ -41,7 +44,6 @@ send_data UnovaFacturX.generate(pdf: pdf, document_hash: document_hash, type: :i
41
44
 
42
45
  ### Document hash structure overview
43
46
 
44
-
45
47
  For the expected document hash:
46
48
  - The document hash is a structured Ruby hash composed of the following main sections:
47
49
  - `seller`
@@ -61,7 +63,14 @@ document_hash = {
61
63
 
62
64
  seller: {
63
65
  name: "Seller legal name (BT-27) [REQUIRED]",
64
- legal_id: "Legal identifier (SIREN/SIRET) (BT-30) [OPTIONAL]",
66
+ legal_id: { # [REQUIRED IF BR_FR PROFILE, OTHERWISE OPTIONAL]
67
+ identifier: "Seller legal registration identifier (e.g. SIREN) (BT-30) [REQUIRED IN SIREN FORMAT (9 digits) IF BR_FR PROFILE, OTHERWISE OPTIONAL]",
68
+ scheme: "Legal registration identifier scheme (ICD), e.g. 0002 for SIREN, 0009 for SIRET (BT-30-1) [REQUIRED IF IDENTIFIER IS PROVIDED]"
69
+ },
70
+ electronic_address: { # [REQUIRED IF BR_FR PROFILE, OTHERWISE OPTIONAL]
71
+ identifier: "Seller electronic address (e.g. email address or Peppol endpoint) (BT-34) [REQUIRED IF BR_FR PROFILE, OTHERWISE OPTIONAL]",
72
+ scheme: "Electronic address scheme identifier (EAS code, e.g. EM for email, 0088 for GLN) [REQUIRED IF IDENTIFIER IS PROVIDED]"
73
+ },
65
74
  vat_number: "VAT number including buyer country prefix (e.g. FR123...) (BT-31) [OPTIONAL]",
66
75
  address: {
67
76
  line1: "Street address (BT-35) [REQUIRED]",
@@ -76,9 +85,17 @@ document_hash = {
76
85
  buyer: {
77
86
  id: "Internal customer identifier (BT-46) [OPTIONAL]",
78
87
  name: "Customer legal name (BT-44) [REQUIRED]",
88
+ legal_id: { # [REQUIRED IF BR_FR PROFILE, OTHERWISE OPTIONAL]
89
+ identifier: "Buyer legal registration identifier (e.g. SIREN) (BT-47) [REQUIRED IN SIREN FORMAT (9 digits) IF BR_FR PROFILE, OTHERWISE OPTIONAL]",
90
+ scheme: "Legal registration identifier scheme (ICD), e.g. 0002 for SIREN, 0009 for SIRET [REQUIRED IF IDENTIFIER IS PROVIDED]"
91
+ },
79
92
  vat_number: "VAT number including buyer country prefix (e.g. FR123...) (BT-48) [OPTIONAL]",
80
93
  contact: { # [OPTIONAL]
81
- name: "Customer contact name (BT-56) [OPTIONAL]",
94
+ name: "Customer contact name (BT-56) [OPTIONAL]",
95
+ },
96
+ electronic_address: { # [REQUIRED IF BR_FR PROFILE, OTHERWISE OPTIONAL]
97
+ identifier: "Buyer electronic address (e.g. email address or Peppol endpoint) (BT-49) [REQUIRED IF BR_FR PROFILE, OTHERWISE OPTIONAL]",
98
+ scheme: "Electronic address scheme identifier (EAS code, e.g. EM for email, 0088 for GLN) (BT-49-1) [REQUIRED IF IDENTIFIER IS PROVIDED]"
82
99
  },
83
100
  address: {
84
101
  line1: "Street address (BT-50) [REQUIRED]",
@@ -168,7 +185,16 @@ document_hash = {
168
185
  # due_date OR description [REQUIRED] if amount_due is defined and positive
169
186
  due_date: "Payment due date in YYYYMMDD format (BT-9)",
170
187
  description: "Payment terms (BT-20)"
171
- }
188
+ },
189
+
190
+ # [OPTIONAL BLOCK]
191
+ # IF BR_FR PROFILE, THIS BLOCK IS [REQUIRED] AND MUST CONTAIN AT LEAST THE AAB, PMD AND PMT NOTES
192
+ notes: [
193
+ {
194
+ content: "Free-text note content (BT-22) [REQUIRED if block is present]",
195
+ subject_code: "Note subject code (BT-21), e.g. AAB (early payment discount), PMD (late payment penalties), PMT (fixed recovery compensation) [OPTIONAL, REQUIRED IF BR_FR PROFILE FOR SOME NOTES SUCH AS AAB, PMD AND PMT]"
196
+ },
197
+ ]
172
198
  }
173
199
  ```
174
200