e-invoice-api 0.10.1 → 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 +17 -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 +728 -125
  7. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +127 -61
  8. data/lib/e_invoice_api/models/document_response.rb +377 -83
  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 +43 -39
  12. data/lib/e_invoice_api/resources/validate.rb +43 -39
  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 +3094 -708
  17. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +142 -34
  18. data/rbi/e_invoice_api/models/document_response.rbi +1238 -62
  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 +54 -12
  22. data/rbi/e_invoice_api/resources/validate.rbi +54 -12
  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
@@ -28,7 +28,7 @@ module EInvoiceAPI
28
28
  optional :bcc_recipient_email, String, nil?: true
29
29
 
30
30
  # @!attribute company_address
31
- # Address of the company
31
+ # Address of the company. Must be in the form of `Street Name Street Number`
32
32
  #
33
33
  # @return [String, nil]
34
34
  optional :company_address, String, nil?: true
@@ -52,17 +52,26 @@ module EInvoiceAPI
52
52
  optional :company_email, String, nil?: true
53
53
 
54
54
  # @!attribute company_name
55
- # Name of the company
55
+ # Name of the company. Must include the company type. For example: `BV`, `NV`,
56
+ # `CVBA`, `VOF`
56
57
  #
57
58
  # @return [String, nil]
58
59
  optional :company_name, String, nil?: true
59
60
 
60
61
  # @!attribute company_number
61
- # Company number
62
+ # Company number. For Belgium this is the CBE number or their EUID (European
63
+ # Unique Identifier) number
62
64
  #
63
65
  # @return [String, nil]
64
66
  optional :company_number, String, nil?: true
65
67
 
68
+ # @!attribute company_tax_id
69
+ # Company tax ID. For Belgium this is the VAT number. Must include the country
70
+ # prefix
71
+ #
72
+ # @return [String, nil]
73
+ optional :company_tax_id, String, nil?: true
74
+
66
75
  # @!attribute company_zip
67
76
  # Zip code of the company
68
77
  #
@@ -98,7 +107,10 @@ module EInvoiceAPI
98
107
  # @return [Time, nil]
99
108
  optional :smp_registration_date, Time, nil?: true
100
109
 
101
- # @!method initialize(credit_balance:, name:, plan:, bcc_recipient_email: nil, company_address: nil, company_city: nil, company_country: nil, company_email: nil, company_name: nil, company_number: nil, company_zip: nil, description: nil, ibans: nil, peppol_ids: nil, smp_registration: nil, smp_registration_date: nil)
110
+ # @!method initialize(credit_balance:, name:, plan:, bcc_recipient_email: nil, company_address: nil, company_city: nil, company_country: nil, company_email: nil, company_name: nil, company_number: nil, company_tax_id: nil, company_zip: nil, description: nil, ibans: nil, peppol_ids: nil, smp_registration: nil, smp_registration_date: nil)
111
+ # Some parameter documentations has been truncated, see
112
+ # {EInvoiceAPI::Models::MeRetrieveResponse} for more details.
113
+ #
102
114
  # @param credit_balance [Integer] Credit balance of the tenant
103
115
  #
104
116
  # @param name [String]
@@ -107,7 +119,7 @@ module EInvoiceAPI
107
119
  #
108
120
  # @param bcc_recipient_email [String, nil] BCC recipient email to deliver documents
109
121
  #
110
- # @param company_address [String, nil] Address of the company
122
+ # @param company_address [String, nil] Address of the company. Must be in the form of `Street Name Street Number`
111
123
  #
112
124
  # @param company_city [String, nil] City of the company
113
125
  #
@@ -115,9 +127,11 @@ module EInvoiceAPI
115
127
  #
116
128
  # @param company_email [String, nil] Email of the company
117
129
  #
118
- # @param company_name [String, nil] Name of the company
130
+ # @param company_name [String, nil] Name of the company. Must include the company type. For example: `BV`, `NV`, `CV
131
+ #
132
+ # @param company_number [String, nil] Company number. For Belgium this is the CBE number or their EUID (European Uniqu
119
133
  #
120
- # @param company_number [String, nil] Company number
134
+ # @param company_tax_id [String, nil] Company tax ID. For Belgium this is the VAT number. Must include the country pre
121
135
  #
122
136
  # @param company_zip [String, nil] Zip code of the company
