When Apply Purchase Pricing is Selected all pricing decisions on Purchase Orders and Shipments go through the Purchase Pricing Script to return a price - whether or not any PP Rules match the Context.
A purchase pricing decision is triggered for a Purchase Order line, and for an AP Shipment line which does not have a related PO Order Line, when Product Code or Quantity (if Quantity breaks are enabled) are selected. If PP Where Pricing Criteria are enabled and are changed at the line level that also triggers a Pricing decision. (Saturn only)
In the Purchase Pricing Script the cost price and any discount that would apply without Purchase Pricing is added as an in memory rule with Priority 9, all purchase pricing rules that could apply in the context are collected, then sorted and a rule selected. The default Purchase Pricing script sorts the collected rules by Priority (1 being the highest and 9 the lowest) and effective price then disallows any rules which return zero cost unless by-pass zero cost is true for the rule. It returns the Purchase Price and Purchase Discount for the first non-disallowed rule.
Note: The Purchase Pricing Script can be modified to a company specific version. This is usually so that the decision about either the rules to collect, or the sort order for selecting a rule can be changed.
Take care with Event scripting not to trigger pricing decisions after price changes have been made. Assigning the Product Code, Quantity (if Use Quantity Breaks is selected in PP settings), or the Location Code if this is selected in PP Where criteria will recalculate Cost Price and Discount.
Making changes to other Pricing Criteria in for example the Document Header, will not re-trigger pricing decisions that have been made for existing lines. These may be triggered deliberately using Reprice.
We recommend you enable only the PP Criteria you need in order to add the rules you require.
Note: For Manually Costed Products if Use Cost Prices for Manually Costed Products is Unselected in AP Settings the Cost Price passed to the PP Context is the Cost Price from the line not re-read from the Supplier Cost Product.