Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
How can I see the cost of a stock item and compare it to what I invoiced it for? |
Author |
Message |
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-06-24 10:31:03 |
This will show the Purchase Cost and Average Cost of Stock Items invoiced for your Customer: 'Customer ABC'
SELECT "Customer"."FullName", "InvoiceLine"."InvoiceLineItemRefFullName", "InvoiceLine"."InvoiceLineQuantity", "InvoiceLine"."InvoiceLineDesc", "InvoiceLine"."IsPaid", "InvoiceLine"."InvoiceLineAmount", "InvoiceLine"."InvoiceLineItemRefFullName", "InvoiceLine"."InvoiceLineClassRefFullName", "InvoiceLine"."InvoiceLineRate", "ItemInventory"."PurchaseCost", "ItemInventory"."AverageCost" FROM "Customer" "Customer","InvoiceLine" "InvoiceLine", "ItemInventory" "ItemInventory" WHERE ("InvoiceLine"."CustomerRefListID"="Customer"."ListID") AND ("InvoiceLine"."InvoiceLineItemRefListID" = "ItemInventory"."ListID")
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-10-17 11:25:53 |
Note: In the above I am showing the COGS for each item, not the GOGS for the total number of items for each Invoice line. For example, this Account QuickReport:
If I run this query using the Quantity:
SELECT "InvoiceLine"."TxnDate" as Date, "InvoiceLine"."RefNumber" as Num, "Customer"."FullName" as Name, "InvoiceLine"."InvoiceLineDesc" as Memo, "InvoiceLine"."InvoiceLineQuantity" as Qty, "InvoiceLine"."InvoiceLineItemRefFullName" as Item, "InvoiceLine"."InvoiceLineRate" as Rate, "ItemInventory"."PurchaseCost" as Cost, "ItemInventory"."AverageCost" as "Average Cost", ("InvoiceLine"."InvoiceLineQuantity" * "ItemInventory"."AverageCost") as Amount FROM "Customer" "Customer","InvoiceLine" "InvoiceLine", "ItemInventory" "ItemInventory" WHERE ("InvoiceLine"."CustomerRefListID"="Customer"."ListID") AND ("InvoiceLine"."InvoiceLineItemRefListID" = "ItemInventory"."ListID") ORDER BY "InvoiceLine"."TxnDate"
I get a better representation of what my true COGS really is. But to get the GOGS for all invoices seen in your Account QuickReport in QuickBooks you can run this report directly by using this QODBC stored procedure instead:
sp_report TxnDetailByAccount show Text, TxnType, Date, RefNumber as Num, Name, Memo, Debit as Amount parameters AccountFilterType = 'CostOfSales', TxnFilterTypes = 'Invoice', DateMacro = 'All'
|
|
|
|
|
Posted : 2008-03-06 10:52:31 |
SELECT "InvoiceLine"."TxnDate" as Date, "InvoiceLine"."RefNumber" as Num, "Customer"."FullName" as Name, "InvoiceLine"."InvoiceLineDesc" as Memo, "InvoiceLine"."InvoiceLineQuantity" as Qty, "InvoiceLine"."InvoiceLineItemRefFullName" as Item, "InvoiceLine"."InvoiceLineRate" as Rate, "ItemInventory"."PurchaseCost" as Cost, "ItemInventory"."AverageCost" as "Average Cost", ("InvoiceLine"."InvoiceLineQuantity" * "ItemInventory"."AverageCost") as Amount FROM "Customer" "Customer","InvoiceLine" "InvoiceLine", "ItemInventory" "ItemInventory" WHERE ("InvoiceLine"."RefNumber"='''2245''') AND ("InvoiceLine"."InvoiceLineItemRefListID" = "ItemInventory"."ListID") ORDER BY "InvoiceLine"."TxnDate"
Is correct? I need is looking for cost per line in invoice is one RefNumber.
Thank you for attention
Regards
Andre Bassi |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-03-06 11:18:25 |
It should be:
SELECT "InvoiceLine"."TxnDate" as Date, "InvoiceLine"."RefNumber" as Num, "Customer"."FullName" as Name, "InvoiceLine"."InvoiceLineDesc" as Memo, "InvoiceLine"."InvoiceLineQuantity" as Qty, "InvoiceLine"."InvoiceLineItemRefFullName" as Item, "InvoiceLine"."InvoiceLineRate" as Rate, "ItemInventory"."PurchaseCost" as Cost, "ItemInventory"."AverageCost" as "Average Cost", ("InvoiceLine"."InvoiceLineQuantity" * "ItemInventory"."AverageCost") as Amount FROM "InvoiceLine" "InvoiceLine", "Customer" "Customer", "ItemInventory" "ItemInventory" WHERE ("InvoiceLine"."CustomerRefListID"="Customer"."ListID") AND ("InvoiceLine"."InvoiceLineItemRefListID" = "ItemInventory"."ListID") AND ("InvoiceLine"."RefNumber"='2245') ORDER BY "InvoiceLine"."RefNumber", "InvoiceLine"."TxnDate" |
|
|
|
|
Posted : 2008-03-07 17:43:48 |
cool. More one question, Is possible return this query, FullName of product?
Thank you your your fast reply
Regards
Andre Bassi |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-03-11 12:12:17 |
Sure, add whatever ItemInventory columns you need:
SELECT "InvoiceLine"."TxnDate" as Date, "InvoiceLine"."RefNumber" as Num, "Customer"."FullName" as Name, "InvoiceLine"."InvoiceLineDesc" as Memo, "InvoiceLine"."InvoiceLineQuantity" as Qty, "InvoiceLine"."InvoiceLineItemRefFullName" as Item, "ItemInventory"."FullName" as "ProductFullName", "InvoiceLine"."InvoiceLineRate" as Rate, "ItemInventory"."PurchaseCost" as Cost, "ItemInventory"."AverageCost" as "Average Cost", ("InvoiceLine"."InvoiceLineQuantity" * "ItemInventory"."AverageCost") as Amount FROM "InvoiceLine" "InvoiceLine", "Customer" "Customer", "ItemInventory" "ItemInventory" WHERE ("InvoiceLine"."CustomerRefListID"="Customer"."ListID") AND ("InvoiceLine"."InvoiceLineItemRefListID" = "ItemInventory"."ListID") AND ("InvoiceLine"."RefNumber"='2245') ORDER BY "InvoiceLine"."RefNumber", "InvoiceLine"."TxnDate" |
|
|
|
|