Wiki

    Contact support:

    Email: support@erply.com

    14 Jul, 2022
    Permalink:
    Also available in:EstonianFinnish

    1. Price List Algorithm

    This is a description of the "price list algorithm" as it has been currently implemented in Erply back office and API.

    This document has been written to provide insight into the algorithm, and help resolve issues. This algorithm CAN be implemented in other applications, too, if needed — but please note that it is quite extensive. We may also update the algorithm (add new features) without prior notice.

    1. Input Parameters

    Calculating a product's price list price uses the following information:

    • Product being sold;
    • Its quantity (if the “Quantity Discounts” extra module has been enabled);
    • Customer;
    • Location.

    The location may belong to a store region.

    At first, Erply:

    • Identifies what customer group the customer belongs to, what is its parent group, parent’s parent etc., up to the top of customer group hierarchy.
    • Identifies what product group the product belongs to, what is its parent group, parent’s parent etc., up to the top of product group hierarchy.

    2. Applicable Price Lists and Their Order

    For calculating a “store price”, the following price lists apply, in the following order. The algorithm walks through all these price lists:

    1. Region’s price lists
    2. Region + customer group price lists
      1. Starting with price lists associated with the top-level customer group, followed by price lists associated with groups further down in the hierarchy.
    3. Warehouse’s price lists 1, 2, 3, 4, 5

    For calculating a “customer price”, the following price lists apply, in the following order:

    1. Customer group’s price lists 1, 2, 3, 4, 5
      1. Starting with price lists associated with the top-level customer group, followed by price lists associated with groups further down in the hierarchy.
    2. Customer’s price lists 1, 2, 3, 4, 5

    3. Algorithm

    1. Erply starts from product card price and applies all “store price lists”, yielding the “store price”.
    2. Erply takes the “store price” and additionally applies all “customer price lists”, yielding the “customer price”.
      1. If configuration parameter "warehouse_and_client_pricelists_do_not_cumulate" = 1, Erply starts with the product card price instead.
    3. The lower of the two (store price / customer price) always takes precedence.