mardi 12 janvier 2016

How can I calculate the cost given the discount% in web2py/sqlite?

I have two tables, a product table which contains:

Product
-----------
ProductName
Supplier,'reference supplier'
sku
Description
Price

then I have a supplier table

Supplier
---------
SupplierName
Discount

My question is, how can I calculate in sqlite the price based on the discount? The price will be dynamic and that is why I think its a better idea to do the calculation upon retrieval of the product. That way if the Discount changes, the price changes.

Aucun commentaire:

Enregistrer un commentaire