Closed PetrosKalafatidis closed 4 years ago
I am trying to create an item with no luck
quick_books_item = Quickbooks::Model::Item.new(item.slice(:name, :sku, :description, :taxable, :quantity_on_hand, :purchase_desc).merge!(type: item.item_type))
quick_books_item.income_account_ref = { name: 'Cost of Goods Sold', value: '80' } service.create(quick_books_item)
*** Quickbooks::IntuitRequestException Exception: Invalid Number: Invalid Number : <?xml version="1.0" encoding="UTF-8"?>
Here is what to_xml_ns produces
quick_books_item.to_xml_ns
<IncomeAccountRef><?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<hash>\n <name>Visa</name>\n <value>42</value>\n</hash>\n</IncomeAccountRef>`
For setting a reference to another object you just assign the numeric id. Check out this section in the docs:
https://github.com/ruckus/quickbooks-ruby#reference-setters
I am trying to create an item with no luck
*** Quickbooks::IntuitRequestException Exception: Invalid Number: Invalid Number : <?xml version="1.0" encoding="UTF-8"?>
Here is what to_xml_ns produces
quick_books_item.to_xml_ns