Skip to content
P4 Software P4 Software / cifraHQ

Add these docs to Claude

Ask Claude questions about these docs. Claude reads the published pages and links you back to them. Copy this address:

https://p4-software.opendocs.page/mcp

In claude.ai or Claude Desktop: open Settings, then Connectors, choose Add custom connector and paste the address.

In Claude Code, run:

claude mcp add --transport http docs https://p4-software.opendocs.page/mcp

Price Rules

Price Rules

Pricing errors cost real money. Price Rules let you encode your discount and contract pricing logic directly into CifraHQ so the correct price appears automatically on every sales order and invoice — no spreadsheet lookups, no manual overrides, no mistakes. Use them for volume discounts, customer-specific contract prices, promotional rates, or group-wide markdowns.

Where to find it

Go to Master Data > Sales > Price Rules.

Price Rules list page in CifraHQ.

Price Rules list, customer- and product-specific pricing overrides.

How to create a Price Rule

  1. Click New. The Code is assigned automatically when you save (the next PR- number), so there is nothing to type. Add a Description if you want a name people will recognise (optional, up to 512 characters).
  2. Answer three questions. Each one is a single choice, and the dialog shows only the fields that belong to your answer, so you cannot fill in two options that contradict each other:
    • 1. Who gets this price? Everyone, One customer (pick the customer) or A customer group (pick the group).
    • 2. Which Products? All Products, One product (pick the product) or A product group (pick the group). Under this question you can also enter a Packsize (optional, a whole number such as 12). A packsize works with any of the three answers, for example all Products at packsize 24, or a product group at packsize 12. Leave it empty for every pack size.
    • 3. What is the deal? Fixed price (a currency, which starts as your company currency, and the price) or Discount % (a percentage from 0 to 100).
  3. Set Starts and Ends to create a time-limited rule (optional; leave both blank for an always-active rule). Both are dates in your company's time zone and both days are included: a rule that Ends on 31 December still applies through the whole of 31 December and stops when 1 January begins. The End date cannot be before the Start date (the same day for both is fine): if it is, Save stays off and the reason is written next to it.
  4. Read the box This rule says: it spells the rule out in a plain sentence, for example For Customers in the group Wholesale: the product group Dog Food at 10% off. Check that it is what you mean.
  5. Click Save. Save stays off until every question has a complete answer, and a line next to it says what is still missing.

Switching a choice clears the values of the options that no longer apply, so a hidden value is never saved. Choosing the option again brings back what you had typed there.

Rules that were saved before this dialog

An older rule can have both sides of a question filled in: a product and a product group, a customer and a customer group, or a fixed price and a discount. The API now refuses to save those combinations, and the dialog shows them with an amber notice (This rule needs one change before it can be saved): the question has nothing selected, a line says what is currently saved, and Save stays off until you choose one option for every question in conflict. Nothing is lost until you choose and save. Everything else on the rule opens as it was saved.

The number boxes accept a decimal comma or a decimal point (7,5 and 7.5 are the same). A price may be typed with thousands grouping (1,500 or 1,500.00 is one thousand five hundred), keeps the number of decimals set for your company, and must be below 1,000,000,000.

Rules saved before 15 November 2026 under the old convention (End = the day after the last selling day) now also apply on that End day: review them and move the End date back one day if needed.

An existing rule whose End date is before its Start date still appears in the list and still opens, but no change can be saved until one of the dates is fixed: the dialog shows the reason next to Save, and the API refuses the rule too. This does not open the amber message, which is only for a question that names both sides.

How rules are applied

When a line is added to a sales order or invoice, CifraHQ evaluates all active rules and selects the best match in this order:

  1. Most specific match first — a rule tied to a specific product and customer beats a rule tied to a product group and customer group.
  2. Active date range: today's date in your company's time zone must fall between the Start Date and the End Date. Both days are included, so a rule that ends on 31 December applies for the whole of that day.
  3. The matching rule's Price or Discount overrides the product's standard sales price.

The Point of Sale app applies the same rules before an item is even added: each product card in its search shows the price the cart will charge for the sale's customer. A product with no price set shows no price on its card. Picking a different customer on a sale that already has items moves the sale to that customer and reprices every line with that customer's rules; a line that has no price for the new customer keeps the price it had.

Tips

  • A rule is either a fixed Price or a Discount, never both: the dialog offers one or the other, and the API refuses a rule that has both. The same goes for a product together with a product group, and a customer together with a customer group.
  • Use Customer Groups + Product Groups for broad discounting strategies — for example, "all wholesale Customers get 10% off all electronics."
  • Use specific Customer + Product rules for individual account contract pricing — for example, a negotiated price for one SKU with one key account.
  • Time-limited rules are ideal for seasonal promotions: set the Start and End dates and the rule activates and expires automatically (the End day is the last day it applies).
  • If you create or change rules through the API, send Start and End as plain dates (yyyy-MM-dd, for example 2026-12-31). A value with a time zone offset is converted to the server's time before it is stored and can land on the next day.

Related: Products · Customers · Customer Groups · Product Groups · Quotes · Sales Orders · Invoices

Was this page helpful?