nordlet 0.6.6 → 0.6.8

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 (131) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nordlet/account/client.rb +89 -6
  3. data/lib/nordlet/account/types/brand_get_account_request.rb +9 -0
  4. data/lib/nordlet/account/types/brand_get_account_response.rb +17 -0
  5. data/lib/nordlet/account/types/brand_update_account_request.rb +17 -0
  6. data/lib/nordlet/account/types/brand_update_account_response.rb +17 -0
  7. data/lib/nordlet/account/types/companies_create_account_response.rb +10 -0
  8. data/lib/nordlet/account/types/companies_create_account_response_vat_period.rb +17 -0
  9. data/lib/nordlet/account/types/me_account_response_companies_item.rb +10 -0
  10. data/lib/nordlet/account/types/me_account_response_companies_item_vat_period.rb +17 -0
  11. data/lib/nordlet/account/types/me_account_response_user.rb +2 -0
  12. data/lib/nordlet/bank/client.rb +183 -14
  13. data/lib/nordlet/bank/types/reconciliation_get_bank_request.rb +15 -0
  14. data/lib/nordlet/bank/types/reconciliation_get_bank_response.rb +35 -0
  15. data/lib/nordlet/bank/types/reconciliation_get_bank_response_statement_balance_source.rb +14 -0
  16. data/lib/nordlet/bank/types/reconciliation_get_bank_response_unbooked_lines_item.rb +39 -0
  17. data/lib/nordlet/bank/types/reconciliation_get_bank_response_unbooked_lines_item_status.rb +15 -0
  18. data/lib/nordlet/bank/types/transactions_ignore_bank_request.rb +13 -0
  19. data/lib/nordlet/bank/types/transactions_ignore_bank_response.rb +39 -0
  20. data/lib/nordlet/bank/types/transactions_ignore_bank_response_status.rb +15 -0
  21. data/lib/nordlet/bank/types/transactions_import_bank_request.rb +4 -0
  22. data/lib/nordlet/bank/types/transactions_import_bank_response.rb +2 -0
  23. data/lib/nordlet/bank/types/transactions_import_bank_response_duplicates_item.rb +17 -0
  24. data/lib/nordlet/bank/types/transactions_list_bank_response_rows_item.rb +2 -0
  25. data/lib/nordlet/bank/types/transactions_list_bank_response_rows_item_status.rb +1 -0
  26. data/lib/nordlet/bank/types/transactions_match_bank_request.rb +2 -0
  27. data/lib/nordlet/bank/types/transactions_match_bank_request_remainder.rb +13 -0
  28. data/lib/nordlet/bank/types/transactions_match_bank_request_remainder_treatment.rb +15 -0
  29. data/lib/nordlet/bank/types/transactions_match_bank_response.rb +2 -0
  30. data/lib/nordlet/bank/types/transactions_match_bank_response_status.rb +1 -0
  31. data/lib/nordlet/bank/types/transactions_match_many_bank_response.rb +2 -0
  32. data/lib/nordlet/bank/types/transactions_match_many_bank_response_status.rb +1 -0
  33. data/lib/nordlet/bank/types/transactions_post_bank_request.rb +25 -0
  34. data/lib/nordlet/bank/types/transactions_post_bank_response.rb +39 -0
  35. data/lib/nordlet/bank/types/transactions_post_bank_response_status.rb +15 -0
  36. data/lib/nordlet/bank/types/transactions_record_bank_response.rb +2 -0
  37. data/lib/nordlet/bank/types/transactions_record_bank_response_status.rb +1 -0
  38. data/lib/nordlet/bank/types/transactions_unignore_bank_request.rb +11 -0
  39. data/lib/nordlet/bank/types/transactions_unignore_bank_response.rb +39 -0
  40. data/lib/nordlet/bank/types/transactions_unignore_bank_response_status.rb +15 -0
  41. data/lib/nordlet/bank/types/transactions_unmatch_bank_response.rb +2 -0
  42. data/lib/nordlet/bank/types/transactions_unmatch_bank_response_status.rb +1 -0
  43. data/lib/nordlet/billing/client.rb +3 -2
  44. data/lib/nordlet/billing/types/account_get_billing_response_month_to_date.rb +0 -2
  45. data/lib/nordlet/billing/types/account_set_account_type_billing_response_month_to_date.rb +0 -2
  46. data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response_month_to_date.rb +0 -2
  47. data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response_month_to_date.rb +0 -2
  48. data/lib/nordlet/billing/types/account_set_plan_billing_response_month_to_date.rb +0 -2
  49. data/lib/nordlet/billing/types/flat_rate_confirm_billing_response_month_to_date.rb +0 -2
  50. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_month_to_date.rb +0 -2
  51. data/lib/nordlet/billing/types/subscription_cancel_billing_response_month_to_date.rb +0 -2
  52. data/lib/nordlet/billing/types/topup_confirm_billing_response_month_to_date.rb +0 -2
  53. data/lib/nordlet/calendar/client.rb +3 -1
  54. data/lib/nordlet/capture/client.rb +6 -188
  55. data/lib/nordlet/capture/types/documents_confirm_capture_response_invoice.rb +6 -0
  56. data/lib/nordlet/capture/types/documents_confirm_capture_response_invoice_status.rb +1 -0
  57. data/lib/nordlet/capture/types/documents_confirm_capture_response_opposite_invoice.rb +6 -0
  58. data/lib/nordlet/capture/types/documents_confirm_capture_response_opposite_invoice_status.rb +1 -0
  59. data/lib/nordlet/cash/client.rb +11 -10
  60. data/lib/nordlet/declarations/client.rb +7 -3
  61. data/lib/nordlet/declarations/types/configs_list_declarations_response_rows_item_fields_item.rb +2 -0
  62. data/lib/nordlet/declarations/types/configs_update_declarations_response_fields_item.rb +2 -0
  63. data/lib/nordlet/hr/client.rb +3 -2
  64. data/lib/nordlet/ledger/client.rb +46 -5
  65. data/lib/nordlet/ledger/types/journal_transactions_get_ledger_response.rb +2 -0
  66. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_request.rb +15 -0
  67. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_response.rb +27 -0
  68. data/lib/nordlet/ledger/types/journal_transactions_reverse_ledger_response_status.rb +14 -0
  69. data/lib/nordlet/ledger/types/periods_lock_ledger_response.rb +2 -0
  70. data/lib/nordlet/ledger/types/periods_lock_ledger_response_warnings_item.rb +17 -0
  71. data/lib/nordlet/ledger/types/periods_lock_ledger_response_warnings_item_code.rb +21 -0
  72. data/lib/nordlet/partners/client.rb +10 -8
  73. data/lib/nordlet/public/types/invoices_get_public_response.rb +2 -0
  74. data/lib/nordlet/purchases/client.rb +77 -20
  75. data/lib/nordlet/purchases/types/invoices_create_purchases_request.rb +6 -0
  76. data/lib/nordlet/purchases/types/invoices_create_purchases_response.rb +8 -0
  77. data/lib/nordlet/purchases/types/invoices_create_purchases_response_status.rb +1 -0
  78. data/lib/nordlet/purchases/types/invoices_create_purchases_response_warnings_item.rb +13 -0
  79. data/lib/nordlet/purchases/types/invoices_get_purchases_response.rb +6 -0
  80. data/lib/nordlet/purchases/types/invoices_get_purchases_response_status.rb +1 -0
  81. data/lib/nordlet/purchases/types/invoices_list_purchases_response_rows_item.rb +6 -0
  82. data/lib/nordlet/purchases/types/invoices_list_purchases_response_rows_item_status.rb +1 -0
  83. data/lib/nordlet/purchases/types/invoices_register_purchases_response.rb +8 -0
  84. data/lib/nordlet/purchases/types/invoices_register_purchases_response_status.rb +1 -0
  85. data/lib/nordlet/purchases/types/invoices_register_purchases_response_warnings_item.rb +13 -0
  86. data/lib/nordlet/purchases/types/invoices_reverse_purchases_request.rb +15 -0
  87. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response.rb +71 -0
  88. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_lines_item.rb +53 -0
  89. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_payment_status.rb +15 -0
  90. data/lib/nordlet/purchases/types/invoices_reverse_purchases_response_status.rb +15 -0
  91. data/lib/nordlet/{capture/types/documents_upload_capture_response_extraction_document_type.rb → purchases/types/invoices_reverse_purchases_response_type.rb} +2 -2
  92. data/lib/nordlet/purchases/types/invoices_update_purchases_request.rb +6 -0
  93. data/lib/nordlet/purchases/types/invoices_update_purchases_response.rb +6 -0
  94. data/lib/nordlet/purchases/types/invoices_update_purchases_response_status.rb +1 -0
  95. data/lib/nordlet/reference/client.rb +8 -2
  96. data/lib/nordlet/reference/types/vat_resolve_reference_request.rb +2 -0
  97. data/lib/nordlet/reference/types/vat_resolve_reference_request_side.rb +14 -0
  98. data/lib/nordlet/reference/types/vat_resolve_reference_response.rb +2 -0
  99. data/lib/nordlet/reports/client.rb +42 -0
  100. data/lib/nordlet/reports/types/period_checklist_reports_request.rb +11 -0
  101. data/lib/nordlet/reports/types/period_checklist_reports_response.rb +17 -0
  102. data/lib/nordlet/reports/types/period_checklist_reports_response_items_item.rb +17 -0
  103. data/lib/nordlet/reports/types/period_checklist_reports_response_items_item_code.rb +21 -0
  104. data/lib/nordlet/sales/client.rb +19 -8
  105. data/lib/nordlet/sales/types/invoices_create_sales_response.rb +2 -0
  106. data/lib/nordlet/sales/types/invoices_create_sales_response_warnings_item.rb +13 -0
  107. data/lib/nordlet/sales/types/invoices_issue_sales_response.rb +2 -0
  108. data/lib/nordlet/sales/types/invoices_issue_sales_response_warnings_item.rb +13 -0
  109. data/lib/nordlet/sales/types/invoices_view_sales_response.rb +2 -0
  110. data/lib/nordlet/version.rb +1 -1
  111. data/lib/nordlet.rb +43 -19
  112. data/reference.md +863 -468
  113. metadata +45 -21
  114. data/lib/nordlet/capture/types/documents_upload_capture_request.rb +0 -15
  115. data/lib/nordlet/capture/types/documents_upload_capture_response.rb +0 -43
  116. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction.rb +0 -33
  117. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_lines_item.rb +0 -25
  118. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_opposite_lines_item.rb +0 -25
  119. data/lib/nordlet/capture/types/documents_upload_capture_response_extraction_supplier.rb +0 -19
  120. data/lib/nordlet/capture/types/documents_upload_capture_response_status.rb +0 -16
  121. data/lib/nordlet/capture/types/inbound_email_capture_request.rb +0 -27
  122. data/lib/nordlet/capture/types/inbound_email_capture_request_attachments_item.rb +0 -21
  123. data/lib/nordlet/capture/types/inbound_email_capture_request_to.rb +0 -15
  124. data/lib/nordlet/capture/types/inbound_email_capture_request_to_full_item.rb +0 -11
  125. data/lib/nordlet/capture/types/inbound_email_capture_response.rb +0 -15
  126. data/lib/nordlet/capture/types/settings_get_capture_request.rb +0 -9
  127. data/lib/nordlet/capture/types/settings_get_capture_response.rb +0 -17
  128. data/lib/nordlet/capture/types/settings_regenerate_intake_capture_request.rb +0 -9
  129. data/lib/nordlet/capture/types/settings_regenerate_intake_capture_response.rb +0 -17
  130. data/lib/nordlet/capture/types/settings_update_capture_request.rb +0 -13
  131. data/lib/nordlet/capture/types/settings_update_capture_response.rb +0 -17
