In QuickBooks I can do the following Sales By Item Details report:
Using QODBC, the same report can be extracted using the QuickBooks reporting engine with the stored procedure report SalesByItemDetail like this:
sp_report SalesByItemDetail show Text, Account, TxnType as Type, Date, RefNumber as Num, Item, Memo, Name, Quantity as Qty, UnitPrice as SalesPrice, Amount, OpenBalance, ModifiedTime parameters DateMacro = 'ThisMonth'
The data can also be found in the SalesLine QODBC table like this:
SELECT Type, TxnDate as Date, RefNumber as Num, SalesLineItemRefFullName as Item, SalesLineDesc as Memo, SalesLineQuantity as Qty, SalesLineRate as SalesPrice, SalesLineAmount as Amount, TimeModified FROM SalesLine NOSYNC where (TxnDate >= {d'2007-12-01'} and TxnDate <={d'2007-12-15'}) and SalesLineType='Item' and SalesLineItemRefFullName is not null order by SalesLineItemRefFullName
In QuickBooks you can also link your custom fields within your reports like this:
Unfortunately, the Intuit qbXML SDK doesn't currently include Custom Fields in our calls to the QuickBooks Reporting Engine. To extract custom fields I need to go back to the SalesLine table like this instead:
SELECT Type, TxnDate as Date, RefNumber as Num, SalesLineItemRefFullName as Item, SalesLineDesc as Memo, SalesLineQuantity as Qty, SalesLineRate as SalesPrice, SalesLineAmount as Amount, TimeModified, CustomFieldContract as Contract# FROM SalesLine NOSYNC where (TxnDate >= {d'2007-12-01'} and TxnDate <={d'2007-12-15'}) and SalesLineType='Item' and SalesLineItemRefFullName is not null order by SalesLineItemRefFullName
|