Skip to content

Technical Reference: Price List

Entity: PriceList

The PriceList entity serves as a container for defining specific product prices. The prices themselves are not stored in the PriceList entity nor in the Product entity, but in the Join Table.

Entity Fields

Name (CZ) Name (System) Type Description
Name name Varchar Unique name of the price list. Required.
Description description Text Internal note.
Created At createdAt Datetime Creation date. Key for determining priority (LIFO).
Link Entity Type Description
Products Product Many-to-Many Contains price definitions. See "Price Storage" below.
Accounts Account Many-to-Many Accounts for which this price list is valid.

Price Storage (Pivot Columns)

Prices are stored in additionalColumns in the products relationship (table price_list_product or similar, system-managed).

  • price (Float): Specific price of the product in this list.
  • priceCurrency (Varchar): Currency of the price (e.g., 'CZK', 'EUR').

Price Application Logic (Client-side)

The price fetching mechanism is implemented in the client script (Frontend).

  1. When the accountId changes on a document (Quote, Order), the PriceList collection is fetched.
  2. Filter: linkedWith accounts = currentAccountId.
  3. Sort: createdAt DESC (newest first).
  4. Limit: 1.
  5. When adding a product (onChangeProductId), the script checks if a price list is loaded and if it contains the product.
  6. If yes, it sets unitPrice to the value from the price list.

Logic Location: * client/src/extensions/views/fields/abstract-items.js * client/src/extensions/handlers/dynamic/abstract-items.js