e-invoice-api 0.11.0 → 0.12.0

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +2 -2
  4. data/lib/e_invoice_api/models/allowance.rb +42 -14
  5. data/lib/e_invoice_api/models/charge.rb +193 -4
  6. data/lib/e_invoice_api/models/document_create.rb +721 -120
  7. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +123 -58
  8. data/lib/e_invoice_api/models/document_response.rb +373 -80
  9. data/lib/e_invoice_api/models/me_retrieve_response.rb +21 -7
  10. data/lib/e_invoice_api/models/payment_detail_create.rb +15 -4
  11. data/lib/e_invoice_api/resources/documents.rb +42 -38
  12. data/lib/e_invoice_api/resources/validate.rb +42 -38
  13. data/lib/e_invoice_api/version.rb +1 -1
  14. data/rbi/e_invoice_api/models/allowance.rbi +81 -21
  15. data/rbi/e_invoice_api/models/charge.rbi +202 -5
  16. data/rbi/e_invoice_api/models/document_create.rbi +3085 -702
  17. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +136 -30
  18. data/rbi/e_invoice_api/models/document_response.rbi +1232 -58
  19. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +20 -6
  20. data/rbi/e_invoice_api/models/payment_detail_create.rbi +10 -0
  21. data/rbi/e_invoice_api/resources/documents.rbi +51 -10
  22. data/rbi/e_invoice_api/resources/validate.rbi +51 -10
  23. data/sig/e_invoice_api/models/allowance.rbs +59 -8
  24. data/sig/e_invoice_api/models/charge.rbs +369 -4
  25. data/sig/e_invoice_api/models/document_create.rbs +939 -44
  26. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +15 -0
  27. data/sig/e_invoice_api/models/document_response.rbs +443 -12
  28. data/sig/e_invoice_api/models/me_retrieve_response.rbs +5 -0
  29. data/sig/e_invoice_api/resources/documents.rbs +2 -0
  30. data/sig/e_invoice_api/resources/validate.rbs +2 -0
  31. metadata +2 -2
@@ -17,8 +17,7 @@ module EInvoiceAPI
17
17
  nil?: true
18
18
 
19
19
  # @!attribute amount_due
20
- # The amount due of the invoice. Must be positive and rounded to maximum 2
21
- # decimals
20
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
22
21
  #
23
22
  # @return [String, nil]
24
23
  optional :amount_due, String, nil?: true
@@ -31,11 +30,13 @@ module EInvoiceAPI
31
30
  nil?: true
32
31
 
33
32
  # @!attribute billing_address
33
+ # The billing address (if different from customer address)
34
34
  #
35
35
  # @return [String, nil]
36
36
  optional :billing_address, String, nil?: true
37
37
 
38
38
  # @!attribute billing_address_recipient
39
+ # The recipient name at the billing address
39
40
  #
40
41
  # @return [String, nil]
41
42
  optional :billing_address_recipient, String, nil?: true
@@ -48,69 +49,88 @@ module EInvoiceAPI
48
49
  nil?: true
49
50
 
50
51
  # @!attribute currency
51
- # Currency of the invoice
52
+ # Currency of the invoice (ISO 4217 currency code)
52
53
  #
53
54
  # @return [Symbol, EInvoiceAPI::Models::CurrencyCode, nil]
54
55
  optional :currency, enum: -> { EInvoiceAPI::CurrencyCode }
55
56
 
56
57
  # @!attribute customer_address
58
+ # The address of the customer/buyer
57
59
  #
58
60
  # @return [String, nil]
59
61
  optional :customer_address, String, nil?: true
60
62
 
61
63
  # @!attribute customer_address_recipient
64
+ # The recipient name at the customer address
62
65
  #
63
66
  # @return [String, nil]
64
67
  optional :customer_address_recipient, String, nil?: true
65
68
 
69
+ # @!attribute customer_company_id
70
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
71
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
72
+ #
73
+ # @return [String, nil]
74
+ optional :customer_company_id, String, nil?: true
75
+
66
76
  # @!attribute customer_email
77
+ # The email address of the customer
67
78
  #
68
79
  # @return [String, nil]
69
80
  optional :customer_email, String, nil?: true
70
81
 
71
82
  # @!attribute customer_id
83
+ # The unique identifier for the customer in your system
72
84
  #
73
85
  # @return [String, nil]
74
86
  optional :customer_id, String, nil?: true
75
87
 
76
88
  # @!attribute customer_name
89
+ # The company name of the customer/buyer
77
90
  #
78
91
  # @return [String, nil]
79
92
  optional :customer_name, String, nil?: true
80
93
 
81
94
  # @!attribute customer_tax_id
95
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
96
+ # prefix
82
97
  #
83
98
  # @return [String, nil]
84
99
  optional :customer_tax_id, String, nil?: true
85
100
 
86
101
  # @!attribute direction
102
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
87
103
  #
88
104
  # @return [Symbol, EInvoiceAPI::Models::DocumentDirection, nil]
89
105
  optional :direction, enum: -> { EInvoiceAPI::DocumentDirection }
90
106
 
91
107
  # @!attribute document_type
108
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
92
109
  #
93
110
  # @return [Symbol, EInvoiceAPI::Models::DocumentType, nil]
94
111
  optional :document_type, enum: -> { EInvoiceAPI::DocumentType }
95
112
 
96
113
  # @!attribute due_date
114
+ # The date when payment is due
97
115
  #
98
116
  # @return [Date, nil]
99
117
  optional :due_date, Date, nil?: true
100
118
 
101
119
  # @!attribute invoice_date
120
+ # The date when the invoice was issued
102
121
  #
103
122
  # @return [Date, nil]
104
123
  optional :invoice_date, Date, nil?: true
105
124
 
106
125
  # @!attribute invoice_id
126
+ # The unique invoice identifier/number
107
127
  #
108
128
  # @return [String, nil]
109
129
  optional :invoice_id, String, nil?: true
110
130
 
111
131
  # @!attribute invoice_total
112
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
113
- # total_discount). Must be positive and rounded to maximum 2 decimals
132
+ # The total amount of the invoice including tax (invoice_total = subtotal +
133
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
114
134
  #
115
135
  # @return [String, nil]
116
136
  optional :invoice_total, String, nil?: true
@@ -123,6 +143,7 @@ module EInvoiceAPI
123
143
  nil?: true
124
144
 
125
145
  # @!attribute note
146
+ # Additional notes or comments for the invoice
126
147
  #
127
148
  # @return [String, nil]
128
149
  optional :note, String, nil?: true
@@ -135,63 +156,74 @@ module EInvoiceAPI
135
156
  nil?: true
136
157
 
137
158
  # @!attribute payment_term
159
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
138
160
  #
139
161
  # @return [String, nil]
140
162
  optional :payment_term, String, nil?: true
141
163
 
142
164
  # @!attribute previous_unpaid_balance
143
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
144
- # to maximum 2 decimals
165
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
166
+ # rounded to maximum 2 decimals
145
167
  #
146
168
  # @return [String, nil]
147
169
  optional :previous_unpaid_balance, String, nil?: true
148
170
 
149
171
  # @!attribute purchase_order
172
+ # The purchase order reference number
150
173
  #
151
174
  # @return [String, nil]
152
175
  optional :purchase_order, String, nil?: true
153
176
 
154
177
  # @!attribute remittance_address
178
+ # The address where payment should be sent or remitted to
155
179
  #
156
180
  # @return [String, nil]
157
181
  optional :remittance_address, String, nil?: true
158
182
 
159
183
  # @!attribute remittance_address_recipient
184
+ # The recipient name at the remittance address
160
185
  #
161
186
  # @return [String, nil]
162
187
  optional :remittance_address_recipient, String, nil?: true
163
188
 
164
189
  # @!attribute service_address
190
+ # The address where services were performed or goods were delivered
165
191
  #
166
192
  # @return [String, nil]
167
193
  optional :service_address, String, nil?: true
168
194
 
169
195
  # @!attribute service_address_recipient
196
+ # The recipient name at the service address
170
197
  #
171
198
  # @return [String, nil]
172
199
  optional :service_address_recipient, String, nil?: true
173
200
 
174
201
  # @!attribute service_end_date
202
+ # The end date of the service period or delivery period
175
203
  #
176
204
  # @return [Date, nil]
177
205
  optional :service_end_date, Date, nil?: true
178
206
 
179
207
  # @!attribute service_start_date
208
+ # The start date of the service period or delivery period
180
209
  #
181
210
  # @return [Date, nil]
182
211
  optional :service_start_date, Date, nil?: true
183
212
 
184
213
  # @!attribute shipping_address
214
+ # The shipping/delivery address
185
215
  #
186
216
  # @return [String, nil]
187
217
  optional :shipping_address, String, nil?: true
188
218
 
189
219
  # @!attribute shipping_address_recipient
220
+ # The recipient name at the shipping address
190
221
  #
191
222
  # @return [String, nil]
192
223
  optional :shipping_address_recipient, String, nil?: true
193
224
 
194
225
  # @!attribute state
226
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
195
227
  #
196
228
  # @return [Symbol, EInvoiceAPI::Models::DocumentState, nil]
197
229
  optional :state, enum: -> { EInvoiceAPI::DocumentState }