123
137
  #
@@ -4,30 +4,41 @@ module EInvoiceAPI
4
4
  module Models
5
5
  class PaymentDetailCreate < EInvoiceAPI::Internal::Type::BaseModel
6
6
  # @!attribute bank_account_number
7
+ # Bank account number (for non-IBAN accounts)
7
8
  #
8
9
  # @return [String, nil]
9
10
  optional :bank_account_number, String, nil?: true
10
11
 
11
12
  # @!attribute iban
13
+ # International Bank Account Number for payment transfers
12
14
  #
13
15
  # @return [String, nil]
14
16
  optional :iban, String, nil?: true
15
17
 
16
18
  # @!attribute payment_reference
19
+ # Structured payment reference or communication (e.g., structured communication
20
+ # for Belgian bank transfers)
17
21
  #
18
22
  # @return [String, nil]
19
23
  optional :payment_reference, String, nil?: true
20
24
 
21
25
  # @!attribute swift
26
+ # SWIFT/BIC code of the bank
22
27
  #
23
28
  # @return [String, nil]
24
29
  optional :swift, String, nil?: true
25
30
 
26
31
  # @!method initialize(bank_account_number: nil, iban: nil, payment_reference: nil, swift: nil)
27
- # @param bank_account_number [String, nil]
28
- # @param iban [String, nil]
29
- # @param payment_reference [String, nil]
30
- # @param swift [String, nil]
32
+ # Some parameter documentations has been truncated, see
33
+ # {EInvoiceAPI::Models::PaymentDetailCreate} for more details.
34
+ #
35
+ # @param bank_account_number [String, nil] Bank account number (for non-IBAN accounts)
36
+ #
37
+ # @param iban [String, nil] International Bank Account Number for payment transfers
38
+ #
39
+ # @param payment_reference [String, nil] Structured payment reference or communication (e.g., structured communication fo
40
+ #
41
+ # @param swift [String, nil] SWIFT/BIC code of the bank
31
42
  end
32
43
  end
33
44
  end
@@ -14,99 +14,103 @@ module EInvoiceAPI
14
14
  #
15
15
  # Create a new invoice or credit note
16
16
  #
17
- # @overload create(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, request_options: {})
17
+ # @overload create(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, request_options: {})
18
18
  #
19
19
  # @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
20
20
  #
21
- # @param amount_due [Float, String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
21
+ # @param amount_due [Float, String, nil] The amount due for payment. Must be positive and rounded to maximum 2 decimals
22
22
  #
23
23
  # @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil]
24
24
  #
25
- # @param billing_address [String, nil]
25
+ # @param billing_address [String, nil] The billing address (if different from customer address)
26
26
  #
27
- # @param billing_address_recipient [String, nil]
27
+ # @param billing_address_recipient [String, nil] The recipient name at the billing address
28
28
  #
29
29
  # @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil]
30
30
  #
31
- # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
31
+ # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice (ISO 4217 currency code)
32
32
  #
33
- # @param customer_address [String, nil]
33
+ # @param customer_address [String, nil] The address of the customer/buyer
34
34
  #
35
- # @param customer_address_recipient [String, nil]
35
+ # @param customer_address_recipient [String, nil] The recipient name at the customer address
36
36
  #
37
- # @param customer_email [String, nil]
37
+ # @param customer_company_id [String, nil] Customer company ID. For Belgium this is the CBE number or their EUID (European
38
38
  #
39
- # @param customer_id [String, nil]
39
+ # @param customer_email [String, nil] The email address of the customer
40
40
  #
41
- # @param customer_name [String, nil]
41
+ # @param customer_id [String, nil] The unique identifier for the customer in your system
42
42
  #
43
- # @param customer_tax_id [String, nil]
43
+ # @param customer_name [String, nil] The company name of the customer/buyer
44
44
  #
45
- # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection]
45
+ # @param customer_tax_id [String, nil] Customer tax ID. For Belgium this is the VAT number. Must include the country pr
46
46
  #
47
- # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType]
47
+ # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
48
48
  #
49
- # @param due_date [Date, nil]
49
+ # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType] The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
50
50
  #
51
- # @param invoice_date [Date, nil]
51
+ # @param due_date [Date, nil] The date when payment is due
52
52
  #
