S23 — Till guard rules (a check before payment and a capture on scan, one app)
The common checks a retailer wants before money is taken, in one app: no line at a placeholder price, the most of one item on a line, the most lines on one sale, a line below its lowest price, a large sale needing a yes or a manager's approval, a question at Pay for a walk-in sale, and a question or a shelf-life warning when a flagged item is scanned. Each rule is off until the retailer sets it, in the app's settings record in Desk. At the till the cashier meets a refusal in the app's own words, a question, or a manager's sign-in.
The recipe: Several till rules in one app, with the retailer's own settings (till guard rules)
In the App library: Till guard rules

What is in it: a check at Pay, a capture on scan.
Industries: Electronics and phones
Start from it
ivn new acme_guard --from s23
What to change
What a partner usually changes:
- The rules:
on_checkandon_scaninguard.py, and the retailer's settings read bysettings_of. - The settings: the fields of
PP TGR Settingsinmanifest.json(max_qty_per_line,max_lines_per_sale,lowest_unit_price,lowest_price_list,approval_from,approval_answer,walk_in_question,walk_in_yes,walk_in_no,confirm_question,warn_shorter_shelf_life). - Which items are asked about at the scan: the field
pp_tgr_confirm_at_scanon Item inmanifest.json. - The words the cashier reads: the messages in
guard.py. - The app's id:
IVN_LIBRARY_APPinapp.json.
More: the recipe.
The customer sets: the rules it wants (among them the question to ask at Pay when the sale is the walk-in's, for example Walk-in sale. Pay without a club number? To add one, go back and search their phone or name in Scan or search., with its two buttons, Pay as walk-in and Add club number, once every till runs POS build 2.1.0.749 or later) in the Default record of Till guard settings (PP TGR Settings) (0 or blank is off), the items to confirm at the scan, a price list of lowest prices, and, for a manager's approval, who may approve.
Run it
ivn check
ivn try
Try it at the till
- In Desk, set Most of one item on a line to 50 in the app's settings.
- Sell 51 of one item; the till stops it at Pay.
- Close the till day when you are done.
Versions
1.6.0
- The walk-in question can name its own two buttons (POS build 2.1.0.749 and later). Two new settings beside the question, Yes button for the walk-in question and No button for the walk-in question (each up to 30 characters, for example Pay as walk-in and Add club number): with both set, the till shows them in place of Yes and No, so the question need not spell its answers and can say where the member goes (Walk-in sale. Pay without a club number? To add one, go back and search their phone or name in Scan or search.). The first goes on to payment, the second back to the basket, as before. With either blank, the till shows Yes / No. Leave both blank while any till runs an older build: it refuses an answer with buttons, so the question is skipped and the sale flagged. Manifest 0.7.0.
1.5.0
- A new setting, Question to ask at Pay for a walk-in sale: a question of the shop's own, blank = off. At Pay, when the sale's customer is the store's walk-in (the warehouse's cash customer or the till's default customer), the cashier is asked it. Word it so each button is plain, for example Walk-in sale. Yes: pay as walk-in. No: go back and add the member. Yes goes on; No goes back to the basket. A named customer is not asked, nor is a return or an exchange. A walk-in sale that needs a manager (a large sale, or a line below its lowest price) gets the manager's question instead of this one: one answer for each press of Pay, and the manager's rule is kept. If the walk-in cannot be read, the sale goes on: it is a reminder, not a gate. The app's user gains read on Warehouse and POS Profile (
role_rights). Manifest 0.6.0.
1.4.3
- The manifest marks its event feed
"reads_events": false: this app reads its records itself and follows the feed only to get its own user, so the package's connection test (the oneivn tryand the hosting dashboard read) answers the feed Passed, on POS build 2.1.0.728 or later. No logic changed.
1.4.2
- A refusal names the item by its name, as the cashier knows it (6 of USB-C Cable (1 m)), where it gave the item code; the check's lines carry the name since POS build
2.1.0.697, and the code stands in where a line has none. The most-on-one-line refusal says how many to take off. The manifest is unchanged.
1.4.1
- Desk shows plain names (Till guard settings) through the manifest's
translationsblock, so a search for till guard finds the record. The stored names are unchanged: an installed site keeps its records. Manifest 0.5.1.
1.4.0
- The role's rights beyond the feed's reads move into the manifest (
role_rights): the install gives the feed's user its reads and the manifest the rest, so the retailer's administrator grants none. Needs POS build2.1.0.691or later.
1.3.0
- Two new rules: the most lines on one sale, and a lowest price per item and unit.
- Each setting in app.json says its purpose (the line the Settings screen shows), whether it is required, and which settings go with it.
1.2.0
- The shelf-life warning, run on the bench and walked on a demo site.
- Any failure reading the shelf life is a plain allow, never a refusal.
1.1.0
- First version in the kit: several till rules in one app, a check before payment and a capture on scan.
- Hosted as a function, paid per call; an exchange is checked for what it sells.
Needs this serves
- A discount above a set limit needs a manager's approval — Ready, with limits (2)
- A manager must approve a sale over a set amount — Ready, with limits (2)
- No line at a placeholder price such as 0.01 — Ready, with limits (1)
- No more than 50 of one item on a line — Ready, with limits (1)
- Selling below the minimum price needs a manager's approval — Ready, with limits (2)