Class: ZohoInvoice::Invoice

Inherits:
Base
  • Object
show all
Defined in:
lib/zoho_invoice/invoice.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Class Method Summary collapse

Methods inherited from Base

#attributes, create, create_attributes, define_object_attrs, has_many, #initialize, #reflections, #save, search, #to_xml

Constructor Details

This class inherits a constructor from ZohoInvoice::Base

Class Method Details

.all(client) ⇒ Object



48
49
50
# File 'lib/zoho_invoice/invoice.rb', line 48

def self.all(client)
  retrieve(client, '/api/invoices')
end

.find_by_customer_id(client, id, options = {}) ⇒ Object



24
25
26
# File 'lib/zoho_invoice/invoice.rb', line 24

def self.find_by_customer_id(client, id, options = {})
  retrieve(client, "/api/invoices/customer/#{id}")
end

.find_by_multiple_customer_ids(client, ids, options = {}) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/zoho_invoice/invoice.rb', line 28

def self.find_by_multiple_customer_ids(client, ids, options={})
  new_hash = {}
  ids.each do |customer|
    new_hash[customer] = self.find_by_customer_id(client, customer, options)
  end
  return new_hash
end

.find_unpaid_by_customer_id(client, id, options = {}) ⇒ Object



36
37
38
# File 'lib/zoho_invoice/invoice.rb', line 36

def self.find_unpaid_by_customer_id(client, id, options = {})
  retrieve(client, "/api/invoices/unpaid/customer/#{id}")
end

.find_unpaid_by_multiple_customer_ids(client, ids, options = {}) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/zoho_invoice/invoice.rb', line 40

def self.find_unpaid_by_multiple_customer_ids(client, ids, options={})
  new_hash = {}
  ids.each do |customer|
    new_hash[customer] = self.find_unpaid_by_customer_id(client, customer, options)
  end
  return new_hash
end