53
- # @param invoice_id [String, nil]
53
+ # @param invoice_date [Date, nil] The date when the invoice was issued
54
54
  #
55
- # @param invoice_total [Float, String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
55
+ # @param invoice_id [String, nil] The unique invoice identifier/number
56
+ #
57
+ # @param invoice_total [Float, String, nil] The total amount of the invoice including tax (invoice*total = subtotal + total*
56
58
  #
57
59
  # @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] At least one line item is required
58
60
  #
59
- # @param note [String, nil]
61
+ # @param note [String, nil] Additional notes or comments for the invoice
60
62
  #
61
63
  # @param payment_details [Array<EInvoiceAPI::Models::PaymentDetailCreate>, nil]
62
64
  #
63
- # @param payment_term [String, nil]
65
+ # @param payment_term [String, nil] The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
64
66
  #
65
- # @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
67
+ # @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance from prior invoices, if any. Must be positive and ro
66
68
  #
67
- # @param purchase_order [String, nil]
69
+ # @param purchase_order [String, nil] The purchase order reference number
68
70
  #
69
- # @param remittance_address [String, nil]
71
+ # @param remittance_address [String, nil] The address where payment should be sent or remitted to
70
72
  #
71
- # @param remittance_address_recipient [String, nil]
73
+ # @param remittance_address_recipient [String, nil] The recipient name at the remittance address
72
74
  #
73
- # @param service_address [String, nil]
75
+ # @param service_address [String, nil] The address where services were performed or goods were delivered
74
76
  #
75
- # @param service_address_recipient [String, nil]
77
+ # @param service_address_recipient [String, nil] The recipient name at the service address
76
78
  #
77
- # @param service_end_date [Date, nil]
79
+ # @param service_end_date [Date, nil] The end date of the service period or delivery period
78
80
  #
79
- # @param service_start_date [Date, nil]
81
+ # @param service_start_date [Date, nil] The start date of the service period or delivery period
80
82
  #
81
- # @param shipping_address [String, nil]
83
+ # @param shipping_address [String, nil] The shipping/delivery address
82
84
  #
83
- # @param shipping_address_recipient [String, nil]
85
+ # @param shipping_address_recipient [String, nil] The recipient name at the shipping address
84
86
  #
85
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState]
87
+ # @param state [Symbol, EInvoiceAPI::Models::DocumentState] The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
86
88
  #
87
89
  # @param subtotal [Float, String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
88
90
  #
89
- # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice
91
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
90
92
  #
91
93
  # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil]
92
94
  #
93
- # @param total_discount [Float, String, nil] The total financial discount of the invoice (so discounts not subject to VAT). M
95
+ # @param total_discount [Float, String, nil] The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
94
96
  #
95
- # @param total_tax [Float, String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
97
+ # @param total_tax [Float, String, nil] The total tax amount of the invoice. Must be positive and rounded to maximum 2 d
96
98
  #
97
99
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] VATEX code list for VAT exemption reasons
98
100
  #
99
- # @param vatex_note [String, nil] VAT exemption note of the invoice
101
+ # @param vatex_note [String, nil] Textual explanation for VAT exemption
102
+ #
103
+ # @param vendor_address [String, nil] The address of the vendor/seller
100
104
  #
101
- # @param vendor_address [String, nil]
105
+ # @param vendor_address_recipient [String, nil] The recipient name at the vendor address
102
106
  #
103
- # @param vendor_address_recipient [String, nil]
107
+ # @param vendor_company_id [String, nil] Vendor company ID. For Belgium this is the CBE number or their EUID (European Un
104
108
  #
105
- # @param vendor_email [String, nil]
109
+ # @param vendor_email [String, nil] The email address of the vendor
106
110
  #
107
- # @param vendor_name [String, nil]
111
+ # @param vendor_name [String, nil] The name of the vendor/seller/supplier
108
112
  #
109
- # @param vendor_tax_id [String, nil]
113
+ # @param vendor_tax_id [String, nil] Vendor tax ID. For Belgium this is the VAT number. Must include the country pref
110
114
  #
111
115
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
112
116
  #
@@ -8,99 +8,103 @@ module EInvoiceAPI
8
8
  #
9
9
  # Validate if the JSON document can be converted to a valid UBL document
10
10
  #
