What this feature is for#
Classic situation: you launch a discount campaign on a product and the supplier compensates you for the discount with a credit note (so that you don't pay for the promo, they do). But Margly knows nothing about it from the import — it only sees the reduced selling price in the e-shop feed, not the credit note from the supplier. Result: the margin in Margly drops sharply, it looks like you are selling below purchase price, and the Growth Plan or AI Advisor start recommending "stop selling this product".
Manual selling-price override is the solution. You tell Margly: "from March 1 to March 31 use the original price list price for margin calculation instead of the current selling price — the supplier compensates the discount for me." Margly recalculates margins in the given window from the price you specified and in other periods takes the price from import as usual.
Who can set up the override#
The "Edit price" button next to the product margin is visible to Owner and Editor. A guest from a partner company (via Sharing access between accounts) has data edits enabled, but this specific button in the products table is currently hidden for guests in Margly (on the server level the edit would otherwise pass — the UI simply doesn't show it).
Where to find the override#
Open the Products section
In the left menu Products. The table has columns ABC, Code, Name, Quantity, Revenue (incl./excl. VAT according to your setting), Share %, Margin, Margin %, Cancel %, Purchase price, VAT rate, Customers.
Find the row for the specific product
At the top of the card is the Category filter, the ABC switcher (All / A / B / C), the Margin switcher (All / ≥ 30 % / 10–30 % / < 10 % / "Missing purchase price"), and the search field "Search code, name…".
Click the Edit price link below the margin
For each product there is a small "Edit price" link below the margin value (ticket-percent icon). It opens the "Manual selling-price override" dialog with the product code and name in the subtitle.
Filling the form#
The dialog contains an explanatory banner (collapsible — it remembers your decision in the browser), then an example (you see it only until the first override is created), and below the form itself "Add new override".
Fields you fill in#
| Field | What to enter |
|---|---|
| Promo start | Date from which the discount applied to customers. Margly will calculate margin from the overridden price starting this day. |
| Promo end | Last day of the discount. Must be after the start date. After this date Margly automatically reverts to the current price from import — you don't have to think about anything. |
| You enter the price | Toggle "Excl. VAT" / "Incl. VAT". Default follows your price display settings. When you flip the toggle with a price already entered, Margly recomputes the value from the VAT rate itself — you don't have to clear. |
| Overridden selling price | The price from which margin should be calculated — typically your regular price list price before the discount. The value in the mode you chose above. |
| VAT rate | In percent (0 – 30). Default 21 %. Same as for the product's standard selling price. Margly uses it to compute the other value (incl. ↔ excl. VAT). |
| Your note | Optional, max 500 characters. We recommend writing the credit note ID or supplier name — e.g., "Promo with ABC Wines, credit note #2026/043". Searching the override table by note becomes easier. |
Calculation preview#
Below the form is a live "Calculation preview" — as soon as you start filling in the price, Margly shows in real time:
- Your input — price excl. VAT and incl. VAT (the one you filled in is highlighted).
- Current price from import — what Margly currently sees in the e-shop data.
- Margin before override — what Margly would calculate without your override. Red if negative; yellow below 10 %; green from 10 % up.
- Margin after override — what Margly will calculate in the promo window. Same colors.
- Difference — how many CZK/pc (or units of your currency) the margin change amounts to.
When the price doesn't make sense (e.g., a typo by one zero), you'll see it in the preview right before saving.
Saving#
By clicking "Save override" Margly:
- Inserts the override into the database (both columns incl. VAT and excl. VAT, VAT rate, note, your user ID, and time).
- Synchronously recalculates margins for all orders of that product in the given window — no waiting, the dashboard and products table immediately show new values.
- Updates the denormalized product profitability snapshot (in the background).
- Invalidates the dashboard cache — the next load will already show new margins.
After saving you'll see the message "Override saved. Product margin has been recalculated."
Existing overrides and their states#
When you already have an override saved for a product (or several), in the dialog above the form you'll see the "Existing overrides" section. Each record has a status label:
- Active until date (blue label) — the override is currently in effect, the dashboard uses it to calculate margins.
- Starts date (yellow label) — planned for the future, does not yet affect current calculations.
- Ended date (gray label) — historical override. The dashboard still reproduces margins in its original window from it (which is why it's not auto-deleted).
For each record you see the period, price (highlighted in the active display mode, the other in parentheses), note, date, and creation author. On the right is a trash icon for deletion.
Rules for the period#
- The end must be strictly after the start (validation on client and server — otherwise the message "Invalid override period. End date must be after start date.").
- For one product, periods must not overlap. If you try to save an override whose window intersects an already existing override for the same product, Margly returns the message "The entered period overlaps with another existing override for this product." This rule is guarded by the database, so it can't be bypassed.
- The price must be ≥ 0, the VAT rate in the range 0–30 %.
When you have an active override, but the supplier has meanwhile changed the price list in the e-shop#
In the dialog you'll see a blue information strip:
Current price from import is X. Your override (Y) takes precedence in margin calculation until end date. Imports won't overwrite your record.
Margly is saying: the price in the e-shop has changed (e.g., after the promo you have a different value in the price list), but your override takes precedence within its period. No surprises, no silent overwrite.
Deleting an override#
By clicking the trash icon on a record, an internal confirmation frame appears with text based on the override's state:
| State | What happens after deletion |
|---|---|
| Active | The product's margin recalculates back from the current price from import. If the supplier compensated the discount (and you therefore created the override), the margin may drop into the negative. Button: "Delete and recalculate". |
| Planned (not yet started) | Deletion just removes the record from the plan, current margins don't change. Button: "Delete and recalculate". |
| Ended (historical) | Historical margins for the override period recalculate from current prices in import — this affects historical views in the Overview, Margins tab, AI Advisor recommendations, and the Growth Plan. Margly recommends keeping the historical record for audit and deleting only if it was a mistake. Button: "Delete and recalculate history". |
After deletion, Margly again runs a margin recalculation (synchronously) and invalidates the dashboard cache. A toast message confirms what happened.
How the override manifests in the dashboard#
When you have an active override, you'll see these visual traces in Margly:
- In the Products table next to the product margin, a blue label "Manual price" appears, and below the margin a monospace text "From overridden price: X". Hovering shows a tooltip: "The product's margin is calculated from the overridden selling price you entered (X) instead of the current price from import (Y). Supplier compensation for the provided discount. Validity: from – to."
- When the override has ended but historically affected margins in the selected dashboard period, the label is gray: "Promo in period" (with an informational tooltip).
- In the Margins section (left menu → Margins, trend up icon), under the COGS row a mini-breakdown expands: "Raw COGS", "Supplier promo compensation" (with the negative amount in green), and "Effective COGS after compensation" (in italics). Below it a small note with a link back to Products.
- The AI Advisor uses for margin analyses the same RPCs that take the override into account (
get_margin_cascadereturns already effective COGS,get_top_productsloadsselling_price_uplift_per_unitfrom order items). Recommendations and product rankings in the Advisor will therefore not be skewed in the promo month.
What the override does NOT do (and why)#
- Doesn't change revenue. Customers paid the discounted price, that's a fact. It stays that way in accounting and revenue reports.
- Doesn't overwrite data from the e-shop. The shop (Shoptet / Shopify / Upgates / CSV feeds) knows nothing about the overrides table — product sync never writes to or reads from
product_selling_price_overrides. It's purely a "supplementary layer" controlled by the merchant. - Doesn't auto-delete after the promo ends. Historical records stay so they can be used to precisely reproduce historical margins (to the values that the dashboard or Advisor saw at the time).
- Doesn't affect COGS outside the set window. Outside valid_from – valid_to, Margly takes the current purchase price and selling price from import as usual.
- Doesn't recalculate only products without overrides — if you have no override, nothing changes (no fear that the feature would "leave a mark" on other products).
Safe ranges and limits#
- Rate limit: 30 saves and 30 deletes per 5 minutes per account (each action has its own separate window — POST and DELETE don't count together). Spread larger batches over time.
- Note max 500 characters.
- VAT rate 0–30 %, price ≥ 0 (client and server validation).
- Price stored with 4 decimal place precision in the database (display rounds to 2).
- The override timezone is tenant-wide — the window is compared with the order date converted to your account's timezone (derived from the billing country).
Common errors and what to do#
| Message | What it means and what to do |
|---|---|
| "The entered period overlaps with another existing override for this product." | For the same product you already have an override whose window intersects the new one. Either change the period or delete the older record. |
| "Invalid override period. End date must be after start date." | End ≤ start. Fix the dates. |
| "Invalid override price." | The price came out as NaN or a negative value. Check the input — watch the decimal separator. |
| "The override was saved, but margin recalculation failed. Check the sync status or contact support." | The record is in the DB, but recalculate_margins failed. Open Data sync and look at the last state. If the problem persists, write to info@margly.io. |
| "Price override was saved, but in the given period doesn't correspond to any order — margins were not recalculated." | There is no order for this product in the window. Either data hasn't flowed in yet, or you set a band when the product wasn't selling. |
What's next#
- Understanding margins — how Margly calculates gross margin, CM1, and net margin
- VAT settings — how the display toggle affects the "You enter the price" field in the override dialog
- Data sync — when a new override is reflected if data hasn't flowed in yet