@@ -10,191 +10,9 @@ module Nordlet
10
10
  @client = client
11
11
  end
12
12
 
13
- # Return the company's document capture settings: whether intake by e-mail is enabled, whether e-mailed documents
14
- # are read on arrival, the company's intake e-mail address and whether a reading provider is configured. The
15
- # intake token behind the address is created on the first call.
16
- #
17
- # @param request_options [Hash]
18
- # @param params [Nordlet::Capture::Types::SettingsGetCaptureRequest]
19
- # @option request_options [String] :base_url
20
- # @option request_options [Hash{String => Object}] :additional_headers
21
- # @option request_options [Hash{String => Object}] :additional_query_parameters
22
- # @option request_options [Hash{String => Object}] :additional_body_parameters
23
- # @option request_options [Integer] :timeout_in_seconds
24
- #
25
- # @return [Nordlet::Capture::Types::SettingsGetCaptureResponse]
26
- def settings_get(request_options: {}, **params)
27
- params = Nordlet::Internal::Types::Utils.normalize_keys(params)
28
- request = Nordlet::Internal::JSON::Request.new(
29
- base_url: request_options[:base_url],
30
- method: "POST",
31
- path: "v1/capture/settings/get",
32
- body: Nordlet::Capture::Types::SettingsGetCaptureRequest.new(params).to_h,
33
- request_options: request_options
34
- )
35
- begin
36
- response = @client.send(request)
37
- rescue Net::HTTPRequestTimeout
38
- raise Nordlet::Errors::TimeoutError
39
- end
40
- code = response.code.to_i
41
- if code.between?(200, 299)
42
- Nordlet::Capture::Types::SettingsGetCaptureResponse.load(response.body)
43
- else
44
- error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
45
- raise error_class.new(response.body, code: code)
46
- end
47
- end
48
-
49
- # Switch `intakeEnabled` (documents sent to the intake address are accepted) and `captureAutoExtract` (they are
50
- # read on arrival) on or off; at least one field is required.
51
- #
52
- # @param request_options [Hash]
53
- # @param params [Nordlet::Capture::Types::SettingsUpdateCaptureRequest]
54
- # @option request_options [String] :base_url
55
- # @option request_options [Hash{String => Object}] :additional_headers
56
- # @option request_options [Hash{String => Object}] :additional_query_parameters
57
- # @option request_options [Hash{String => Object}] :additional_body_parameters
58
- # @option request_options [Integer] :timeout_in_seconds
59
- #
60
- # @return [Nordlet::Capture::Types::SettingsUpdateCaptureResponse]
61
- def settings_update(request_options: {}, **params)
62
- params = Nordlet::Internal::Types::Utils.normalize_keys(params)
63
- request = Nordlet::Internal::JSON::Request.new(
64
- base_url: request_options[:base_url],
65
- method: "POST",
66
- path: "v1/capture/settings/update",
67
- body: Nordlet::Capture::Types::SettingsUpdateCaptureRequest.new(params).to_h,
68
- request_options: request_options
69
- )
70
- begin
71
- response = @client.send(request)
72
- rescue Net::HTTPRequestTimeout
73
- raise Nordlet::Errors::TimeoutError
74
- end
75
- code = response.code.to_i
76
- if code.between?(200, 299)
77
- Nordlet::Capture::Types::SettingsUpdateCaptureResponse.load(response.body)
78
- else
79
- error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
80
- raise error_class.new(response.body, code: code)
81
- end
82
- end
83
-
84
- # Replace the company's intake token, so the previous intake e-mail address stops working and the settings come
85
- # back with the new one.
86
- #
87
- # @param request_options [Hash]
88
- # @param params [Nordlet::Capture::Types::SettingsRegenerateIntakeCaptureRequest]
89
- # @option request_options [String] :base_url
90
- # @option request_options [Hash{String => Object}] :additional_headers
91
- # @option request_options [Hash{String => Object}] :additional_query_parameters
92
- # @option request_options [Hash{String => Object}] :additional_body_parameters
93
- # @option request_options [Integer] :timeout_in_seconds
94
- #
95
- # @return [Nordlet::Capture::Types::SettingsRegenerateIntakeCaptureResponse]
96
- def settings_regenerate_intake(request_options: {}, **params)
97
- params = Nordlet::Internal::Types::Utils.normalize_keys(params)
98
- request = Nordlet::Internal::JSON::Request.new(
99
- base_url: request_options[:base_url],
100
- method: "POST",
101
- path: "v1/capture/settings/regenerate-intake",
102
- body: Nordlet::Capture::Types::SettingsRegenerateIntakeCaptureRequest.new(params).to_h,
103
- request_options: request_options
104
- )
105
- begin
106
- response = @client.send(request)
107
- rescue Net::HTTPRequestTimeout
108
- raise Nordlet::Errors::TimeoutError
109
- end
110
- code = response.code.to_i
111
- if code.between?(200, 299)
112
- Nordlet::Capture::Types::SettingsRegenerateIntakeCaptureResponse.load(response.body)
113
- else
114
- error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
115
- raise error_class.new(response.body, code: code)
116
- end
117
- end
118
-
119
- # Endpoint for the inbound e-mail provider (Postmark field names or the generic `to`, `from`, `subject` and
120
- # `attachments` form). It needs the `x-inbound-secret` header and finds the company by the `intake+<token>@`
121
- # recipient address (404 when unknown, 403 when intake is disabled). Every PDF, image, Word or PowerPoint
122
- # attachment up to 10 MB becomes a `pending` capture (`accepted`), anything else is `skipped`; when the company
123
- # has automatic reading on, is not on trial and a reading provider is configured, each capture is read at once.
124
- #
125
- # @param request_options [Hash]
126
- # @param params [Nordlet::Capture::Types::InboundEmailCaptureRequest]
127
- # @option request_options [String] :base_url
128
- # @option request_options [Hash{String => Object}] :additional_headers
129
- # @option request_options [Hash{String => Object}] :additional_query_parameters
130
- # @option request_options [Hash{String => Object}] :additional_body_parameters
131
- # @option request_options [Integer] :timeout_in_seconds
132
- #
133
- # @return [Nordlet::Capture::Types::InboundEmailCaptureResponse]
134
- def inbound_email(request_options: {}, **params)
135
- params = Nordlet::Internal::Types::Utils.normalize_keys(params)
136
- request = Nordlet::Internal::JSON::Request.new(
137
- base_url: request_options[:base_url],
138
- method: "POST",
139
- path: "v1/capture/inbound-email",
140
- body: Nordlet::Capture::Types::InboundEmailCaptureRequest.new(params).to_h,
141
- request_options: request_options
142
- )
143
- begin
144
- response = @client.send(request)
145
- rescue Net::HTTPRequestTimeout
146
- raise Nordlet::Errors::TimeoutError
147
- end
148
- code = response.code.to_i
149
- if code.between?(200, 299)
150
- Nordlet::Capture::Types::InboundEmailCaptureResponse.load(response.body)
151
- else
152
- error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
153
- raise error_class.new(response.body, code: code)
154
- end
155
- end
156
-
157
- # Upload a supplier document (PDF, image, Word or PowerPoint, up to 10 MB; 422 for any other type) as a capture
158
- # and read it at once. The result holds the extracted supplier, dates, totals and lines, the partner matched by
159
- # VAT code, then partner code, then name, the raw text, and `status` `extracted` or `failed` with `error`. Needs a
160
- # configured reading provider, is refused with 402 for a company on trial until its first top-up, and counts every
161
- # page read as `ocr_page` usage. The draft is reviewed and saved with `capture/documents/confirm`.
162
- #
163
- # @param request_options [Hash]
164
- # @param params [Nordlet::Capture::Types::DocumentsUploadCaptureRequest]
165
- # @option request_options [String] :base_url
166
- # @option request_options [Hash{String => Object}] :additional_headers
167
- # @option request_options [Hash{String => Object}] :additional_query_parameters
168
- # @option request_options [Hash{String => Object}] :additional_body_parameters
169
- # @option request_options [Integer] :timeout_in_seconds
170
- #
171
- # @return [Nordlet::Capture::Types::DocumentsUploadCaptureResponse]
172
- def documents_upload(request_options: {}, **params)
173
- params = Nordlet::Internal::Types::Utils.normalize_keys(params)
174
- request = Nordlet::Internal::JSON::Request.new(
175
- base_url: request_options[:base_url],
176
- method: "POST",
177
- path: "v1/capture/documents/upload",
178
- body: Nordlet::Capture::Types::DocumentsUploadCaptureRequest.new(params).to_h,
179
- request_options: request_options
180
- )
181
- begin
182
- response = @client.send(request)
183
- rescue Net::HTTPRequestTimeout
184
- raise Nordlet::Errors::TimeoutError
185
- end
186
- code = response.code.to_i
187
- if code.between?(200, 299)
188
- Nordlet::Capture::Types::DocumentsUploadCaptureResponse.load(response.body)
189
- else
190
- error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
191
- raise error_class.new(response.body, code: code)
192
- end
193
- end
194
-
195
- # Read a stored capture again and replace its draft (supplier, totals, lines, matched partner). A capture received
196
- # over Peppol is parsed from its document again without a reading provider; any other needs the provider and, for
197
- # a company on trial, the first top-up (402). Refused with 409 once the capture is linked to a purchase invoice.
13
+ # Parse a capture received over Peppol from its stored document again and replace its draft (supplier, totals,
14
+ # lines, matched partner). Refused with 422 for a capture that was not received over Peppol and with 409 once the
15
+ # capture is linked to a purchase invoice.
198
16
  #