11
- # @overload validate_json(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, request_options: {})
11
+ # @overload validate_json(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, request_options: {})
12
12
  #
13
13
  # @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
14
14
  #
15
- # @param amount_due [Float, String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
15
+ # @param amount_due [Float, String, nil] The amount due for payment. Must be positive and rounded to maximum 2 decimals
16
16
  #
17
17
  # @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil]
18
18
  #
19
- # @param billing_address [String, nil]
19
+ # @param billing_address [String, nil] The billing address (if different from customer address)
20
20
  #
21
- # @param billing_address_recipient [String, nil]
21
+ # @param billing_address_recipient [String, nil] The recipient name at the billing address
22
22
  #
23
23
  # @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil]
24
24
  #
25
- # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
25
+ # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice (ISO 4217 currency code)
26
26
  #
27
- # @param customer_address [String, nil]
27
+ # @param customer_address [String, nil] The address of the customer/buyer
28
28
  #
29
- # @param customer_address_recipient [String, nil]
29
+ # @param customer_address_recipient [String, nil] The recipient name at the customer address
30
30
  #
31
- # @param customer_email [String, nil]
31
+ # @param customer_company_id [String, nil] Customer company ID. For Belgium this is the CBE number or their EUID (European
32
32
  #
33
- # @param customer_id [String, nil]
33
+ # @param customer_email [String, nil] The email address of the customer
34
34
  #
35
- # @param customer_name [String, nil]
35
+ # @param customer_id [String, nil] The unique identifier for the customer in your system
36
36
  #
37
- # @param customer_tax_id [String, nil]
37
+ # @param customer_name [String, nil] The company name of the customer/buyer
38
38
  #
39
- # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection]
39
+ # @param customer_tax_id [String, nil] Customer tax ID. For Belgium this is the VAT number. Must include the country pr
40
40
  #
41
- # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType]
41
+ # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
42
42
  #
43
- # @param due_date [Date, nil]
43
+ # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType] The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
44
44
  #
45
- # @param invoice_date [Date, nil]
45
+ # @param due_date [Date, nil] The date when payment is due
46
46
  #
47
- # @param invoice_id [String, nil]
47
+ # @param invoice_date [Date, nil] The date when the invoice was issued
48
48
  #
49
- # @param invoice_total [Float, String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
49
+ # @param invoice_id [String, nil] The unique invoice identifier/number
50
+ #
51
+ # @param invoice_total [Float, String, nil] The total amount of the invoice including tax (invoice*total = subtotal + total*
50
52
  #
51
53
  # @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] At least one line item is required
52
54
  #
53
- # @param note [String, nil]
55
+ # @param note [String, nil] Additional notes or comments for the invoice
54
56
  #
55
57
  # @param payment_details [Array<EInvoiceAPI::Models::PaymentDetailCreate>, nil]
56
58
  #
57
- # @param payment_term [String, nil]
59
+ # @param payment_term [String, nil] The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
58
60
  #
59
- # @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
61
+ # @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance from prior invoices, if any. Must be positive and ro
60
62
  #
61
- # @param purchase_order [String, nil]
63
+ # @param purchase_order [String, nil] The purchase order reference number
62
64
  #
63
- # @param remittance_address [String, nil]
65
+ # @param remittance_address [String, nil] The address where payment should be sent or remitted to
64
66
  #
65
- # @param remittance_address_recipient [String, nil]
67
+ # @param remittance_address_recipient [String, nil] The recipient name at the remittance address
66
68
  #
67
- # @param service_address [String, nil]
69
+ # @param service_address [String, nil] The address where services were performed or goods were delivered
68
70
  #
69
- # @param service_address_recipient [String, nil]
71
+ # @param service_address_recipient [String, nil] The recipient name at the service address
70
72
  #
71
- # @param service_end_date [Date, nil]
73
+ # @param service_end_date [Date, nil] The end date of the service period or delivery period
72
74
  #
73
- # @param service_start_date [Date, nil]
75
+ # @param service_start_date [Date, nil] The start date of the service period or delivery period
74
76
  #
75
- # @param shipping_address [String, nil]
77
+ # @param shipping_address [String, nil] The shipping/delivery address
76
78
  #
77
- # @param shipping_address_recipient [String, nil]
79
+ # @param shipping_address_recipient [String, nil] The recipient name at the shipping address
78
80
  #
79
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState]
81
+ # @param state [Symbol, EInvoiceAPI::Models::DocumentState] The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
80
82
  #
81
83
  # @param subtotal [Float, String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
82
84
  #
83
- # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice
85
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
84
86
  #
85
87
  # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil]
86
88
  #
87
- # @param total_discount [Float, String, nil] The total financial discount of the invoice (so discounts not subject to VAT). M
89
+ # @param total_discount [Float, String, nil] The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
88
90
  #
89
- # @param total_tax [Float, String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
91
+ # @param total_tax [Float, String, nil] The total tax amount of the invoice. Must be positive and rounded to maximum 2 d
90
92
  #
91
93
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] VATEX code list for VAT exemption reasons
92
94
  #
93
- # @param vatex_note [String, nil] VAT exemption note of the invoice
95
+ # @param vatex_note [String, nil] Textual explanation for VAT exemption
96
+ #
97
+ # @param vendor_address [String, nil] The address of the vendor/seller
94
98
  #
95
- # @param vendor_address [String, nil]
99
+ # @param vendor_address_recipient [String, nil] The recipient name at the vendor address
96
100
  #
97
- # @param vendor_address_recipient [String, nil]
101
+ # @param vendor_company_id [String, nil] Vendor company ID. For Belgium this is the CBE number or their EUID (European Un
98
102
  #
99
- # @param vendor_email [String, nil]
103
+ # @param vendor_email [String, nil] The email address of the vendor
100
104
  #
101
- # @param vendor_name [String, nil]
105
+ # @param vendor_name [String, nil] The name of the vendor/seller/supplier
102
106
  #
103
- # @param vendor_tax_id [String, nil]
107
+ # @param vendor_tax_id [String, nil] Vendor tax ID. For Belgium this is the VAT number. Must include the country pref
104
108
  #
105
109
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
106
110
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EInvoiceAPI
4
- VERSION = "0.10.1"
4
+ VERSION = "0.12.0"
5
5
  end
@@ -18,7 +18,8 @@ module EInvoiceAPI
18
18
  attr_accessor :base_amount
19
19
 
20
20
  # The percentage that may be used, in conjunction with the allowance base amount,
21
- # to calculate the allowance amount. To state 20%, use value 20
21
+ # to calculate the allowance amount. To state 20%, use value 20. Must be rounded
22
+ # to maximum 2 decimals
22
23
  sig { returns(T.nilable(String)) }
23
24
  attr_accessor :multiplier_factor
24
25
 
@@ -26,17 +27,21 @@ module EInvoiceAPI
26
27
  sig { returns(T.nilable(String)) }
27
28
  attr_accessor :reason
28
29
 
29
- # The code for the allowance reason
30
- sig { returns(T.nilable(String)) }
30
+ # Allowance reason codes for invoice discounts and charges
31
+ sig do
32
+ returns(T.nilable(EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol))
33
+ end
31
34
  attr_accessor :reason_code
32
35
 
33
- # Duty or tax or fee category codes (Subset of UNCL5305)
34
- #
35
- # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
36
+ # The VAT category code that applies to the allowance
36
37
  sig { returns(T.nilable(EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)) }
37
- attr_accessor :tax_code
38
+ attr_reader :tax_code
38
39
 
39
- # The VAT rate, represented as percentage that applies to the allowance
40
+ sig { params(tax_code: EInvoiceAPI::Allowance::TaxCode::OrSymbol).void }
41
+ attr_writer :tax_code
42
+
43
+ # The VAT rate, represented as percentage that applies to the allowance. Must be
44
+ # rounded to maximum 2 decimals
40
45
  sig { returns(T.nilable(String)) }
41
46
  attr_accessor :tax_rate
42
47
 
@@ -47,8 +52,8 @@ module EInvoiceAPI
47
52
  base_amount: T.nilable(String),
48
53
  multiplier_factor: T.nilable(String),
49
54
  reason: T.nilable(String),
50
- reason_code: T.nilable(String),
51
- tax_code: T.nilable(EInvoiceAPI::Allowance::TaxCode::OrSymbol),
55
+ reason_code: T.nilable(EInvoiceAPI::Allowance::ReasonCode::OrSymbol),
56
+ tax_code: EInvoiceAPI::Allowance::TaxCode::OrSymbol,
52
57
  tax_rate: T.nilable(String)
