Skip to main content

Inheritance

Inheritance lets a pricelist reuse its parent's prices and change only what differs. A segment list can follow your base list with a discount rule; a customer list can follow its segment and carry a few negotiated prices of its own.

Each pricelist has at most one parent, set with parent_code, so pricelists form a tree.


How Inheritance Works​

For each SKU, a pricelist either has its own price or inherits one:

  • No own price: the pricelist inherits what its parent holds for the SKU, whether that is the parent's own price or one the parent inherited itself, with the pricelist's own rules applied.
  • Own price: a price written on the pricelist itself always wins. Inheritance never overwrites it, and it is what the pricelist's children inherit from then on.

price.meta.inherited in a query result tells you which one you got.

Rules Build on the Parent's Price​

An inherited price starts from the sales price the parent holds, and the pricelist's rules apply to that. In a rule, sales is the parent's price. Rules on several levels therefore compound:

PricelistParentRuleSales price
basenonenone; price written with fixed: 100100
wholesalebasesales * 0.990
customer-acmewholesalesales * 0.981
customer-betawholesalenone90

A pricelist without rules inherits its parent's price unchanged. prices.cost, prices.catalog and the other price fields stay those of the price it was inherited from, the nearest pricelist above with its own price, so a rule can also start over from a field, for example prices.cost * 1.25.

Inherited prices follow their source:

  • A new or changed price on the parent reaches every pricelist below it, including prices scheduled for a future date, which take effect there at the same moment.
  • Deleting a price removes the prices inherited from it.
  • A pricelist with price rules inherits only the SKUs that match one of its rules. A SKU that stops matching, for example after its article metadata changes, loses its inherited price.

When you create a pricelist with a parent, or change a pricelist's parent or rules, its inherited prices are filled in within a short time. On a very large pricelist, some inherited prices can appear a little after the change is saved.


What Is and Is Not Inherited​

InheritedNot inherited: set on every pricelist
Prices, including quantity breaks and start datesCurrency
Bundle rules, from the nearest ancestor that has oneVAT mode (NET or GROSS)
Metadata
Price rules

Price rules can read the parent pricelist's metadata through the parent variable; see Price Rules.


Relationship With Other Pricing Concepts​

Bundles​

A bundle's rule is inherited from the nearest ancestor that has one, and a pricelist can set its own. The bundle price itself is computed on each pricelist from that pricelist's component prices. See Bundles.

Scheduled Updates and History​

Inherited prices keep the start date of the price they come from, so scheduled changes and as_of queries work the same way on every level. See Scheduled Updates and Historical Pricing.


Summary​

A pricelist inherits its parent's prices for every SKU it does not price itself, and its own rules apply to the parent's price, so discounts on several levels compound. Its own prices always win. Currency, VAT mode, metadata and rules are set on each pricelist.