Clearance Discounts
Clearance Discounts (internally called Markdown Rules) let you define discounts that switch themselves on and off automatically at billing based on the time of day — e.g. a Happy Hour on drinks from 5–7 PM, or an end-of-day markdown on bakery items after 8 PM.
Overview
Each rule has a name, a start time and an optional end time, a discount (either a percentage off the selling price or a flat ₹ amount off the bill), which days of the week it applies on, and what it applies to — all items, one or more categories, or specific products.
When two or more rules could apply at the same moment, the Priority number decides which one wins: 1 is highest priority and is applied first.
The page shows a live green "Active right now" banner listing every rule that is currently in effect, based on the shop's current time, so staff can see at a glance what is discounted before printing a bill.
A rule can be paused without deleting it — paused rules stay in the list (dimmed) but never apply at checkout until reactivated.
Before You Start
- Requires the
promotionsfeature at the Advanced plan tier or above; the sidebar item and route are hidden entirely below that tier. - To target specific products you need at least one product already in Products; to target categories you pick from the shop's existing product categories.
Step-by-Step Guide
1 Create a Happy Hour or clearance rule
- Click New rule.
- Enter a Rule name (e.g. "Happy Hour", "Early Bird", "End-of-day").
- Set Starts at and, optionally, Ends at — leaving Ends at blank means the discount runs from the start time until midnight.
- Choose the discount type: % Off (percentage of selling price) or ₹ Flat (a fixed amount off the whole bill), then enter the value.
- Pick Applicable days by toggling Mon–Sun, or leave blank for every day; use the All/Clear toggle to select or clear all seven at once.
- Choose what the rule applies to under Apply to: All items, Categories (select one or more from the shop's category chips), or Specific items (search and add individual products).
- Set a Priority number if you have overlapping rules (lower number = applied first when two rules could both match).
- Add an optional internal Note, then click Save rule.
2 Pause, edit or delete a rule
- Click the toggle icon on a rule's row to instantly pause (grey "Paused" badge) or reactivate it without opening the editor.
- Click the pencil icon to reopen the same form pre-filled for editing.
- Click the trash icon to permanently delete a rule after confirming the browser prompt.
3 Check what is discounted right now
- Look at the green Active right now banner at the top of the list — it only appears when at least one rule is currently live, and shows each active rule's name, discount, and end time if it has one.
- At checkout, the POS billing screen shows a "Markdown active" badge and applies the matching rule's discount automatically — no manual action needed at the register.
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
Rule name | Internal label shown in the list and on the "Active right now" banner; not printed on the customer bill. |
Starts at / Ends at | Time-of-day window the rule is active in; Ends at is optional — blank means it runs until midnight. |
% Off / ₹ Flat toggle | Switches the discount between a percentage of the selling price and a fixed rupee amount off the whole bill. |
Applicable days | Mon–Sun day toggles; leaving all unselected (or using "All") means the rule applies every day. |
Apply to (All items / Categories / Specific items) | Scopes the discount to the entire catalog, one or more categories, or a hand-picked list of products. |
Priority | Lower number wins when multiple rules could apply to the same bill at the same moment; default is 10. |
Notes | Free-text internal note, not shown to the customer. |
Active right now banner | Live, auto-computed list of every rule whose day-of-week and time window currently matches the shop clock. |
LIVE badge on a rule row | Shown on an individual rule when it is currently in effect (same computation as the banner, per-row). |
Paused badge / toggle icon | A paused rule never applies at billing regardless of its time window, until switched back on. |
P1–P3 badge | Shown next to rules with a priority of 3 or lower, as a visual flag that they take precedence over most other rules. |
Tips & Best Practices
- Use % Off for proportional happy-hour style discounts and ₹ Flat for a simple fixed amount off the whole bill.
- Give your most important overlapping rule the lowest priority number (e.g. 1) so it is guaranteed to win over a broader, lower-priority rule covering the same time slot.
- Leave Ends at blank for rules meant to run until closing (e.g. "after 8 PM every day") instead of guessing a closing time.
Troubleshooting & FAQ
Why does the sidebar not show Clearance Discounts at all?
Two rules both matched the same bill — which one applied?
A rule I created is not discounting anything at checkout.
Can a markdown rule discount a specific product only during weekends?
🧑💻 Developer Notes
Source component(s):
frontend-app/packages/pos-react-lib/src/pages/fnb/MarkdownRulesPage.jsx
Backend endpoints used:
GET /markdown-rules (list)POST /markdown-rules (create)PUT /markdown-rules/:id (update / pause-unpause)DELETE /markdown-rules/:id (delete)GET /markdown-rules/active-now (server-side "is a rule live right now" check, used elsewhere at billing time)
Related tables (db-core repositories):
MarkdownRule
Feature flag key: promotions (requires advanced plan tier or above)
Mounted generically at pos-app's /markdown-rules route as <MarkdownRulesPage apiPrefix="" /> (App.js aliases it as GenMarkdownRulesPage), backed by backend/src/routes/markdown-rules.routes.js → markdown-rules.controller. The client computes isActiveNow() locally from applicableDays + startTime/endTime against the browser clock purely for the "Active right now" banner and LIVE badges; the authoritative discount application at checkout re-evaluates the same rule fields server-side (or via the /active-now endpoint) so a stale client clock cannot desync the discount actually billed.