199
17
  # @param request_options [Hash]
200
18
  # @param params [Nordlet::Capture::Types::DocumentsExtractCaptureRequest]
@@ -228,7 +46,7 @@ module Nordlet
228
46
  end
229
47
  end
230
48
 
231
- # Return one capture with its extraction and raw text.
49
+ # Return one document received over Peppol (a capture) with its draft: supplier, dates, totals and lines.
232
50
  #
233
51
  # @param request_options [Hash]
234
52
  # @param params [Nordlet::Capture::Types::DocumentsGetCaptureRequest]
@@ -262,8 +80,8 @@ module Nordlet
262
80
  end
263
81
  end
264
82
 
265
- # List captures without raw text. Filterable by `status`, `matchedPartnerId` and `purchaseInvoiceId`; sortable by
266
- # `createdAt` and `updatedAt`.
83
+ # List the documents received over Peppol (captures) with their drafts. Filterable by `status`, `matchedPartnerId`
84
+ # and `purchaseInvoiceId`; sortable by `createdAt` and `updatedAt`.
267
85
  #
268
86
  # @param request_options [Hash]
269
87
  # @param params [Nordlet::Capture::Types::DocumentsListCaptureRequest]
@@ -34,6 +34,12 @@ module Nordlet
34
34
 
35
35
  field :journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "journalTransactionId"
