Method: IntacctRB::Bill#update

Defined in:
lib/intacctrb/bill.rb

#updateObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/intacctrb/bill.rb', line 26

def update
  raise 'You must pass an id to update a bill' unless object.intacct_id.present?

  send_xml('update') do |xml|
    xml.function(controlid: "f1") {
      xml.update {
        xml.apbill(key: object.intacct_id) {
          bill_xml xml
        }
      }
    }
  end

  if !successful?
    raise(response.at('//error//description2'))
  end

  object.intacct_id
end