Class: Economic::Creditor

Inherits:
Entity
  • Object
show all
Defined in:
lib/economic/creditor.rb

Overview

Represents a creditor in E-conomic.

API documentation: www.e-conomic.com/apidocs/Documentation/T_Economic_Api_ICreditor.html

Examples

# Find a creditor:
creditor = economic.creditors.find(558)

# Creating a creditor:
creditor = economic.creditors.build
creditor.number = 42
creditor.creditor_group_handle = { :number => 1 }
creditor.name = 'Apple Inc'
creditor.vat_zone = 'HomeCountry' # HomeCountry, EU, Abroad
creditor.is_accessible = true
creditor.ci_number = '12345678'
creditor.term_of_payment = 1
creditor.save

Instance Attribute Summary

Attributes inherited from Entity

#id, #number, #partial, #persisted, #session

Instance Method Summary collapse

Methods inherited from Entity

#==, default_values, defaults, #destroy, #get, #get_data, #handle=, handle_writer, has_properties, #initialize, #inspect, key, #partial?, #persisted?, properties, properties_not_triggering_full_load, property_reader, property_writer, proxy, #proxy, #save, #update_properties

Constructor Details

This class inherits a constructor from Economic::Entity

Instance Method Details

#contactsObject

Returns the Creditors contacts



33
34
35
# File 'lib/economic/creditor.rb', line 33

def contacts
  @contacts ||= CreditorContactProxy.new(self)
end

#handleObject



28
29
30
# File 'lib/economic/creditor.rb', line 28

def handle
  @handle || Handle.build(:number => @number)
end