<< Back to prices page
Price calculation

Table tbl_prices

  Product code Client code Pricelist
DB-field/
index
code code_cust pricelist
1.AX0
2.A0P
3.A01

A customer X with pricelist P buys the product A .

1.  CLIENT
First he must search for a record in tbl_prices with product code=A and client code = X - also checking for the date and quantity. This is a specific price of the product for that client.

2.  PRICELIST
If no record is found at 1 step, he will search for a record with product code = A and pricelist = P

3.  GENERIC
If there is no record found, he will search for a record with product code = A, client code = 0 and pricelist = 1 - that means that the product A has a general price for all the customers.

Otherwise, there is no price for the respective article.

OBS: Always check the quantity and validity date.