Hi All,
I have sql query which display data from invoice from 2 tables: ps_order_detail and ps_order_invoice:
SELECT p.id_order_invoice, o.id_order_invoice, o.product_quantity, o.product_reference, o.product_name, o.product_price, o.total_price_tax_excl, p.date_add, p.total_discount_tax_excl, p.total_paid_tax_excl
FROM ps_order_detail as o, ps_order_invoice as p
WHERE p.id_order_invoice=o.id_order_invoice and p.date_add >= '2016-08-01' and p.date_add < '2016-08-31' ;
I would like to display discount in line (row) with the product that has a 100% discount (it is free product) not for each product from this same invoice.
I have question according this - In which sql table I can search relation between discount and invoice?
Now result of query is for example for invoice 183:
I would like to:
Thank you for your answer,