How Pricing is Decided
- If a sale has been received from an external source, such as an eCommerce site, the pricing in the sale object applies.
- If the item has come from an integrated fuel controller (petrol station) that pricing overrides and applies.
When an item is added to a sale being processed, the steps below are performed. The following is believed to be an accurate description of the process but it has been simplified and some details omitted in order to be described.
- An item is selected to be sold. How the product is selected for sale is largely irrelevant.
- If the item is weighed (unit of measure is gm, kg etc) the scales are read, or the user asked to input the weight. This is set to the quantity of the item. If packaging weight is defined for the item this is subtracted from the quantity now.
- If the item is not unit based or weighed, the teller is prompted for the quantity.
- If the product is prepay recharge/topup, the pricing engine passes to prepay code handlers and exits.
- Custom Script handlers for "Saleline Pre Add" are executed. This is before the item has been connected to the sale so these handlers cannot yet alter the price.
- (A) If the request to add the item has also set a price, that is loaded as the UnitPrice for the item.
- If (A) does not apply, and the product is marked "Prompt Price" or "Variable Priced", the teller is prompted to enter the price now.
- If the product has specifically being marked "Prompt Quantity", the quantity is captured from the teller.
- A precheck is made to see if this product can belong to a Kit. If a kit is possible, the item is forced to a new saleline.
- If the product has modifiers, these are prompted now.
- If possible, the sale is scanned to see if this item already exists in a form that is suitable to just increase the quantity.
- The saleline is created and applied to the sale.
- If the product is variant based, a variant specific price is loaded if possible
- If the product is a modifier, the base modifier pricing is applied
- The base price from products record is loaded
- If the setting ProductPriceBand is defined, this is applied now. There are two special cases for zero pricing here, one for hire stores and another using department based pricing.
- Any pricemaps that apply to this sale are checked and loaded.
- If no pricemap exists and the customer record has a fixed discount percentage, this is applied now. This is deprecated functionality and all new sites should use pricemaps to achieve per customer discounting.
- The price band defined for the sale is fetched. This can result in a product specific priceband if pricebandmaps are in use.
- Any pricemaps that apply to this sale are checked and loaded for a second time if conditions have changed
- If pricing was not specifically set, check to see if a store wide markdown is in effect and apply that discount.
- If store specific uplifts are present, these are applied.
- If PriceWholeSale mode is enabled, this is applied and the next steps below are skipped.
- Any Quantity Discount rules that apply are added now.
- Financial rounding is applied, in case any price totals are fractions of a currency unit
- If prices are detected as having changed, the custom event "Saleline, Price Changed" is fired.
- If sale wide discounts are present, these are applied to the new saleline
- (
P1822 ) If Price smearing is in effect (setting SalePriceSmear=1, default is off) the price is adjusted to the most recent saleline. Price smearing is a function used to ensure that a price set on a product is also applied to any more of those items that might be sold in the same sale. - Sale based machines are run.
- PostSaleLinesChange(2);
- The customers floor limit is checked and enforced if necessary
- If the product can belong to a kit, the kit is applied now.
- If automatic discounting is present for this customer, these are applied now if possible. Automatic discounting at this point is not widely used and has been superseeded by PriceMaps.
- PostAddToSale();
- Any additional related salelines are added now.
- If a PosCommand is present for this product, it is executed.
- If this product can be purchased out of reward points, the teller is prompted to confirm reward points can be used and the price set to zero.
- Custom script handlers for "Saleline Add" are executed. These script handlers can now change the price of the item.