Ok, you can import PriceLevelPerItem lists, but the only restiction is that the items must already exist in QuickBooks. See: How do I add a Inventory Item using QODBC? for more on adding the item to QuickBooks before creating the PriceLevelPerItem special price.
To create a new PriceLevel and PriceLevelPerItem item (at the same time) you do:
INSERT INTO PriceLevelPerItem ("Name","IsActive","PriceLevelPerItemItemRefListID", "PriceLevelPerItemCustomPrice") values ('Door Bell Special', 1,'550000-1197760985',20)
where the Name 'Door Bell Special' is the new PriceLevel.
To add another item to the 'Door Bell Special' price level, you need to first determine the ListID for the PriceLevel you want to add the item too. This can be found by doing:
SELECT ListID, Name, PriceLevelType from PriceLevel where Name='Door Bell Special'
From this we can see that the PriceLevel ListID is: 60000-1197761756.
To add another item to this PriceLevel we do:
INSERT INTO PriceLevelPerItem ("ListID","IsActive","PriceLevelPerItemItemRefListID", "PriceLevelPerItemCustomPrice") values ('60000-1197761756', 1,'560000-1197762079',1)
After these two inserts the PriceLevelPerItem table shows the following items for: 'Door Bell Special'
select ListID, Name, IsActive, PriceLevelPerItemItemRefListID, PriceLevelPerItemItemRefFullName, PriceLevelPerItemCustomPrice from PriceLevelPerItem where Name='Door Bell Special'
To update a PriceLevelPerItem we do this:
UPDATE PriceLevelPeritem SET PriceLevelPerItemCustomPrice = 43.21, PriceLevelPerItemItemRefListID = 'F0000-933272656' WHERE ListID = '30000-1197755980' AND PriceLevelPerItemItemRefListID = 'F0000-933272656'
Due to a bug in QODBC v6.00.00.155, you need to use PriceLevelPerItemItemRefListID in the WHERE clause, later revisions will only need the ListID to be used in the WHERE clause.
See: How do I apply PriceLevel Profile to Invoice Line Items? for further information on invoicing PriceLevel discount.
Note: The PriceLevel and PriceLevelPerItem tables are currently available to USA users of QuickBooks 2005 or later only. |