Hi,
I am trying to write a custom report which lists products and the associated sales by product for a period.
I know there is a report for this but I need a couple of additional columns which have presented me with a question.
What I am looking to do is to show a row for all products and list out the price before vat(tax) (including any discount) and the amount of tax.
So let's say I sell 3 ABC widgets in a given time and they are £110 each including a 10% tax. I want to show...
Product Total (ex tax) Total tax
ABC Widget £300 £30
Simple right....wrong.
In the DB the OrderItems table records an entry for each product as ex tax, the shipping as ex tax and any discount. However it records one tax line item as an aggrigate of all the tax for the Order.
Is there a way for me to get the tax line for each of the products and shipping etc?
Thanks in advance for your help.
Cheers.
Rob.
Taxes
Re: Taxes
One possibility may be is to create a copy of Top Products report and then add one more column to it for taxes, write a custom method that takes product id and then calculates total tax for that product sales and returns back. Finally call that method from newly added column and list the returned tax.