@@ -205,7 +237,8 @@ module EInvoiceAPI
205
237
  optional :subtotal, String, nil?: true
206
238
 
207
239
  # @!attribute tax_code
208
- # Tax category code of the invoice
240
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
241
+ # for exempt)
209
242
  #
210
243
  # @return [Symbol, EInvoiceAPI::Models::DocumentResponse::TaxCode, nil]
211
244
  optional :tax_code, enum: -> { EInvoiceAPI::DocumentResponse::TaxCode }
@@ -226,7 +259,8 @@ module EInvoiceAPI
226
259
  optional :total_discount, String, nil?: true
227
260
 
228
261
  # @!attribute total_tax
229
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
262
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
263
+ # decimals
230
264
  #
231
265
  # @return [String, nil]
232
266
  optional :total_tax, String, nil?: true
@@ -240,37 +274,50 @@ module EInvoiceAPI
240
274
  optional :vatex, enum: -> { EInvoiceAPI::DocumentResponse::Vatex }, nil?: true
241
275
 
242
276
  # @!attribute vatex_note
243
- # VAT exemption note of the invoice
277
+ # Textual explanation for VAT exemption
244
278
  #
245
279
  # @return [String, nil]
246
280
  optional :vatex_note, String, nil?: true
247
281
 
248
282
  # @!attribute vendor_address
283
+ # The address of the vendor/seller
249
284
  #
250
285
  # @return [String, nil]
251
286
  optional :vendor_address, String, nil?: true
252
287
 
253
288
  # @!attribute vendor_address_recipient
289
+ # The recipient name at the vendor address
254
290
  #
255
291
  # @return [String, nil]
256
292
  optional :vendor_address_recipient, String, nil?: true
257
293
 
294
+ # @!attribute vendor_company_id
295
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
296
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
297
+ #
298
+ # @return [String, nil]
299
+ optional :vendor_company_id, String, nil?: true
300
+
258
301
  # @!attribute vendor_email
302
+ # The email address of the vendor
259
303
  #
260
304
  # @return [String, nil]
261
305
  optional :vendor_email, String, nil?: true
262
306
 
263
307
  # @!attribute vendor_name
308
+ # The name of the vendor/seller/supplier
264
309
  #
265
310
  # @return [String, nil]
266
311
  optional :vendor_name, String, nil?: true
267
312
 
268
313
  # @!attribute vendor_tax_id
314
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
315
+ # prefix
269
316
  #
270
317
  # @return [String, nil]
271
318
  optional :vendor_tax_id, String, nil?: true
272
319
 
273
- # @!method initialize(id:, allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil)
320
+ # @!method initialize(id:, allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_company_id: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil)
274
321
  # Some parameter documentations has been truncated, see
275
322
  # {EInvoiceAPI::Models::DocumentResponse} for more details.
276
323
  #
@@ -278,95 +325,99 @@ module EInvoiceAPI
278
325
  #
279
326
  # @param allowances [Array<EInvoiceAPI::Models::DocumentResponse::Allowance>, nil]
280
327
  #
281
- # @param amount_due [String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
328
+ # @param amount_due [String, nil] The amount due for payment. Must be positive and rounded to maximum 2 decimals
282
329
  #
283
330
  # @param attachments [Array<EInvoiceAPI::Models::Documents::DocumentAttachment>, nil]
284
331
  #
285
- # @param billing_address [String, nil]
332
+ # @param billing_address [String, nil] The billing address (if different from customer address)
286
333
  #
287
- # @param billing_address_recipient [String, nil]
334
+ # @param billing_address_recipient [String, nil] The recipient name at the billing address
288
335
  #
289
336
  # @param charges [Array<EInvoiceAPI::Models::DocumentResponse::Charge>, nil]
290
337
  #
291
- # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
338
+ # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice (ISO 4217 currency code)
339
+ #
340
+ # @param customer_address [String, nil] The address of the customer/buyer
292
341
  #
293
- # @param customer_address [String, nil]
342
+ # @param customer_address_recipient [String, nil] The recipient name at the customer address
294
343
  #
295
- # @param customer_address_recipient [String, nil]
344
+ # @param customer_company_id [String, nil] Customer company ID. For Belgium this is the CBE number or their EUID (European
296
345
  #
297
- # @param customer_email [String, nil]
346
+ # @param customer_email [String, nil] The email address of the customer
298
347
  #
299
- # @param customer_id [String, nil]
348
+ # @param customer_id [String, nil] The unique identifier for the customer in your system
300
349
  #
301
- # @param customer_name [String, nil]
350
+ # @param customer_name [String, nil] The company name of the customer/buyer
302
351
  #
