Class: IntacctRuby::Functions::CreateARAdjustment

Inherits:
BaseFunction
  • Object
show all
Includes:
DateHelper
Defined in:
lib/intacct_ruby/functions/create_aradjustment.rb

Overview

creates ar adjustment instance in Intacct

Instance Method Summary collapse

Methods included from DateHelper

#date_params, #start_date_params

Constructor Details

#initialize(attrs = {}) ⇒ CreateARAdjustment

Returns a new instance of CreateARAdjustment.



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

def initialize(attrs = {})
  super "create_aradjustment (Customer \##{attrs[:customerid]}, " \
        "(#{timestamp})", attrs
end

Instance Method Details

#to_xmlObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/intacct_ruby/functions/create_aradjustment.rb', line 15

def to_xml
  super do |xml|
    xml.create_aradjustment do
      xml.customerid @attrs[:customerid]

      xml << date_params(:datecreated, @attrs[:datecreated])

      xml.description @attrs[:description]

      xml.aradjustmentitems do
        xml << line_item_params(@attrs[:aradjustmentitems])
      end
    end
  end
end