Prices
Index of tables:

The prices can be of 3 types:

  1. generic prices (applied to all the clients) : in this case the field pricelist from tbl_prices should contain the value 1 and the cust_code field 0 or NULL.
  2. particular prices on pricelists (applied to the clients belonging to the specified pricelist) . A price of this type should have as cust_code value 0 or NULL and as pricelist a value different from 0 or 1.
  3. particular prices on clients (applied to a specified client). The rule in this case is that the field pricelist is equal to 0 and cust_code should contain the identifier of the client to whom the price is applied.

Click here to see the rules for Price Calculation.

Table tbl_prices -- Prices

Field name Field description Field type Field size key required default Observation
code Product code VARCHAR 100 yes yes 0 Linked to code from tbl_objects
code_cust Customer code VARCHAR 20 yes yes 0 Linked to u_id/u_externalcode from tbl_users; if you fill this field, let pricelist=0
pricelist Price list code VARCHAR 100 yes yes 0 Linked to code_pricelist from tbl_pricelist
codtpro Promotion code VARCHAR 50 yes yes 0 Linked to tb_codtpro from tbl_promotions
qty_from The start quantity to validate price DOUBLE   yes yes 0  
qty_to The end quantity to validate price DOUBLE     yes 999999999999999  
date_start The start date to validate price DATE 10 yes yes 2000-01-01  
date_end The end date to validate price DATE 10   yes 2100-01-01  
price Price value DOUBLE          
codlavo Code lavoro -feature not implemented- VARCHAR 10 yes   0  
codvalu Code currency –feature not implemented - VARCHAR 10 yes   0  
unmis Unit mesurement – feature not implemented VARCHAR 10 yes   0  

Table tbl_pricelist -- Price lists

Field name Field description Field type Field size key required default Observation
code_pricelist Price list code VARCHAR 100 yes yes 0  
title_pricelist Price list name VARCHAR 50       Name, description, notes are only administrative information
descr_pricelist Price list description VARCHAR 200        
notes Price list note VARCHAR 255        
flag1 -unused field; reserved for future implementations  - CHAR 2        
flag2 -unused field; reserved for future implementations  - CHAR 2        
flag3 -unused field; reserved for future implementations  - CHAR 2        
field1 -unused field; reserved for future implementations  - TEXT          
field2 -unused field; reserved for future implementations  - TEXT