303
- # @param customer_tax_id [String, nil]
352
+ # @param customer_tax_id [String, nil] Customer tax ID. For Belgium this is the VAT number. Must include the country pr
304
353
  #
305
- # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection]
354
+ # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
306
355
  #
307
- # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType]
356
+ # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType] The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
308
357
  #
309
- # @param due_date [Date, nil]
358
+ # @param due_date [Date, nil] The date when payment is due
310
359
  #
311
- # @param invoice_date [Date, nil]
360
+ # @param invoice_date [Date, nil] The date when the invoice was issued
312
361
  #
313
- # @param invoice_id [String, nil]
362
+ # @param invoice_id [String, nil] The unique invoice identifier/number
314
363
  #
315
- # @param invoice_total [String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
364
+ # @param invoice_total [String, nil] The total amount of the invoice including tax (invoice*total = subtotal + total*
316
365
  #
317
366
  # @param items [Array<EInvoiceAPI::Models::DocumentResponse::Item>, nil]
318
367
  #
319
- # @param note [String, nil]
368
+ # @param note [String, nil] Additional notes or comments for the invoice
320
369
  #
321
370
  # @param payment_details [Array<EInvoiceAPI::Models::DocumentResponse::PaymentDetail>, nil]
322
371
  #
323
- # @param payment_term [String, nil]
372
+ # @param payment_term [String, nil] The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
324
373
  #
325
- # @param previous_unpaid_balance [String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
374
+ # @param previous_unpaid_balance [String, nil] The previous unpaid balance from prior invoices, if any. Must be positive and ro
326
375
  #
327
- # @param purchase_order [String, nil]
376
+ # @param purchase_order [String, nil] The purchase order reference number
328
377
  #
329
- # @param remittance_address [String, nil]
378
+ # @param remittance_address [String, nil] The address where payment should be sent or remitted to
330
379
  #
331
- # @param remittance_address_recipient [String, nil]
380
+ # @param remittance_address_recipient [String, nil] The recipient name at the remittance address
332
381
  #
333
- # @param service_address [String, nil]
382
+ # @param service_address [String, nil] The address where services were performed or goods were delivered
334
383
  #
335
- # @param service_address_recipient [String, nil]
384
+ # @param service_address_recipient [String, nil] The recipient name at the service address
336
385
  #
337
- # @param service_end_date [Date, nil]
386
+ # @param service_end_date [Date, nil] The end date of the service period or delivery period
338
387
  #
339
- # @param service_start_date [Date, nil]
388
+ # @param service_start_date [Date, nil] The start date of the service period or delivery period
340
389
  #
341
- # @param shipping_address [String, nil]
390
+ # @param shipping_address [String, nil] The shipping/delivery address
342
391
  #
343
- # @param shipping_address_recipient [String, nil]
392
+ # @param shipping_address_recipient [String, nil] The recipient name at the shipping address
344
393
  #
345
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState]
394
+ # @param state [Symbol, EInvoiceAPI::Models::DocumentState] The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
346
395
  #
347
396
  # @param subtotal [String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
348
397
  #
349
- # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::TaxCode] Tax category code of the invoice
398
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::TaxCode] Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
350
399
  #
351
400
  # @param tax_details [Array<EInvoiceAPI::Models::DocumentResponse::TaxDetail>, nil]
352
401
  #
353
402
  # @param total_discount [String, nil] The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
354
403
  #
355
- # @param total_tax [String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
404
+ # @param total_tax [String, nil] The total tax amount of the invoice. Must be positive and rounded to maximum 2 d
356
405
  #
357
406
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentResponse::Vatex, nil] VATEX code list for VAT exemption reasons
358
407
  #
359
- # @param vatex_note [String, nil] VAT exemption note of the invoice
408
+ # @param vatex_note [String, nil] Textual explanation for VAT exemption
360
409
  #
361
- # @param vendor_address [String, nil]
410
+ # @param vendor_address [String, nil] The address of the vendor/seller
362
411
  #
363
- # @param vendor_address_recipient [String, nil]
412
+ # @param vendor_address_recipient [String, nil] The recipient name at the vendor address
364
413
  #
365
- # @param vendor_email [String, nil]
414
+ # @param vendor_company_id [String, nil] Vendor company ID. For Belgium this is the CBE number or their EUID (European Un
366
415
  #
367
- # @param vendor_name [String, nil]
416
+ # @param vendor_email [String, nil] The email address of the vendor
368
417
  #
369
- # @param vendor_tax_id [String, nil]
418
+ # @param vendor_name [String, nil] The name of the vendor/seller/supplier
419
+ #
420
+ # @param vendor_tax_id [String, nil] Vendor tax ID. For Belgium this is the VAT number. Must include the country pref
370
421
 
