Jump to content

Calculate Profit


Recommended Posts

Hi guys,

Because i've searched for a module that can help me calculate store profit and i didn't find anything i started to write some sql lines. Is my first time when i play with sql and i've managed to do this :

 

 

select ps_order_detail.id_order, ps_order_detail.product_id, ps_order_detail.product_name, ps_order_detail.product_quantity, ps_product.price, ps_product.wholesale_price, ps_order_detail.product_quantity * ps_product.price - ps_order_detail.product_quantity * ps_product.wholesale_price AS PROFIT
from ps_orders inner join ps_order_detail inner join ps_product
on ps_orders.id_order = ps_order_detail.id_order
and
ps_product.id_product = ps_order_detail.product_id
order by id_order asc

 

 

This returns a table that i can import to excel, and there i can calculate the profit.

 

The problem is that is not the real profit, because it doesn't include the price discounts or the price reduction.

 

Can anybody help me with this? (I have prestashop 1.4.6.2)

 

 

Thank you.

Link to comment
Share on other sites

×
×
  • Create New...