Error when creating a Deposit in Quickbooks via Quickbooks-ruby Gem -


i'm trying create deposit in quickbooks, here's code

deposit = quickbooks::model::deposit.new deposit.total = amount  line_item = quickbooks::model::depositlineitem.new line_item.amount = amount  deposit.deposit_to_account_ref = {:value => 40, :name => "checking"} deposit.line_items = array.new deposit.line_items << line_item  result = service.create(deposit) 

i have used similar code create payment , works until add line items

the error i'm getting:

system failure error: java.lang.indexoutofboundsexception: index: 0, size: 0"

usually cause of error when you're trying insert object array doesn't exist.

in code deposit.rb

https://github.com/ruckus/quickbooks-ruby/blob/master/lib/quickbooks/model/deposit.rb

xml_accessor :line_items, :from => 'line', :as => [depositlineitem] 

what doing wrong here? help

figured out. line item requires depositdetailitem spcified within it. unless that's specified, qb sees line items blank, hence out of index error.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -