Class: TripletexRubyClient::LedgervoucherApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_ruby_client/api/ledgervoucher_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LedgervoucherApi

Returns a new instance of LedgervoucherApi.



19
20
21
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete(id, opts = {}) ⇒ nil

BETA

Delete voucher by ID.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 27

def delete(id, opts = {})
  delete_with_http_info(id, opts)
  nil
end

#delete_attachment(voucher_id, opts = {}) ⇒ nil

BETA

Delete attachment.

Parameters:

  • voucher_id

    ID of voucher containing the attachment to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher containing the attachment to delete.

  • :send_to_inbox (BOOLEAN)

    Should the attachment be sent to inbox rather than deleted? (default to false)

  • :split (BOOLEAN)

    If sendToInbox is true, should the attachment be split into one voucher per page? (default to false)

Returns:

  • (nil)


79
80
81
82
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 79

def delete_attachment(voucher_id, opts = {})
  delete_attachment_with_http_info(voucher_id, opts)
  nil
end

#delete_attachment_with_http_info(voucher_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

BETA

Delete attachment.

Parameters:

  • voucher_id

    ID of voucher containing the attachment to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher containing the attachment to delete.

  • :send_to_inbox (BOOLEAN)

    Should the attachment be sent to inbox rather than deleted?

  • :split (BOOLEAN)

    If sendToInbox is true, should the attachment be split into one voucher per page?

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 92