371
422
  class Allowance < EInvoiceAPI::Internal::Type::BaseModel
372
423
  # @!attribute amount
@@ -384,7 +435,8 @@ module EInvoiceAPI
384
435
 
385
436
  # @!attribute multiplier_factor
386
437
  # The percentage that may be used, in conjunction with the allowance base amount,
387
- # to calculate the allowance amount. To state 20%, use value 20
438
+ # to calculate the allowance amount. To state 20%, use value 20. Must be rounded
439
+ # to maximum 2 decimals
388
440
  #
389
441
  # @return [String, nil]
390
442
  optional :multiplier_factor, String, nil?: true
@@ -396,21 +448,20 @@ module EInvoiceAPI
396
448
  optional :reason, String, nil?: true
397
449
 
398
450
  # @!attribute reason_code
399
- # The code for the allowance reason
451
+ # Allowance reason codes for invoice discounts and charges
400
452
  #
401
- # @return [String, nil]
402
- optional :reason_code, String, nil?: true
453
+ # @return [Symbol, EInvoiceAPI::Models::DocumentResponse::Allowance::ReasonCode, nil]
454
+ optional :reason_code, enum: -> { EInvoiceAPI::DocumentResponse::Allowance::ReasonCode }, nil?: true
403
455
 
404
456
  # @!attribute tax_code
405
- # Duty or tax or fee category codes (Subset of UNCL5305)
406
- #
407
- # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
457
+ # The VAT category code that applies to the allowance
408
458
  #
409
459
  # @return [Symbol, EInvoiceAPI::Models::DocumentResponse::Allowance::TaxCode, nil]
410
- optional :tax_code, enum: -> { EInvoiceAPI::DocumentResponse::Allowance::TaxCode }, nil?: true
460
+ optional :tax_code, enum: -> { EInvoiceAPI::DocumentResponse::Allowance::TaxCode }
411
461
 
412
462
  # @!attribute tax_rate
413
- # The VAT rate, represented as percentage that applies to the allowance
463
+ # The VAT rate, represented as percentage that applies to the allowance. Must be
464
+ # rounded to maximum 2 decimals
414
465
  #
415
466
  # @return [String, nil]
416
467
  optional :tax_rate, String, nil?: true
@@ -427,15 +478,43 @@ module EInvoiceAPI
427
478
  #
428
479
  # @param reason [String, nil] The reason for the allowance
429
480
  #
430
- # @param reason_code [String, nil] The code for the allowance reason
481
+ # @param reason_code [Symbol, EInvoiceAPI::Models::DocumentResponse::Allowance::ReasonCode, nil] Allowance reason codes for invoice discounts and charges
431
482
  #
432
- # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::Allowance::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
483
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::Allowance::TaxCode] The VAT category code that applies to the allowance
433
484
  #
434
- # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the allowance
485
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the allowance. Must be r
435
486
 
436
- # Duty or tax or fee category codes (Subset of UNCL5305)
487
+ # Allowance reason codes for invoice discounts and charges
437
488
  #
438
- # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
489
+ # @see EInvoiceAPI::Models::DocumentResponse::Allowance#reason_code
490
+ module ReasonCode
491
+ extend EInvoiceAPI::Internal::Type::Enum
492
+
493
+ REASON_CODE_41 = :"41"
494
+ REASON_CODE_42 = :"42"
495
+ REASON_CODE_60 = :"60"
496
+ REASON_CODE_62 = :"62"
497
+ REASON_CODE_63 = :"63"
498
+ REASON_CODE_64 = :"64"
499
+ REASON_CODE_65 = :"65"
500
+ REASON_CODE_66 = :"66"
501
+ REASON_CODE_67 = :"67"
502
+ REASON_CODE_68 = :"68"
503
+ REASON_CODE_70 = :"70"
504
+ REASON_CODE_71 = :"71"
505
+ REASON_CODE_88 = :"88"
506
+ REASON_CODE_95 = :"95"
507
+ REASON_CODE_100 = :"100"
508
+ REASON_CODE_102 = :"102"
509
+ REASON_CODE_103 = :"103"
510
+ REASON_CODE_104 = :"104"
511
+ REASON_CODE_105 = :"105"
512
+
513
+ # @!method self.values
514
+ # @return [Array<Symbol>]
515
+ end
516
+
517
+ # The VAT category code that applies to the allowance
439
518
  #
440
519
  # @see EInvoiceAPI::Models::DocumentResponse::Allowance#tax_code
441
520
  module TaxCode
@@ -485,10 +564,10 @@ module EInvoiceAPI
485
564
  optional :reason, String, nil?: true
486
565
 
487
566
  # @!attribute reason_code
488
- # The code for the charge reason
567
+ # Charge reason codes for invoice charges and fees
489
568
  #
