Closed vanboom closed 9 years ago
I created a Non Inventory item manually in Quickbooks, and then fetched the item by the ID number...
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2015-10-28T11:53:54.598-07:00">
<QueryResponse startPosition="1" maxResults="1">
<Item domain="QBO" sparse="false">
<Id>33</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2015-10-28T11:53:48-07:00</CreateTime>
<LastUpdatedTime>2015-10-28T11:53:48-07:00</LastUpdatedTime>
</MetaData>
<Name>NONINVENTORYTEST</Name>
<Description>non inventory test part</Description>
<Active>true</Active>
<FullyQualifiedName>NONINVENTORYTEST</FullyQualifiedName>
<Taxable>true</Taxable>
<UnitPrice>0</UnitPrice>
<Type>Service</Type>
<IncomeAccountRef name="parts">105</IncomeAccountRef>
<PurchaseCost>0</PurchaseCost>
<TrackQtyOnHand>false</TrackQtyOnHand>
</Item>
</QueryResponse>
</IntuitResponse>
The
UPDATE: I found the answer on the Quickbooks API Help https://developer.intuit.com/docs/api/accounting/Item
When querying Item objects with minor versions earlier than 4 specified, NonInventory types are returned as type Service.
good grief.
4 September 24, 2015
Includes all minor version 1, minor version 2, and phases 1 and 2 of minor version 3 plus the addition of the following:
In support of enhanced inventory, the following are added to the Item resource:
Item.Sku attribute. NonInventory to the list of valid Item.Type selections. -XSD: V3 minor version 4
Do we have a way to specify the minor version?
You can pass along a :query
attribute to your create
call in the secondary options
hash.
Give this a try:
newitem.id = service.create(item, :query => {:minorversion => 4})
Thanks - I think passing the query parameter will work, however the macro for NON_INVENTORY_ITEM in the Item model is also incorrect, which causes a validation exception. See my PR #271
Maybe we can support minor version 4 out of the box? It is really strange that without it, Quickbooks will show an item as "Non Inventory" but return it in the API as "Service"!
Closing this since we'll be merging in your PR after the final questions. Thanks again.
I am having trouble creating a non inventory item...
The item is successfully created, but shows up in Quickbooks as a Service item. After manually changing the item type in Quickbooks, I can query the item back into Ruby...
The Type returned by the fetched item is "Service"
I enabled logging, and it appears that the type field in the XML returned by Quickbooks is "Service".
I tried changing the type of the item in Quickbooks to "Inventory" and then the fetched item type is correctly set to "Inventory".
Thanks for an awesome gem - I appreciate any help or guidance in how I can debug this further.