def delete_attachment_with_http_info(voucher_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.delete_attachment ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling LedgervoucherApi.delete_attachment"
  end
  if @api_client.config.client_side_validation && !opts[:'version'].nil? && opts[:'version'] < 0
    fail ArgumentError, 'invalid value for "opts[:"version"]" when calling LedgervoucherApi.delete_attachment, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ledger/voucher/{voucherId}/attachment'.sub('{' + 'voucherId' + '}', voucher_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
  query_params[:'sendToInbox'] = opts[:'send_to_inbox'] if !opts[:'send_to_inbox'].nil?
  query_params[:'split'] = opts[:'split'] if !opts[:'split'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#delete_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

BETA

Delete voucher by ID.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 37

def delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LedgervoucherApi.delete"
  end
  # resource path
  local_var_path = '/ledger/voucher/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_pdf(voucher_id, opts = {}) ⇒ String

Get PDF representation of voucher by ID.

Parameters:

  • voucher_id

    Voucher ID from which PDF is downloaded.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


138
139
140
141
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 138

def download_pdf(voucher_id, opts = {})
  data, _status_code, _headers = download_pdf_with_http_info(voucher_id, opts)
  data
end

#download_pdf_with_http_info(voucher_id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get PDF representation of voucher by ID.

Parameters:

  • voucher_id

    Voucher ID from which PDF is downloaded.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 148

def download_pdf_with_http_info(voucher_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.download_pdf ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling LedgervoucherApi.download_pdf"
  end
  # resource path
  local_var_path = '/ledger/voucher/{voucherId}/pdf'.sub('{' + 'voucherId' + '}', voucher_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#download_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#external_voucher_number(opts = {}) ⇒ ListResponseVoucher

BETA

Find vouchers based on the external voucher number.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :external_voucher_number (String)

    The external voucher number, when voucher is created from import.

  • :from (Integer)

    From index (default to 0)

  • :count (Integer)

    Number of elements to return (default to 1000)

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:



194
195
196
197
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 194

def external_voucher_number(opts = {})
  data, _status_code, _headers = external_voucher_number_with_http_info(opts)
  data
end

#external_voucher_number_with_http_info(opts = {}) ⇒ Array<(ListResponseVoucher, Fixnum, Hash)>

BETA

Find vouchers based on the external voucher number.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :external_voucher_number (String)

    The external voucher number, when voucher is created from import.

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

  • (Array<(ListResponseVoucher, Fixnum, Hash)>)

    ListResponseVoucher data, response status code and response headers



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 208

def external_voucher_number_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.external_voucher_number ...'
  end
  # resource path
  local_var_path = '/ledger/voucher/>externalVoucherNumber'

  # query parameters
  query_params = {}
  query_params[:'externalVoucherNumber'] = opts[:'external_voucher_number'] if !opts[:'external_voucher_number'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#external_voucher_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(id, opts = {}) ⇒ ResponseWrapperVoucher

Get voucher by ID.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



250
251
252
253
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 250

def get(id, opts = {})
  data, _status_code, _headers = get_with_http_info(id, opts)
  data
end

#get_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperVoucher, Fixnum, Hash)>

Get voucher by ID.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:

  • (Array<(ResponseWrapperVoucher, Fixnum, Hash)>)

    ResponseWrapperVoucher data, response status code and response headers



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 261

def get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LedgervoucherApi.get"
  end
  # resource path
  local_var_path = '/ledger/voucher/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_document(file, opts = {}) ⇒ ListResponseVoucher

BETA

Upload a document to create one or more vouchers. Valid document formats are PDF, PNG, JPEG, TIFF and EHF. Send as multipart form.

Parameters:

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :description (String)

    Optional description to use for the voucher(s). If omitted the file name will be used.

  • :split (BOOLEAN)

    If the document consists of several pages, should the document be split into one voucher per page? (default to false)

Returns:



304
305
306
307
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 304

def import_document(file, opts = {})
  data, _status_code, _headers = import_document_with_http_info(file, opts)
  data
end

#import_document_with_http_info(file, opts = {}) ⇒ Array<(ListResponseVoucher, Fixnum, Hash)>

BETA

Upload a document to create one or more vouchers. Valid document formats are PDF, PNG, JPEG, TIFF and EHF. Send as multipart form.

Parameters:

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :description (String)

    Optional description to use for the voucher(s). If omitted the file name will be used.

  • :split (BOOLEAN)

    If the document consists of several pages, should the document be split into one voucher per page?

Returns:

  • (Array<(ListResponseVoucher, Fixnum, Hash)>)

    ListResponseVoucher data, response status code and response headers



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 316

def import_document_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.import_document ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling LedgervoucherApi.import_document"
  end
  # resource path
  local_var_path = '/ledger/voucher/importDocument'

  # query parameters
  query_params = {}
  query_params[:'split'] = opts[:'split'] if !opts[:'split'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file
  form_params['description'] = opts[:'description'] if !opts[:'description'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#import_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_gbat10(generate_vat_postings, file, opts = {}) ⇒ nil

Import GBAT10. Send as multipart form.

Parameters:

  • generate_vat_postings

    If the import should generate VAT postings

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :encoding (String)

    The file encoding (default to utf-8)

Returns:

  • (nil)


363
364
365
366
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 363

def import_gbat10(generate_vat_postings, file, opts = {})
  import_gbat10_with_http_info(generate_vat_postings, file, opts)
  nil
end

#import_gbat10_with_http_info(generate_vat_postings, file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Import GBAT10. Send as multipart form.

Parameters:

  • generate_vat_postings

    If the import should generate VAT postings

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :encoding (String)

    The file encoding

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 375

def import_gbat10_with_http_info(generate_vat_postings, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.import_gbat10 ...'
  end
  # verify the required parameter 'generate_vat_postings' is set
  if @api_client.config.client_side_validation && generate_vat_postings.nil?
    fail ArgumentError, "Missing the required parameter 'generate_vat_postings' when calling LedgervoucherApi.import_gbat10"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling LedgervoucherApi.import_gbat10"
  end
  # resource path
  local_var_path = '/ledger/voucher/importGbat10'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['generateVatPostings'] = generate_vat_postings
  form_params['file'] = file
  form_params['encoding'] = opts[:'encoding'] if !opts[:'encoding'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#import_gbat10\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#non_posted(include_non_approved, opts = {}) ⇒ ListResponseVoucher

BETA

Find non-posted vouchers.

Parameters:

  • include_non_approved

    Include non-approved vouchers in the result.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date_from (String)

    From and including

  • :date_to (String)

    To and excluding

  • :changed_since (String)

    Only return elements that have changed since this date and time

  • :from (Integer)

    From index (default to 0)

  • :count (Integer)

    Number of elements to return (default to 1000)

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:



430
431
432
433
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 430

def non_posted(include_non_approved, opts = {})
  data, _status_code, _headers = non_posted_with_http_info(include_non_approved, opts)
  data
end

#non_posted_with_http_info(include_non_approved, opts = {}) ⇒ Array<(ListResponseVoucher, Fixnum, Hash)>

BETA

Find non-posted vouchers.

Parameters:

  • include_non_approved

    Include non-approved vouchers in the result.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date_from (String)

    From and including

  • :date_to (String)

    To and excluding

  • :changed_since (String)

    Only return elements that have changed since this date and time

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

  • (Array<(ListResponseVoucher, Fixnum, Hash)>)

    ListResponseVoucher data, response status code and response headers



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 447

def non_posted_with_http_info(include_non_approved, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.non_posted ...'
  end
  # verify the required parameter 'include_non_approved' is set
  if @api_client.config.client_side_validation && include_non_approved.nil?
    fail ArgumentError, "Missing the required parameter 'include_non_approved' when calling LedgervoucherApi.non_posted"
  end
  # resource path
  local_var_path = '/ledger/voucher/>nonPosted'

  # query parameters
  query_params = {}
  query_params[:'includeNonApproved'] = include_non_approved
  query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
  query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
  query_params[:'changedSince'] = opts[:'changed_since'] if !opts[:'changed_since'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#non_posted\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#options(id, opts = {}) ⇒ ResponseWrapperVoucherOptions

BETA

Returns a data structure containing meta information about operations that are available for this voucher. Currently only implemented for DELETE: It is possible to check if the voucher is deletable.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



496
497
498
499
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 496

def options(id, opts = {})
  data, _status_code, _headers = options_with_http_info(id, opts)
  data
end

#options_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperVoucherOptions, Fixnum, Hash)>

BETA

Returns a data structure containing meta information about operations that are available for this voucher. Currently only implemented for DELETE: It is possible to check if the voucher is deletable.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 507

def options_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.options ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LedgervoucherApi.options"
  end
  # resource path
  local_var_path = '/ledger/voucher/{id}/options'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperVoucherOptions')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post(opts = {}) ⇒ ResponseWrapperVoucher

Add new voucher. IMPORTANT: Also creates postings. Only the gross amounts will be used

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :send_to_ledger (BOOLEAN)

    Should the voucher be sent to ledger? Requires the &quot;Advanced Voucher&quot; permission. (default to true)

  • :body (Voucher)

    JSON representing the new object to be created. Should not have ID and version set.

Returns:



549
550
551
552
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 549

def post(opts = {})
  data, _status_code, _headers = post_with_http_info(opts)
  data
end

#post_with_http_info(opts = {}) ⇒ Array<(ResponseWrapperVoucher, Fixnum, Hash)>

Add new voucher. IMPORTANT: Also creates postings. Only the gross amounts will be used

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :send_to_ledger (BOOLEAN)

    Should the voucher be sent to ledger? Requires the &quot;Advanced Voucher&quot; permission.

  • :body (Voucher)

    JSON representing the new object to be created. Should not have ID and version set.

Returns:

  • (Array<(ResponseWrapperVoucher, Fixnum, Hash)>)

    ResponseWrapperVoucher data, response status code and response headers



560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 560

def post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.post ...'
  end
  # resource path
  local_var_path = '/ledger/voucher'

  # query parameters
  query_params = {}
  query_params[:'sendToLedger'] = opts[:'send_to_ledger'] if !opts[:'send_to_ledger'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put(id, opts = {}) ⇒ ResponseWrapperVoucher

BETA

Update voucher. Postings with guiRow==0 will be deleted and regenerated.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :send_to_ledger (BOOLEAN)

    Should the voucher be sent to ledger? Requires the &quot;Advanced Voucher&quot; permission. (default to true)

  • :body (Voucher)

    Partial object describing what should be updated

Returns:



601
602
603
604
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 601

def put(id, opts = {})
  data, _status_code, _headers = put_with_http_info(id, opts)
  data
end

#put_list(opts = {}) ⇒ ListResponseVoucher

BETA

Update multiple vouchers. Postings with guiRow==0 will be deleted and regenerated.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :send_to_ledger (BOOLEAN)

    Should the voucher be sent to ledger? Requires the &quot;Advanced Voucher&quot; permission. (default to true)

  • :body (Array<Voucher>)

    JSON representing updates to object. Should have ID and version set.

Returns:



657
658
659
660
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 657

def put_list(opts = {})
  data, _status_code, _headers = put_list_with_http_info(opts)
  data
end

#put_list_with_http_info(opts = {}) ⇒ Array<(ListResponseVoucher, Fixnum, Hash)>

BETA

Update multiple vouchers. Postings with guiRow&#x3D;&#x3D;0 will be deleted and regenerated.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :send_to_ledger (BOOLEAN)

    Should the voucher be sent to ledger? Requires the &quot;Advanced Voucher&quot; permission.

  • :body (Array<Voucher>)

    JSON representing updates to object. Should have ID and version set.

Returns:

  • (Array<(ListResponseVoucher, Fixnum, Hash)>)

    ListResponseVoucher data, response status code and response headers



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 668

def put_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.put_list ...'
  end
  # resource path
  local_var_path = '/ledger/voucher/list'

  # query parameters
  query_params = {}
  query_params[:'sendToLedger'] = opts[:'send_to_ledger'] if !opts[:'send_to_ledger'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#put_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperVoucher, Fixnum, Hash)>

BETA

Update voucher. Postings with guiRow&#x3D;&#x3D;0 will be deleted and regenerated.

Parameters:

  • id

    Element ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :send_to_ledger (BOOLEAN)

    Should the voucher be sent to ledger? Requires the &quot;Advanced Voucher&quot; permission.

  • :body (Voucher)

    Partial object describing what should be updated

Returns:

  • (Array<(ResponseWrapperVoucher, Fixnum, Hash)>)

    ResponseWrapperVoucher data, response status code and response headers



613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 613

def put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.put ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LedgervoucherApi.put"
  end
  # resource path
  local_var_path = '/ledger/voucher/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'sendToLedger'] = opts[:'send_to_ledger'] if !opts[:'send_to_ledger'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reverse(id, date, opts = {}) ⇒ ResponseWrapperVoucher

Reverses the voucher, and returns the reversed voucher. Supports reversing most voucher types, except salary transactions.

Parameters:

  • id

    ID of voucher that should be reversed.

  • date

    Reverse voucher date

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



708
709
710
711
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 708

def reverse(id, date, opts = {})
  data, _status_code, _headers = reverse_with_http_info(id, date, opts)
  data
end

#reverse_with_http_info(id, date, opts = {}) ⇒ Array<(ResponseWrapperVoucher, Fixnum, Hash)>

Reverses the voucher, and returns the reversed voucher. Supports reversing most voucher types, except salary transactions.

Parameters:

  • id

    ID of voucher that should be reversed.

  • date

    Reverse voucher date

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseWrapperVoucher, Fixnum, Hash)>)

    ResponseWrapperVoucher data, response status code and response headers



719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 719

def reverse_with_http_info(id, date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.reverse ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LedgervoucherApi.reverse"
  end
  # verify the required parameter 'date' is set
  if @api_client.config.client_side_validation && date.nil?
    fail ArgumentError, "Missing the required parameter 'date' when calling LedgervoucherApi.reverse"
  end
  # resource path
  local_var_path = '/ledger/voucher/{id}/:reverse'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'date'] = date

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#reverse\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search(date_from, date_to, opts = {}) ⇒ VoucherSearchResponse

Find vouchers corresponding with sent data.

Parameters:

  • date_from

    From and including

  • date_to

    To and excluding

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (String)

    List of IDs

  • :number (String)

    List of IDs

  • :number_from (Integer)

    From and including

  • :number_to (Integer)

    To and excluding

  • :type_id (String)

    List of IDs

  • :from (Integer)

    From index (default to 0)

  • :count (Integer)

    Number of elements to return (default to 1000)

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:



774
775
776
777
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 774

def search(date_from, date_to, opts = {})
  data, _status_code, _headers = search_with_http_info(date_from, date_to, opts)
  data
end

#search_with_http_info(date_from, date_to, opts = {}) ⇒ Array<(VoucherSearchResponse, Fixnum, Hash)>

Find vouchers corresponding with sent data.

Parameters:

  • date_from

    From and including

  • date_to

    To and excluding

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (String)

    List of IDs

  • :number (String)

    List of IDs

  • :number_from (Integer)

    From and including

  • :number_to (Integer)

    To and excluding

  • :type_id (String)

    List of IDs

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

  • (Array<(VoucherSearchResponse, Fixnum, Hash)>)

    VoucherSearchResponse data, response status code and response headers



794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 794

def search_with_http_info(date_from, date_to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.search ...'
  end
  # verify the required parameter 'date_from' is set
  if @api_client.config.client_side_validation && date_from.nil?
    fail ArgumentError, "Missing the required parameter 'date_from' when calling LedgervoucherApi.search"
  end
  # verify the required parameter 'date_to' is set
  if @api_client.config.client_side_validation && date_to.nil?
    fail ArgumentError, "Missing the required parameter 'date_to' when calling LedgervoucherApi.search"
  end
  # resource path
  local_var_path = '/ledger/voucher'

  # query parameters
  query_params = {}
  query_params[:'dateFrom'] = date_from
  query_params[:'dateTo'] = date_to
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?
  query_params[:'numberFrom'] = opts[:'number_from'] if !opts[:'number_from'].nil?
  query_params[:'numberTo'] = opts[:'number_to'] if !opts[:'number_to'].nil?
  query_params[:'typeId'] = opts[:'type_id'] if !opts[:'type_id'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'VoucherSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_to_inbox(id, opts = {}) ⇒ ResponseWrapperVoucher

BETA

Send voucher to inbox.

Parameters:

  • id

    ID of voucher that should be sent to inbox.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher that should be sent to inbox.

  • :comment (String)

    Description of why the voucher was rejected. This parameter is only used if the approval feature is enabled.

Returns:



851
852
853
854
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 851

def send_to_inbox(id, opts = {})
  data, _status_code, _headers = send_to_inbox_with_http_info(id, opts)
  data
end

#send_to_inbox_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperVoucher, Fixnum, Hash)>

BETA

Send voucher to inbox.

Parameters:

  • id

    ID of voucher that should be sent to inbox.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher that should be sent to inbox.

  • :comment (String)

    Description of why the voucher was rejected. This parameter is only used if the approval feature is enabled.

Returns:

  • (Array<(ResponseWrapperVoucher, Fixnum, Hash)>)

    ResponseWrapperVoucher data, response status code and response headers



863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 863

def send_to_inbox_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.send_to_inbox ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LedgervoucherApi.send_to_inbox"
  end
  if @api_client.config.client_side_validation && !opts[:'version'].nil? && opts[:'version'] < 0
    fail ArgumentError, 'invalid value for "opts[:"version"]" when calling LedgervoucherApi.send_to_inbox, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ledger/voucher/{id}/:sendToInbox'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
  query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#send_to_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_to_ledger(id, opts = {}) ⇒ ResponseWrapperVoucher

BETA

Send voucher to ledger.

Parameters:

  • id

    ID of voucher that should be sent to ledger.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher that should be sent to ledger.

  • :number (Integer)

    Voucher number to use. If omitted or 0 the system will assign the number. (default to 0)

Returns:



911
912
913
914
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 911

def send_to_ledger(id, opts = {})
  data, _status_code, _headers = send_to_ledger_with_http_info(id, opts)
  data
end

#send_to_ledger_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperVoucher, Fixnum, Hash)>

BETA

Send voucher to ledger.

Parameters:

  • id

    ID of voucher that should be sent to ledger.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    Version of voucher that should be sent to ledger.

  • :number (Integer)

    Voucher number to use. If omitted or 0 the system will assign the number.

Returns:

  • (Array<(ResponseWrapperVoucher, Fixnum, Hash)>)

    ResponseWrapperVoucher data, response status code and response headers



923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 923

def send_to_ledger_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.send_to_ledger ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LedgervoucherApi.send_to_ledger"
  end
  if @api_client.config.client_side_validation && !opts[:'version'].nil? && opts[:'version'] < 0
    fail ArgumentError, 'invalid value for "opts[:"version"]" when calling LedgervoucherApi.send_to_ledger, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] < 0
    fail ArgumentError, 'invalid value for "opts[:"number"]" when calling LedgervoucherApi.send_to_ledger, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/ledger/voucher/{id}/:sendToLedger'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
  query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#send_to_ledger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_attachment(voucher_id, file, opts = {}) ⇒ nil

Upload attachment to voucher. If the voucher already has an attachment the content will be appended to the existing attachment as new PDF page(s). Valid document formats are PDF, PNG, JPEG and TIFF. Non PDF formats will be converted to PDF. Send as multipart form.

Parameters:

  • voucher_id

    Voucher ID to upload attachment to.

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


974
975
976
977
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 974

def upload_attachment(voucher_id, file, opts = {})
  upload_attachment_with_http_info(voucher_id, file, opts)
  nil
end

#upload_attachment_with_http_info(voucher_id, file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Upload attachment to voucher. If the voucher already has an attachment the content will be appended to the existing attachment as new PDF page(s). Valid document formats are PDF, PNG, JPEG and TIFF. Non PDF formats will be converted to PDF. Send as multipart form.

Parameters:

  • voucher_id

    Voucher ID to upload attachment to.

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 985

def upload_attachment_with_http_info(voucher_id, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.upload_attachment ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling LedgervoucherApi.upload_attachment"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling LedgervoucherApi.upload_attachment"
  end
  # resource path
  local_var_path = '/ledger/voucher/{voucherId}/attachment'.sub('{' + 'voucherId' + '}', voucher_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#upload_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_pdf(voucher_id, file_name, file, opts = {}) ⇒ nil

DEPRECATED

Use POST ledger/voucher/voucherId/attachment instead.

Parameters:

  • voucher_id

    Voucher ID to upload PDF to.

  • file_name

    File name to store the pdf under. Will not be the same as the filename on the file returned.

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1033
1034
1035
1036
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 1033

def upload_pdf(voucher_id, file_name, file, opts = {})
  upload_pdf_with_http_info(voucher_id, file_name, file, opts)
  nil
end

#upload_pdf_with_http_info(voucher_id, file_name, file, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

DEPRECATED

Use POST ledger/voucher/voucherId/attachment instead.

Parameters:

  • voucher_id

    Voucher ID to upload PDF to.

  • file_name

    File name to store the pdf under. Will not be the same as the filename on the file returned.

  • file

    The file

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 1045

def upload_pdf_with_http_info(voucher_id, file_name, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.upload_pdf ...'
  end
  # verify the required parameter 'voucher_id' is set
  if @api_client.config.client_side_validation && voucher_id.nil?
    fail ArgumentError, "Missing the required parameter 'voucher_id' when calling LedgervoucherApi.upload_pdf"
  end
  # verify the required parameter 'file_name' is set
  if @api_client.config.client_side_validation && file_name.nil?
    fail ArgumentError, "Missing the required parameter 'file_name' when calling LedgervoucherApi.upload_pdf"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling LedgervoucherApi.upload_pdf"
  end
  # resource path
  local_var_path = '/ledger/voucher/{voucherId}/pdf/{fileName}'.sub('{' + 'voucherId' + '}', voucher_id.to_s).sub('{' + 'fileName' + '}', file_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#upload_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#voucher_reception(opts = {}) ⇒ ListResponseVoucher

Find vouchers in voucher reception.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date_from (String)

    From and including

  • :date_to (String)

    To and excluding

  • :search_text (String)

    Search

  • :from (Integer)

    From index (default to 0)

  • :count (Integer)

    Number of elements to return (default to 1000)

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:



1101
1102
1103
1104
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 1101

def voucher_reception(opts = {})
  data, _status_code, _headers = voucher_reception_with_http_info(opts)
  data
end

#voucher_reception_with_http_info(opts = {}) ⇒ Array<(ListResponseVoucher, Fixnum, Hash)>

Find vouchers in voucher reception.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date_from (String)

    From and including

  • :date_to (String)

    To and excluding

  • :search_text (String)

    Search

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

  • (Array<(ListResponseVoucher, Fixnum, Hash)>)

    ListResponseVoucher data, response status code and response headers



1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
# File 'lib/tripletex_ruby_client/api/ledgervoucher_api.rb', line 1117

def voucher_reception_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LedgervoucherApi.voucher_reception ...'
  end
  # resource path
  local_var_path = '/ledger/voucher/>voucherReception'

  # query parameters
  query_params = {}
  query_params[:'dateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil?
  query_params[:'dateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil?
  query_params[:'searchText'] = opts[:'search_text'] if !opts[:'search_text'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseVoucher')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LedgervoucherApi#voucher_reception\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end