490
- # @return [String, nil]
491
- optional :reason_code, String, nil?: true
569
+ # @return [Symbol, EInvoiceAPI::Models::DocumentResponse::Charge::ReasonCode, nil]
570
+ optional :reason_code, enum: -> { EInvoiceAPI::DocumentResponse::Charge::ReasonCode }, nil?: true
492
571
 
493
572
  # @!attribute tax_code
494
573
  # Duty or tax or fee category codes (Subset of UNCL5305)
@@ -516,12 +595,201 @@ module EInvoiceAPI
516
595
  #
517
596
  # @param reason [String, nil] The reason for the charge
518
597
  #
519
- # @param reason_code [String, nil] The code for the charge reason
598
+ # @param reason_code [Symbol, EInvoiceAPI::Models::DocumentResponse::Charge::ReasonCode, nil] Charge reason codes for invoice charges and fees
520
599
  #
521
600
  # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentResponse::Charge::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
522
601
  #
523
602
  # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the charge
524
603
 
604
+ # Charge reason codes for invoice charges and fees
605
+ #
606
+ # @see EInvoiceAPI::Models::DocumentResponse::Charge#reason_code
607
+ module ReasonCode
608
+ extend EInvoiceAPI::Internal::Type::Enum
609
+
610
+ AA = :AA
611
+ AAA = :AAA
612
+ AAC = :AAC
613
+ AAD = :AAD
614
+ AAE = :AAE
615
+ AAF = :AAF
616
+ AAH = :AAH
617
+ AAI = :AAI
618
+ AAS = :AAS
619
+ AAT = :AAT
620
+ AAV = :AAV
621
+ AAY = :AAY
622
+ AAZ = :AAZ
623
+ ABA = :ABA
624
+ ABB = :ABB
625
+ ABC = :ABC
626
+ ABD = :ABD
627
+ ABF = :ABF
628
+ ABK = :ABK
629
+ ABL = :ABL
630
+ ABN = :ABN
631
+ ABR = :ABR
632
+ ABS = :ABS
633
+ ABT = :ABT
634
+ ABU = :ABU
635
+ ACF = :ACF
636
+ ACG = :ACG
637
+ ACH = :ACH
638
+ ACI = :ACI
639
+ ACJ = :ACJ
640
+ ACK = :ACK
641
+ ACL = :ACL
642
+ ACM = :ACM
643
+ ACS = :ACS
644
+ ADC = :ADC
645
+ ADE = :ADE
646
+ ADJ = :ADJ
647
+ ADK = :ADK
648
+ ADL = :ADL
649
+ ADM = :ADM
650
+ ADN = :ADN
651
+ ADO = :ADO
652
+ ADP = :ADP
653
+ ADQ = :ADQ
654
+ ADR = :ADR
655
+ ADT = :ADT
656
+ ADW = :ADW
657
+ ADY = :ADY
658
+ ADZ = :ADZ
659
+ AEA = :AEA
660
+ AEB = :AEB
661
+ AEC = :AEC
662
+ AED = :AED
663
+ AEF = :AEF
664
+ AEH = :AEH
665
+ AEI = :AEI
666
+ AEJ = :AEJ
667
+ AEK = :AEK
668
+ AEL = :AEL
669
+ AEM = :AEM
670
+ AEN = :AEN
671
+ AEO = :AEO
672
+ AEP = :AEP
673
+ AES = :AES
674
+ AET = :AET
675
+ AEU = :AEU
676
+ AEV = :AEV
677
+ AEW = :AEW
678
+ AEX = :AEX
679
+ AEY = :AEY
680
+ AEZ = :AEZ
681
+ AJ = :AJ
682
+ AU = :AU
683
+ CA = :CA
684
+ CAB = :CAB
685
+ CAD = :CAD
686
+ CAE = :CAE
687
+ CAF = :CAF
688
+ CAI = :CAI
689
+ CAJ = :CAJ
690
+ CAK = :CAK
691
+ CAL = :CAL
692
+ CAM = :CAM
693
+ CAN = :CAN
694
+ CAO = :CAO
695
+ CAP = :CAP
696
+ CAQ = :CAQ
697
+ CAR = :CAR
698
+ CAS = :CAS
699
+ CAT = :CAT
700
+ CAU = :CAU
701
+ CAV = :CAV
702
+ CAW = :CAW
703
+ CAX = :CAX
704
+ CAY = :CAY
705
+ CAZ = :CAZ
706
+ CD = :CD
707
+ CG = :CG
708
+ CS = :CS
709
+ CT = :CT
710
+ DAB = :DAB
711
+ DAC = :DAC
712
+ DAD = :DAD
713
+ DAF = :DAF
714
+ DAG = :DAG
715
+ DAH = :DAH
716
+ DAI = :DAI
717
+ DAJ = :DAJ
718
+ DAK = :DAK
719
+ DAL = :DAL
720
+ DAM = :DAM
721
+ DAN = :DAN
722
+ DAO = :DAO
723
+ DAP = :DAP
724
+ DAQ = :DAQ
725
+ DL = :DL
726
+ EG = :EG
727
+ EP = :EP
728
+ ER = :ER
729
+ FAA = :FAA
730
+ FAB = :FAB
731
+ FAC = :FAC
732
+ FC = :FC
733
+ FH = :FH
734
+ FI = :FI
735
+ GAA = :GAA
736
+ HAA = :HAA
737
+ HD = :HD
738
+ HH = :HH
739
+ IAA = :IAA
740
+ IAB = :IAB
741
+ ID = :ID
742
+ IF = :IF
743
+ IR = :IR
744
+ IS = :IS
745
+ KO = :KO
746
+ L1 = :L1
747
+ LA = :LA
748
+ LAA = :LAA
749
+ LAB = :LAB
750
+ LF = :LF
751
+ MAE = :MAE
752
+ MI = :MI
753
+ ML = :ML
754
+ NAA = :NAA
755
+ OA = :OA
756
+ PA = :PA
757
+ PAA = :PAA
758
+ PC = :PC
759
+ PL = :PL
760
+ PRV = :PRV
761
+ RAB = :RAB
762
+ RAC = :RAC
763
+ RAD = :RAD
764
+ RAF = :RAF
765
+ RE = :RE
766
+ RF = :RF
767
+ RH = :RH
768
+ RV = :RV
769
+ SA = :SA
770
+ SAA = :SAA
771
+ SAD = :SAD
772
+ SAE = :SAE
773
+ SAI = :SAI
774
+ SG = :SG
775
+ SH = :SH
776
+ SM = :SM
777
+ SU = :SU
778
+ TAB = :TAB
779
+ TAC = :TAC
780
+ TT = :TT
781
+ TV = :TV
782
+ V1 = :V1
783
+ V2 = :V2
784
+ WH = :WH
785
+ XAA = :XAA
786
+ YY = :YY
787
+ ZZZ = :ZZZ
788
+
789
+ # @!method self.values
790
+ # @return [Array<Symbol>]
791
+ end
792
+
525
793
  # Duty or tax or fee category codes (Subset of UNCL5305)
