Class: Economic::CashBookEntryProxy

Inherits:
EntityProxy show all
Defined in:
lib/economic/proxies/cash_book_entry_proxy.rb

Instance Attribute Summary

Attributes inherited from EntityProxy

#owner

Instance Method Summary collapse

Methods inherited from EntityProxy

#append, #build, entity_class, #entity_class, entity_class_name, #entity_class_name, #find, #get_data, #initialize, #session

Constructor Details

This class inherits a constructor from Economic::EntityProxy

Instance Method Details

#allObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/economic/proxies/cash_book_entry_proxy.rb', line 7

def all
  entity_hash = session.request(
    Endpoint.new.soap_action_name(CashBook, :get_entries),
    "cashBookHandle" => owner.handle.to_hash
  )

  if entity_hash != {}
    [entity_hash.values.first].flatten.each do |id_hash|
      find(id_hash)
    end
  end
  self
end

#create_creditor_invoice(handles) ⇒ Object

Creates a creditor invoice and returns the cash book entry. Example:

cash_book.entries.create_creditor_invoice(
  :creditor_handle       => { :number => 1 },
  :contra_account_handle => { :number => 1510 }
)


57
58
59
# File 'lib/economic/proxies/cash_book_entry_proxy.rb', line 57

def create_creditor_invoice(handles)
  create_cash_book_entry_for_handles(handles, "CreateCreditorInvoice")
end

#create_creditor_payment(handles) ⇒ Object

Creates a creditor payment and returns the cash book entry. Example:

cash_book.entries.create_creditor_payment(
  :creditor_handle       => { :number => 1 },
  :contra_account_handle => { :number => 1510 }
)


47
48
49
# File 'lib/economic/proxies/cash_book_entry_proxy.rb', line 47

def create_creditor_payment(handles)
  create_cash_book_entry_for_handles(handles, "CreateCreditorPayment")
end

#create_debtor_payment(handles) ⇒ Object

Creates a debtor payment and returns the cash book entry. Example:

cash_book.entries.create_debtor_payment(
  :debtor_handle         => { :number => 1 },
  :contra_account_handle => { :number => 1510 }
)


37
38
39
# File 'lib/economic/proxies/cash_book_entry_proxy.rb', line 37

def create_debtor_payment(handles)
  create_cash_book_entry_for_handles(handles, "CreateDebtorPayment")
end

#create_finance_voucher(handles) ⇒ Object

Creates a finance voucher and returns the cash book entry. Example:

cash_book.entries.create_finance_voucher(
  :account_handle        => { :number => 1010 },
  :contra_account_handle => { :number => 1011 }
)


27
28
29
# File 'lib/economic/proxies/cash_book_entry_proxy.rb', line 27

def create_finance_voucher(handles)
  create_cash_book_entry_for_handles(handles, "CreateFinanceVoucher")
end

#create_manual_debtor_invoice(handles) ⇒ Object

Creates a manual debtor invoice and returns the cash book entry. Example:

cash_book.entries.create_manual_debtor_invoice(
  :debtor_handle         => { :number => 1 },
  :contra_account_handle => { :number => 1510 }
)


67
68
69
# File 'lib/economic/proxies/cash_book_entry_proxy.rb', line 67

def create_manual_debtor_invoice(handles)
  create_cash_book_entry_for_handles(handles, "CreateManualDebtorInvoice")
end

#set_due_date(id, date) ⇒ Object



71
72
73
74
75
76
# File 'lib/economic/proxies/cash_book_entry_proxy.rb', line 71

def set_due_date(id, date)
  request("SetDueDate", "cashBookEntryHandle" => {
    "Id1" => owner.handle[:number], "Id2" => id
  },
                        :value => date)
end