Class: IntacctRB::Account
Instance Attribute Summary
Attributes inherited from Base
#current_user, #data, #intacct_action, #object, #response, #sent_xml
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from IntacctRB::Base
Instance Method Details
#get_list(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/intacctrb/account.rb', line 3 def get_list( = {}) send_xml('get_list') do |xml| xml.function(controlid: "f4") { xml.get_list(object: "glaccount", maxitems: ([:max_items] || 0), start: ([:start] || 0), showprivate:"true") { filter_xml(xml, ) if [:fields] xml.fields { fields.each do |field| xml.field field.to_s end } end } } end if successful? @data = [] @response.xpath('//glaccount').each do |account| @data << OpenStruct.new({ id: account.at("glaccountno").content, name: account.at("title").content, normal_balance: account.at("normalbalance").content, account_type: account.at("accounttype").content, closing_type: account.at("closingtype").content, updated_at: account.at("whenmodified").content, status: account.at("status").content }) end @data else false end end |