526
794
  #
527
795
  # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
@@ -554,9 +822,9 @@ module EInvoiceAPI
554
822
  optional :allowances, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Allowance] }, nil?: true
555
823
 
556
824
  # @!attribute amount
557
- # The total amount of the line item, exclusive of VAT, after subtracting line
558
- # level allowances and adding line level charges. Must be rounded to maximum 2
559
- # decimals
825
+ # The invoice line net amount (BT-131), exclusive of VAT, inclusive of line level
826
+ # allowances and charges. Calculated as: ((unit_price / price_base_quantity) \*
827
+ # quantity) - allowances + charges. Must be rounded to maximum 2 decimals
560
828
  #
561
829
  # @return [String, nil]
562
830
  optional :amount, String, nil?: true
@@ -578,6 +846,13 @@ module EInvoiceAPI
578
846
  # @return [String, nil]
579
847
  optional :description, String, nil?: true
580
848
 
849
+ # @!attribute price_base_quantity
850
+ # The item price base quantity (BT-149). The number of item units to which the
851
+ # price applies. Defaults to 1. Must be rounded to maximum 4 decimals
852
+ #
853
+ # @return [String, nil]
854
+ optional :price_base_quantity, String, nil?: true
855
+
581
856
  # @!attribute product_code
582
857
  # The product code of the line item.
583
858
  #
@@ -610,18 +885,19 @@ module EInvoiceAPI
610
885
  optional :unit, enum: -> { EInvoiceAPI::UnitOfMeasureCode }, nil?: true
611
886
 
612
887
  # @!attribute unit_price
613
- # The unit price of the line item. Must be rounded to maximum 2 decimals
888
+ # The item net price (BT-146). The price of an item, exclusive of VAT, after
889
+ # subtracting item price discount. Must be rounded to maximum 4 decimals
614
890
  #
615
891
  # @return [String, nil]
616
892
  optional :unit_price, String, nil?: true
617
893
 
618
- # @!method initialize(allowances: nil, amount: nil, charges: nil, date: nil, description: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
894
+ # @!method initialize(allowances: nil, amount: nil, charges: nil, date: nil, description: nil, price_base_quantity: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
619
895
  # Some parameter documentations has been truncated, see
