Sha256: fd8efad6802b29ae1da39c1625fffbcfb95e9316b49329f053fd127d62ce26bd
Contents?: true
Size: 1.48 KB
Versions: 3
Compression:
Stored size: 1.48 KB
Contents
# frozen_string_literal: true module Api module V1 module Expense # This class is responsible for all the API calls related to expense vouchers. class Vouchers < Api::V1::Base def by(id:, pdf: false) if pdf == true return get("#{@url_api_path}/expense/vouchers/#{id}/pdf", nil, { headers: { 'Content-Type' => 'application/pdf' } }) end get("#{@url_api_path}/expense/vouchers/#{id}") end def all(page: 1, # rubocop:disable Metrics/CyclomaticComplexity page_size: 100, order_by: nil, order_direction: nil, creditor_id: nil, project_id: nil, document_date_range_start: nil, document_date_range_end: nil) query = { page: page, page_size: page_size } query[:order_by] = order_by if order_by query[:order_direction] = order_direction if order_direction query[:creditor_id] = creditor_id if creditor_id query[:project_id] = project_id if project_id query[:document_date_range_start] = document_date_range_start if document_date_range_start if document_date_range_end && document_date_range_start query[:document_date_range_end] = document_date_range_end end get("#{@url_api_path}/expense/vouchers", query) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
papierkram_api_client-0.1.2 | lib/api/v1/expense/vouchers.rb |
papierkram_api_client-0.1.1 | lib/api/v1/expense/vouchers.rb |
papierkram_api_client-0.1.0 | lib/api/v1/expense/vouchers.rb |