[ttl]Price Lists[/ttl][form program=pricelistupd][if dtl_grid=0][execute perform "pricelistupd;init"][/if]
[section half] [row "Price list name:"][input pricelist$ len=15 query=scrnlib.en;PriceListQry event=ChangeKey focus] [button class=fm_browse event=DoFirst][symbol fast-backward][/button][button class=fm_browse event=DoPrev][symbol step-backward][/button][button class=fm_browse event=DoNext][symbol step-forward][/button][button class=fm_browse event=DoLast][symbol fast-forward][/button] [show  browse_error_msg$][/row]
[row "Description:"][input Description$ len=40][/row]
[row "Standard Discount:"][input InvDiscount format=#0.00][/row][/section]

[section whole][/section]

[section half][row "Special product prices:"][grid dtl_grid nosort size=62/20 gridlines]
[col ttl="Product Code" width=20][input productcode$ query=scrnlib.en;productqry event=getPrice][/col]
[col source=listprice locked format="###,##0.00" ttl="List Price" width=12][/col]
[col source=price format="###,##0.00" ttl="Special Price" width=12][/col]
[col source=itemDiscount format="#0.00" ttl="Discount" width=9]
[col width=5 align=center ttl="Del"][symbol trash event=*Rowdel][/grid]  [button size=10 event=add10 text="+10 rows" class=float_bottom][/row][/section]

[section whole][/section]

[include *fm_action]

[section whole]

[show  error_msg$]

[/section]
[hide form_loaded value=1][/form]

To handle custom pricing, each product in the system contains its 'Standard' list price and the client master may indicate a discount to applied to the complete order and a price list to use to determine any special prices. 

When computing pricing, if there is a price list specified in the client master file we look up the price in the pricing table using the pricelist name and apply its standard discount rate if no rate is in the client master file.  For each line item we look up the price list entry for the product code to determine if special price or discount applies.