class Flexibee::InvoiceTypes

Public Class Methods

new(client) click to toggle source
# File lib/flexibee/invoice_types.rb, line 6
def initialize(client)
  @client = client
end

Public Instance Methods

find(filter=nil) click to toggle source
# File lib/flexibee/invoice_types.rb, line 19
def find(filter=nil)
  @client.get("/typ-faktury-vydane", {}, filter)['winstrom']['typ-faktury-vydane']
end
invoice_types() click to toggle source
# File lib/flexibee/invoice_types.rb, line 10
def invoice_types
  find.map do |type|
    currency = type['mena'].split(':').last
    currency_name = type['mena@showAs'].split(':').last.strip
    Flexibee::InvoiceType.new(type['id'], type['lastUpdate'],
      type['kod'], type['nazev'], currency, type['mena@ref'], currency_name)
  end
end