620
896
  # {EInvoiceAPI::Models::DocumentResponse::Item} for more details.
621
897
  #
622
898
  # @param allowances [Array<EInvoiceAPI::Models::Allowance>, nil] The allowances of the line item.
623
899
  #
624
- # @param amount [String, nil] The total amount of the line item, exclusive of VAT, after subtracting line leve
900
+ # @param amount [String, nil] The invoice line net amount (BT-131), exclusive of VAT, inclusive of line level
625
901
  #
626
902
  # @param charges [Array<EInvoiceAPI::Models::Charge>, nil] The charges of the line item.
627
903
  #
@@ -629,6 +905,8 @@ module EInvoiceAPI
629
905
  #
630
906
  # @param description [String, nil] The description of the line item.
631
907
  #
908
+ # @param price_base_quantity [String, nil] The item price base quantity (BT-149). The number of item units to which the pri
909
+ #
632
910
  # @param product_code [String, nil] The product code of the line item.
633
911
  #
634
912
  # @param quantity [String, nil] The quantity of items (goods or services) that is the subject of the line item.
@@ -639,38 +917,50 @@ module EInvoiceAPI
639
917
  #
640
918
  # @param unit [Symbol, EInvoiceAPI::Models::UnitOfMeasureCode, nil] Unit of Measure Codes from UNECERec20 used in Peppol BIS Billing 3.0.
641
919
  #
642
- # @param unit_price [String, nil] The unit price of the line item. Must be rounded to maximum 2 decimals
920
+ # @param unit_price [String, nil] The item net price (BT-146). The price of an item, exclusive of VAT, after subtr
643
921
  end
644
922
 
645
923
  class PaymentDetail < EInvoiceAPI::Internal::Type::BaseModel
646
924
  # @!attribute bank_account_number
925
+ # Bank account number (for non-IBAN accounts)
647
926
  #
648
927
  # @return [String, nil]
649
928
  optional :bank_account_number, String, nil?: true
650
929
 
651
930
  # @!attribute iban
931
+ # International Bank Account Number for payment transfers
652
932
  #
653
933
  # @return [String, nil]
654
934
  optional :iban, String, nil?: true
655
935
 
656
936
  # @!attribute payment_reference
937
+ # Structured payment reference or communication (e.g., structured communication
938
+ # for Belgian bank transfers)
657
939
  #
658
940
  # @return [String, nil]
659
941
  optional :payment_reference, String, nil?: true
660
942
 
661
943
  # @!attribute swift
944
+ # SWIFT/BIC code of the bank
662
945
  #
663
946
  # @return [String, nil]
664
947
  optional :swift, String, nil?: true
665
948
 
666
949
  # @!method initialize(bank_account_number: nil, iban: nil, payment_reference: nil, swift: nil)
667
- # @param bank_account_number [String, nil]
668
- # @param iban [String, nil]
669
- # @param payment_reference [String, nil]
670
- # @param swift [String, nil]
950
+ # Some parameter documentations has been truncated, see
951
+ # {EInvoiceAPI::Models::DocumentResponse::PaymentDetail} for more details.
952
+ #
953
+ # @param bank_account_number [String, nil] Bank account number (for non-IBAN accounts)
954
+ #
955
+ # @param iban [String, nil] International Bank Account Number for payment transfers
956
+ #
957
+ # @param payment_reference [String, nil] Structured payment reference or communication (e.g., structured communication fo
958
+ #
959
+ # @param swift [String, nil] SWIFT/BIC code of the bank
671
960
  end
672
961
 
673
- # Tax category code of the invoice
962
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
963
+ # for exempt)
674
964
  #
675
965
  # @see EInvoiceAPI::Models::DocumentResponse#tax_code
676
966
  module TaxCode
@@ -693,18 +983,21 @@ module EInvoiceAPI
693
983
 
694
984
  class TaxDetail < EInvoiceAPI::Internal::Type::BaseModel
695
985
  # @!attribute amount
986
+ # The tax amount for this tax category. Must be rounded to maximum 2 decimals
696
987
  #
697
988
  # @return [String, nil]
698
989
  optional :amount, String, nil?: true
699
990
 
700
991
  # @!attribute rate
992
+ # The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
701
993
  #
702
994
  # @return [String, nil]
703
995
  optional :rate, String, nil?: true
704
996
 
705
997
  # @!method initialize(amount: nil, rate: nil)
706
- # @param amount [String, nil]
707
- # @param rate [String, nil]
998
+ # @param amount [String, nil] The tax amount for this tax category. Must be rounded to maximum 2 decimals
999
+ #
1000
+ # @param rate [String, nil] The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
708
1001
  end
709
1002
 
710
1003
  # VATEX code list for VAT exemption reasons