Class: TripletexApi::LedgervoucherApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_api/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_api/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_api/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)


28
29
30
31
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 28

def delete(id, opts = {})
  delete_with_http_info(id, opts)
  return nil
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



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
71
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 38

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 attachment by voucher ID.

Parameters:

  • voucher_id

    Voucher ID from which PDF is downloaded.

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

    the optional parameters

Returns:

  • (String)


78
79
80
81
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 78

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

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

Get attachment by voucher 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



88
89
90
91
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
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 88

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

#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:



132
133
134
135
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 132

def get(id, opts = {})
  data, _status_code, _headers = get_with_http_info(id, opts)
  return 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



143
144
145
146
147
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
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 143

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:



187
188
189
190
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 187

def import_document(file, opts = {})
  data, _status_code, _headers = import_document_with_http_info(file, opts)
  return 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



199
200
201
202
203
204
205
206
207
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
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 199

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)


247
248
249
250
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 247

def import_gbat10(generate_vat_postings, file, opts = {})
  import_gbat10_with_http_info(generate_vat_postings, file, opts)
  return 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



259
260
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
297
298
299
300
301
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 259

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:



315
316
317
318
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 315

def non_posted(include_non_approved, opts = {})
  data, _status_code, _headers = non_posted_with_http_info(include_non_approved, opts)
  return 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



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 332

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

#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:



382
383
384
385
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 382

def post(opts = {})
  data, _status_code, _headers = post_with_http_info(opts)
  return 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



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
418
419
420
421
422
423
424
425
426
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 393

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:



435
436
437
438
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 435

def put(id, opts = {})
  data, _status_code, _headers = put_with_http_info(id, opts)
  return 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:



492
493
494
495
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 492

def put_list(opts = {})
  data, _status_code, _headers = put_list_with_http_info(opts)
  return 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



503
504
505
506
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
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 503

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



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
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 447

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:



544
545
546
547
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 544

def reverse(id, date, opts = {})
  data, _status_code, _headers = reverse_with_http_info(id, date, opts)
  return 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



555
556
557
558
559
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
594
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 555

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:



611
612
613
614
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 611

def search(date_from, date_to, opts = {})
  data, _status_code, _headers = search_with_http_info(date_from, date_to, opts)
  return 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



631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 631

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:



689
690
691
692
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 689

def send_to_inbox(id, opts = {})
  data, _status_code, _headers = send_to_inbox_with_http_info(id, opts)
  return 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



701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 701

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:



750
751
752
753
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 750

def send_to_ledger(id, opts = {})
  data, _status_code, _headers = send_to_ledger_with_http_info(id, opts)
  return 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



762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 762

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_pdf(voucher_id, file_name, file, opts = {}) ⇒ nil

Upload attachment to voucher. Send as multipart form.

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)


815
816
817
818
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 815

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

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

Upload attachment to voucher. Send as multipart form.

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



827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
# File 'lib/tripletex_api/api/ledgervoucher_api.rb', line 827

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