Class: IntacctRuby::Functions::CreateGLTransaction

Inherits:
GLTransactionBaseFunction show all
Includes:
DateHelper
Defined in:
lib/intacct_ruby/functions/create_gltransaction.rb

Overview

creates gltransaction instance in Intacct

Instance Method Summary collapse

Methods included from DateHelper

#date_params, #start_date_params

Constructor Details

#initialize(attrs = {}) ⇒ CreateGLTransaction

Returns a new instance of CreateGLTransaction.



10
11
12
13
# File 'lib/intacct_ruby/functions/create_gltransaction.rb', line 10

def initialize(attrs = {})
  super "create_gltransaction (#{attrs[:description]} #{timestamp})",
        attrs
end

Instance Method Details

#to_xmlObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/intacct_ruby/functions/create_gltransaction.rb', line 15

def to_xml
  super do |xml|
    xml.create_gltransaction do
      xml << gltransaction_header_params(@attrs)

      xml.gltransactionentries do
        xml << gltransactionentry_params(@attrs[:gltransactionentries])
      end
    end
  end
end