53
58
  ).returns(T.attached_class)
54
59
  end
@@ -59,17 +64,17 @@ module EInvoiceAPI
59
64
  # to calculate the allowance amount. Must be rounded to maximum 2 decimals
60
65
  base_amount: nil,
61
66
  # The percentage that may be used, in conjunction with the allowance base amount,
62
- # to calculate the allowance amount. To state 20%, use value 20
67
+ # to calculate the allowance amount. To state 20%, use value 20. Must be rounded
68
+ # to maximum 2 decimals
63
69
  multiplier_factor: nil,
64
70
  # The reason for the allowance
65
71
  reason: nil,
66
- # The code for the allowance reason
72
+ # Allowance reason codes for invoice discounts and charges
67
73
  reason_code: nil,
68
- # Duty or tax or fee category codes (Subset of UNCL5305)
69
- #
70
- # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
74
+ # The VAT category code that applies to the allowance
71
75
  tax_code: nil,
72
- # The VAT rate, represented as percentage that applies to the allowance
76
+ # The VAT rate, represented as percentage that applies to the allowance. Must be
77
+ # rounded to maximum 2 decimals
73
78
  tax_rate: nil
74
79
  )
75
80
  end
@@ -81,8 +86,9 @@ module EInvoiceAPI
81
86
  base_amount: T.nilable(String),
82
87
  multiplier_factor: T.nilable(String),
83
88
  reason: T.nilable(String),
84
- reason_code: T.nilable(String),
85
- tax_code: T.nilable(EInvoiceAPI::Allowance::TaxCode::TaggedSymbol),
89
+ reason_code:
90
+ T.nilable(EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol),
91
+ tax_code: EInvoiceAPI::Allowance::TaxCode::TaggedSymbol,
86
92
  tax_rate: T.nilable(String)
87
93
  }
88
94
  )
@@ -90,9 +96,63 @@ module EInvoiceAPI
90
96
  def to_hash
91
97
  end
92
98
 
93
- # Duty or tax or fee category codes (Subset of UNCL5305)
94
- #
95
- # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
99
+ # Allowance reason codes for invoice discounts and charges
100
+ module ReasonCode
101
+ extend EInvoiceAPI::Internal::Type::Enum
102
+
103
+ TaggedSymbol =
104
+ T.type_alias { T.all(Symbol, EInvoiceAPI::Allowance::ReasonCode) }
105
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
106
+
107
+ REASON_CODE_41 =
108
+ T.let(:"41", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
109
+ REASON_CODE_42 =
110
+ T.let(:"42", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
111
+ REASON_CODE_60 =
112
+ T.let(:"60", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
113
+ REASON_CODE_62 =
114
+ T.let(:"62", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
115
+ REASON_CODE_63 =
116
+ T.let(:"63", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
117
+ REASON_CODE_64 =
118
+ T.let(:"64", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
119
+ REASON_CODE_65 =
120
+ T.let(:"65", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
121
+ REASON_CODE_66 =
122
+ T.let(:"66", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
123
+ REASON_CODE_67 =
124
+ T.let(:"67", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
125
+ REASON_CODE_68 =
126
+ T.let(:"68", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
127
+ REASON_CODE_70 =
128
+ T.let(:"70", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
129
+ REASON_CODE_71 =
130
+ T.let(:"71", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
131
+ REASON_CODE_88 =
132
+ T.let(:"88", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
133
+ REASON_CODE_95 =
134
+ T.let(:"95", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
135
+ REASON_CODE_100 =
136
+ T.let(:"100", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
137
+ REASON_CODE_102 =
138
+ T.let(:"102", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
139
+ REASON_CODE_103 =
140
+ T.let(:"103", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
141
+ REASON_CODE_104 =
142
+ T.let(:"104", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
143
+ REASON_CODE_105 =
144
+ T.let(:"105", EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol)
145
+
146
+ sig do
147
+ override.returns(
148
+ T::Array[EInvoiceAPI::Allowance::ReasonCode::TaggedSymbol]
149
+ )
150
+ end
151
+ def self.values
152
+ end
153
+ end
154
+
155
+ # The VAT category code that applies to the allowance
96
156
  module TaxCode
97
157
  extend EInvoiceAPI::Internal::Type::Enum
98
158