36
36
 
37
+ field :reversed_at, -> { String }, optional: false, nullable: true, api_name: "reversedAt"
38
+
39
+ field :reversal_journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "reversalJournalTransactionId"
40
+
41
+ field :reversal_reason, -> { String }, optional: false, nullable: true, api_name: "reversalReason"
42
+
37
43
  field :credited_invoice_id, -> { String }, optional: false, nullable: true, api_name: "creditedInvoiceId"
38
44
 
39
45
  field :purchase_order_id, -> { String }, optional: false, nullable: true, api_name: "purchaseOrderId"
@@ -8,6 +8,7 @@ module Nordlet
8
8
 
9
9
  DRAFT = "draft"
10
10
  REGISTERED = "registered"
11
+ REVERSED = "reversed"
11
12
  end
12
13
  end
13
14
  end
@@ -34,6 +34,12 @@ module Nordlet
34
34
 
35
35
  field :journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "journalTransactionId"
36
36
 
37
+ field :reversed_at, -> { String }, optional: false, nullable: true, api_name: "reversedAt"
38
+
39
+ field :reversal_journal_transaction_id, -> { String }, optional: false, nullable: true, api_name: "reversalJournalTransactionId"
40
+
41
+ field :reversal_reason, -> { String }, optional: false, nullable: true, api_name: "reversalReason"
42
+
37
43
  field :credited_invoice_id, -> { String }, optional: false, nullable: true, api_name: "creditedInvoiceId"
38
44
 
39
45
  field :purchase_order_id, -> { String }, optional: false, nullable: true, api_name: "purchaseOrderId"
@@ -8,6 +8,7 @@ module Nordlet
8
8
 
9
9
  DRAFT = "draft"
10
10
  REGISTERED = "registered"
11
+ REVERSED = "reversed"
11
12
  end
12
13
  end
13
14
  end
@@ -12,16 +12,17 @@ module Nordlet
12
12
 
13
13
  # Creates a numbered cash receipt (series `KPO`) or cash disbursement (`KIO`) and posts it in the base currency
14
14
  # between the cash account (`cashAccountCode`, default the cash account of the company's chart) and
15
- # `counterAccountCode`; a receipt debits the cash account, a disbursement credits it. Linked to an invoice -
16
- # `saleInvoiceId` for a receipt against an issued invoice or advance invoice or a disbursement against an issued
17
- # credit note, `purchaseInvoiceId` for a disbursement against a registered purchase invoice - the counter account
18
- # is the receivable or payable account the invoice was posted to (its operation type's account, else the posting
19
- # rule), the invoice's paid amount and payment status (`partial` or `paid`) are updated, and `sale_invoice.paid`
20
- # or `purchase_invoice.paid` is emitted when the invoice becomes fully paid. Answers 422 when both invoice ids are
21
- # given, a receipt names a purchase invoice, `counterAccountCode` differs from the invoice's account, or the
22
- # invoice is in another currency or belongs to another partner; 409 when `amount` exceeds the invoice's remaining
23
- # amount, a disbursement would take the balance of the cash account below zero on `date` or any later date, or the
24
- # accounting period of `date` is locked.
15
+ # `counterAccountCode`; a receipt debits the cash account, a disbursement credits it. `counterAccountCode` is
16
+ # required (400 without it) unless `saleInvoiceId` or `purchaseInvoiceId` is given, also for an order with
17
+ # `employeeId`. Linked to an invoice - `saleInvoiceId` for a receipt against an issued invoice or advance invoice
18
+ # or a disbursement against an issued credit note, `purchaseInvoiceId` for a disbursement against a registered
19
+ # purchase invoice - the counter account is the receivable or payable account the invoice was posted to (its
20
+ # operation type's account, else the posting rule), the invoice's paid amount and payment status (`partial` or
21
+ # `paid`) are updated, and `sale_invoice.paid` or `purchase_invoice.paid` is emitted when the invoice becomes
22
+ # fully paid. Answers 422 when both invoice ids are given, a receipt names a purchase invoice,
23
+ # `counterAccountCode` differs from the invoice's account, or the invoice is in another currency or belongs to
24
+ # another partner; 409 when `amount` exceeds the invoice's remaining amount, a disbursement would take the balance
25
+ # of the cash account below zero on `date` or any later date, or the accounting period of `date` is locked.
25
26
  #
