[QODBC-Desktop] How do I create a Purchase Order using an Item Group using QODBC?
Posted by Jack - QODBC Support on 09 March 2016 12:35 PM
|
|
An Example of PurchaseOrder Item GroupsCreate an ItemGroup with Three LinesNote: Let's create a new item group example with three lines using QODBC. Note the FQSaveToCache field, set to True except on the last one. First Line INSERT INTO "ItemGroupLine" ("Name," "IsActive," "ItemDesc," "IsPrintItemsInGroup," "ItemGroupLineItemRefListID," "ItemGroupLineQuantity," "FQSaveToCache") VALUES ('Test1 W3 Lines 1', 1, 'Test Item Dec, 1, '8000009D-1481800631', 1.0, 1)
Second Line INSERT INTO "ItemGroupLine" ("Name," "IsActive," "ItemDesc," "IsPrintItemsInGroup," "ItemGroupLineItemRefListID," "ItemGroupLineQuantity," "FQSaveToCache") VALUES ('Test1 W3 Lines 2', 1, 'Test Item Dec, 1, '670004-1044572237', 2.0, 1)
Third (Last) Line INSERT INTO "ItemGroupLine" ("Name," "IsActive," "ItemDesc," "IsPrintItemsInGroup," "ItemGroupLineItemRefListID," "ItemGroupLineQuantity," "FQSaveToCache") VALUES ('Test1 W3 Lines 3', 1, 'Test Item Dec, 1, '6D0003-1044572301', 3.0, 0)
Result in QuickBooks The result looks like this in QuickBooks 2022:
For more about creating ItemGroups, please see: How to generate Item Groups using QODBC. Locate the List ID of the New ItemGroupTo locate the ListID of the new Item Group (or any group), do the following: SELECT ListID, Name, ItemDesc, IsActive FROM ItemGroup
Invoice the ItemGroup
Note: We can now create PurchaseOrder using the item group by utilizing the ListID:'8000009F-1481791619' and making one simple QODBC insert statement below.
INSERT INTO "PurchaseOrderLine" ("VendorRefListID," "RefNumber," "PurchaseOrderLineGroupItemGroupRefListID," "FQSaveToCache") VALUES ('390000-1039739488', 'Group2', '8000009F-1481791619', 0)
Result in QuickBooks When we look at the new invoice in QuickBooks 2013, we will see the following:
Note: Qty, Rate, and the Amount are shown as per Qty, Rate, and the Amount for the service or stock item | |
|