26
27
  # @param request_options [Hash]
27
28
  # @param params [Nordlet::Cash::Types::OrdersCreateCashRequest]
@@ -1433,7 +1433,8 @@ module Nordlet
1433
1433
  end
1434
1434
 
1435
1435
  # Changes the kind, amount, payment date, reference or description of a recorded tax payment; fields left out keep
1436
- # their value and an empty `reference` clears it. Answers 422 when the new amount is zero.
1436
+ # their value and an empty `reference` clears it. Answers 422 when the new amount is zero, and 409 when the kind
1437
+ # or amount of a payment booked from a bank transaction (`bank/transactions/post`) changes.
1437
1438
  #
1438
1439
  # @param request_options [Hash]
1439
1440
  # @param params [Nordlet::Declarations::Types::TaxPaymentsUpdateDeclarationsRequest]
@@ -1467,7 +1468,8 @@ module Nordlet
1467
1468
  end
1468
1469
  end
1469
1470
 
1470
- # Deletes a recorded tax payment.
1471
+ # Deletes a recorded tax payment. Answers 409 when the payment is booked from a bank transaction
1472
+ # (`bank/transactions/post`).
1471
1473
  #
1472
1474
  # @param request_options [Hash]
1473
1475
  # @param params [Nordlet::Declarations::Types::TaxPaymentsDeleteDeclarationsRequest]
@@ -3064,7 +3066,9 @@ module Nordlet
3064
3066
  # Lists the filing systems the company can configure: those of the company country (or of `country` when given),
3065
3067
  # the EU-wide systems and the cross-border e-invoicing systems `it_sdi`, `pl_ksef` and `ro_efactura`. Each row
3066
3068
  # carries the stored values, with a secret or certificate field shown as `__secret_set__` and the fields taken
3067
- # from the company profile filled from it.
3069
+ # from the company profile filled from it. Each field carries its `label` in the language of `Accept-Language`
3070
+ # (English otherwise) when Nordlet has one, and a `select` field its allowed values in `options`. Set the values
3071
+ # with `declarations/configs/update` {system, config: {key: value}}.
3068
3072
  #
3069
3073
  # @param request_options [Hash]
3070
3074
  # @param params [Nordlet::Declarations::Types::ConfigsListDeclarationsRequest]
@@ -6,6 +6,8 @@ module Nordlet
6
6
  class ConfigsListDeclarationsResponseRowsItemFieldsItem < Internal::Types::Model
7
7
  field :key, -> { String }, optional: false, nullable: false
8
8
 
9
+ field :label, -> { String }, optional: true, nullable: false
10
+
9
11
  field :kind, -> { Nordlet::Declarations::Types::ConfigsListDeclarationsResponseRowsItemFieldsItemKind }, optional: false, nullable: false
10
12
 
11
13
  field :multiline, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -6,6 +6,8 @@ module Nordlet
6
6
  class ConfigsUpdateDeclarationsResponseFieldsItem < Internal::Types::Model
7
7
  field :key, -> { String }, optional: false, nullable: false
8
8
 
9
+ field :label, -> { String }, optional: true, nullable: false
10
+
9
11
  field :kind, -> { Nordlet::Declarations::Types::ConfigsUpdateDeclarationsResponseFieldsItemKind }, optional: false, nullable: false
10
12
 
11
13
  field :multiline, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -113,7 +113,8 @@ module Nordlet
113
113
  end
114
114
 
115
115
  # Creates an employee record. `payrollOptions` holds the country-specific settings the payroll engine reads for
116
- # the person (see `hr/employees/fields`); `applyAllowance` defaults to true and `pensionAccumulation` to false.
116
+ # the person (see `hr/employees/fields`); `applyAllowance` defaults to true and `pensionAccumulation` to false. An
117
+ # `iban` whose check digits fail (ISO 13616) is refused with 422.
117
118
  #
118
119
  # @param request_options [Hash]
119
120
  # @param params [Nordlet::Hr::Types::EmployeesCreateHrRequest]
@@ -149,7 +150,7 @@ module Nordlet
149
150
 
150
151
  # Changes the given fields of an employee; a null clears the fields that allow it (code, personal code, birth
151
152
  # date, contact details, address, IBAN, social insurance number and start, hire date, notes). `status` and
152
- # `terminationDate` are set here too.
153
+ # `terminationDate` are set here too. An `iban` whose check digits fail (ISO 13616) is refused with 422.
153
154
  #
154
155
  # @param request_options [Hash]
155
156
  # @param params [Nordlet::Hr::Types::EmployeesUpdateHrRequest]
@@ -229,7 +229,9 @@ module Nordlet
229
229
  # yet, posts the pending ratable revenue recognition tranches scheduled up to the month end and emits
230
230
  # `revenue_recognition.posted` when there were any; when the month is the company's fiscal year end and no
231
231
  # year-end close is posted for that year, posts the year-end close that moves the income and expense balances of
232
- # the fiscal year to the retained earnings account (posting rule `closing.retainedEarnings`).
232
+ # the fiscal year to the retained earnings account (posting rule `closing.retainedEarnings`). The lock is not
233
+ # refused for open items: `warnings` lists them as `reports/period-checklist` does, for the month, or for the
234
+ # fiscal year when the month is the fiscal year end.
233
235
  #
234
236
  # @param request_options [Hash]
235
237
  # @param params [Nordlet::Ledger::Types::PeriodsLockLedgerRequest]
@@ -780,7 +782,8 @@ module Nordlet
780
782
  end
781
783
  end
782
784
 
783
- # Returns a journal transaction with its entries, ordered by account code.
785
+ # Returns a journal transaction with its entries, ordered by account code. `reversedByTransactionId` is the
786
+ # transaction posted by `ledger/journal/transactions/reverse` for a manual transaction, else null.
784
787
  #
785
788
  # @param request_options [Hash]
786
789
  # @param params [Nordlet::Ledger::Types::JournalTransactionsGetLedgerRequest]
@@ -816,9 +819,9 @@ module Nordlet
816
819
 
817
820
  # Posts a manual journal transaction (`documentType` `manual`, status `posted`) in the company's base currency.
818
821
  # Every `accountCode` must be a postable account of the chart, cost centers must exist and be active, projects
819
- # must exist, and the debits must equal the credits. Answers 422 for an amount with more than two decimals, for a
820
- # `currency` other than the base currency and for an inactive cost center, and 409 when the accounting period of
821
- # `date` is locked.
822
+ # must exist, and the debits must equal the credits. Answers 422 for an amount that is not whole cents (a third or
823
+ # fourth decimal other than zero; `10.5000` is accepted), for a `currency` other than the base currency and for an
824
+ # inactive cost center, and 409 when the accounting period of `date` is locked.
822
825
  #
823
826
  # @param request_options [Hash]
824
827
  # @param params [Nordlet::Ledger::Types::JournalTransactionsCreateLedgerRequest]
@@ -852,6 +855,44 @@ module Nordlet
852
855
  end
853
856
  end
854
857
 
858
+ # Posts a journal transaction (`documentType` `manual_reversal`, `documentId` the original) dated `date` (default
859
+ # the original date) whose entries mirror the original's (debits and credits swapped). Only a `manual` transaction
860
+ # is reversed here; a transaction posted by a document is reversed through that document. Answers 409 when the
861
+ # transaction is not manual, when it is already reversed and when the accounting period of `date` is locked, and
862
+ # 400 when `date` is before the original date.
863
+ #
864
+ # @param request_options [Hash]
865
+ # @param params [Nordlet::Ledger::Types::JournalTransactionsReverseLedgerRequest]
866
+ # @option request_options [String] :base_url
867
+ # @option request_options [Hash{String => Object}] :additional_headers
868
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
869
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
870
+ # @option request_options [Integer] :timeout_in_seconds
871
+ #
872
+ # @return [Nordlet::Ledger::Types::JournalTransactionsReverseLedgerResponse]
873
+ def journal_transactions_reverse(request_options: {}, **params)
874
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
875
+ request = Nordlet::Internal::JSON::Request.new(
876
+ base_url: request_options[:base_url],
877
+ method: "POST",
878
+ path: "v1/ledger/journal/transactions/reverse",
879
+ body: Nordlet::Ledger::Types::JournalTransactionsReverseLedgerRequest.new(params).to_h,
880
+ request_options: request_options
881
+ )
882
+ begin
883
+ response = @client.send(request)
884
+ rescue Net::HTTPRequestTimeout
885
+ raise Nordlet::Errors::TimeoutError
886
+ end
887
+ code = response.code.to_i
888
+ if code.between?(200, 299)
889
+ Nordlet::Ledger::Types::JournalTransactionsReverseLedgerResponse.load(response.body)
890
+ else
891
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
892
+ raise error_class.new(response.body, code: code)
893
+ end
894
+ end
895
+
855
896
  # The rows or codes of each return or registry deposit of the company country that are filled from account
856
897
  # balances. Accounts fall into a row by the layout defaults for the standard chart of accounts unless mapped under
857
898
  # Account → Statement rows.
@@ -22,6 +22,8 @@ module Nordlet
22
22
 
23
23
  field :posted_at, -> { String }, optional: false, nullable: true, api_name: "postedAt"
24
24
 
25
+ field :reversed_by_transaction_id, -> { String }, optional: false, nullable: true, api_name: "reversedByTransactionId"
26
+
25
27
  field :entries, -> { Internal::Types::Array[Nordlet::Ledger::Types::JournalTransactionsGetLedgerResponseEntriesItem] }, optional: false, nullable: false
26
28
  end
27
29
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Ledger
5
+ module Types
6
+ class JournalTransactionsReverseLedgerRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :reason, -> { String }, optional: false, nullable: false
10
+
11
+ field :date, -> { String }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Ledger
5
+ module Types
6
+ class JournalTransactionsReverseLedgerResponse < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :date, -> { String }, optional: false, nullable: false
10
+
11
+ field :description, -> { String }, optional: false, nullable: true
12
+
13
+ field :document_type, -> { String }, optional: false, nullable: true, api_name: "documentType"
14
+
15
+ field :document_id, -> { String }, optional: false, nullable: true, api_name: "documentId"
16
+
17
+ field :partner_id, -> { String }, optional: false, nullable: true, api_name: "partnerId"
18
+
19
+ field :status, -> { Nordlet::Ledger::Types::JournalTransactionsReverseLedgerResponseStatus }, optional: false, nullable: false
20
+
21
+ field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
22
+
23
+ field :posted_at, -> { String }, optional: false, nullable: true, api_name: "postedAt"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Ledger
5
+ module Types
6
+ module JournalTransactionsReverseLedgerResponseStatus
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ DRAFT = "draft"
10
+ POSTED = "posted"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -11,6 +11,8 @@ module Nordlet
11
11
  field :month, -> { Integer }, optional: false, nullable: false
12
12
 
13
13
  field :status, -> { Nordlet::Ledger::Types::PeriodsLockLedgerResponseStatus }, optional: false, nullable: false
14
+
15
+ field :warnings, -> { Internal::Types::Array[Nordlet::Ledger::Types::PeriodsLockLedgerResponseWarningsItem] }, optional: false, nullable: false
14
16
  end
15
17
  end
16
18
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Ledger
5
+ module Types
6
+ class PeriodsLockLedgerResponseWarningsItem < Internal::Types::Model
7
+ field :code, -> { Nordlet::Ledger::Types::PeriodsLockLedgerResponseWarningsItemCode }, optional: false, nullable: false
8
+
9
+ field :count, -> { Integer }, optional: false, nullable: false
10
+
11
+ field :message, -> { String }, optional: false, nullable: false
12
+
13
+ field :ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Ledger
5
+ module Types
6
+ module PeriodsLockLedgerResponseWarningsItemCode
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ DRAFT_SALE_DOCUMENTS = "draft_sale_documents"
10
+ DRAFT_PURCHASE_DOCUMENTS = "draft_purchase_documents"
11
+ UNBOOKED_BANK_LINES = "unbooked_bank_lines"
12
+ DEPRECIATION_NOT_POSTED = "depreciation_not_posted"
13
+ DEFERRALS_NOT_POSTED = "deferrals_not_posted"
14
+ RECURRING_INVOICES_NOT_GENERATED = "recurring_invoices_not_generated"
15
+ PAYROLL_RUNS_NOT_APPROVED = "payroll_runs_not_approved"
16
+ OPEN_FX_RECEIVABLES = "open_fx_receivables"
17
+ OPEN_FX_PAYABLES = "open_fx_payables"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -282,9 +282,9 @@ module Nordlet
282
282
  end
283
283
  end
284
284
 
285
- # Adds a bank account to the partner in `partnerId`. The IBAN is stored without spaces in upper case; an IBAN the
286
- # partner already has is refused with 409. With `isDefault` true the partner's other accounts lose their default
287
- # mark.
285
+ # Adds a bank account to the partner in `partnerId`. The IBAN is stored without spaces in upper case; an IBAN
286
+ # whose check digits fail (ISO 13616) is refused with 422 and one the partner already has with 409. With
287
+ # `isDefault` true the partner's other accounts lose their default mark.
288
288
  #
289
289
  # @param request_options [Hash]
290
290
  # @param params [Nordlet::Partners::Types::BankAccountsCreatePartnersRequest]
@@ -319,8 +319,8 @@ module Nordlet
319
319
  end
320
320
 
321
321
  # Changes the given fields of a partner bank account. A new IBAN is stored without spaces in upper case and is
322
- # refused with 409 when the partner already has it; when the account is the default after the change, the
323
- # partner's other accounts lose their default mark.
322
+ # refused with 422 when its check digits fail (ISO 13616) and with 409 when the partner already has it; when the
323
+ # account is the default after the change, the partner's other accounts lose their default mark.
324
324
  #
325
325
  # @param request_options [Hash]
326
326
  # @param params [Nordlet::Partners::Types::BankAccountsUpdatePartnersRequest]
@@ -797,9 +797,11 @@ module Nordlet
797
797
  end
798
798
  end
799
799
 
800
- # Returns the live partner matched by `code`, then `vatCode`, then `email` (at least one is required), or creates
801
- # one from the body with the same validation and VIES check as `partners/create`; `created` says which happened. A
802
- # creation that loses a race on the partner code returns the partner the other call created.
800
+ # Returns the live partner matched by `code`, then `vatCode` (compared without spaces, dots and dashes and without
801
+ # regard to case), then `email` (at least one is required), or creates one from the body with the same validation
802
+ # and VIES check as `partners/create`; `created` says which happened. Without `isCustomer` a new partner is a
803
+ # customer unless `isSupplier` is true. A creation that loses a race on the partner code returns the partner the
804
+ # other call created.
803
805
  #
804
806
  # @param request_options [Hash]
805
807
  # @param params [Nordlet::Partners::Types::FindOrCreatePartnersRequest]
@@ -38,6 +38,8 @@ module Nordlet
38
38
 
39
39
  field :card_payment_received, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "cardPaymentReceived"
40
40
 
41
+ field :sent_with, -> { String }, optional: false, nullable: true, api_name: "sentWith"
42
+
41
43
  field :seller, -> { Nordlet::Public::Types::InvoicesGetPublicResponseSeller }, optional: false, nullable: false
42
44
 
43
45
  field :buyer, -> { Nordlet::Public::Types::InvoicesGetPublicResponseBuyer }, optional: false, nullable: false