iVendNextDevelopers Request a sandbox

Set a shop up with no code — the recipe (reasons, IMEI, line detail, member pricing)

What the cashier meets once the configuration is applied

Once the configuration is applied, the till gives a member their price, asks for reasons, checks a line detail, asks for a phone's IMEI and asks why a sale is voided.

This recipe makes the till ask for and keep a coded reason, track a phone by its IMEI, capture one more detail per line, and price members differently. It uses only what iVendNext already has, switched on by configuration. It is for a partner, our Custom Development team or a shop's own administrator. Reference implementation: samples/s5_config_pack/: config.json is the whole set-up, apply_config.py applies it over the record API, and --remove undoes it.

When to use it. Rung 1 of the build ladder: configure first, always. Nothing here runs partner code in the shop. The script is a one-time set-up run by the shop's administrator; after that it is not needed again.

What each part is

You want The shop's own setting What the sample sets
A coded reason for a void, a return, a discount Reason Code Master rows (a type each: Void Sale, Item Return, Sale Return, Sale Discount, Item Discount, Price Override …) and the Retail Setting switch for that type (reason_void_sale, reason_item_return, reason_sale_return, reason_sale_discount, reason_item_discount; a void reason also needs save_voided_transaction) five reason codes, six switches on
The IMEI of every phone sold, once the item's serial numbers (Item → Has Serial No); the IMEI is the serial number, received with the stock one tracked item, three IMEIs in stock
One more detail on a line, for goods with no serial number Transaction Item Attribute (a name, a pattern, an order) "Warranty card", pattern ^WC-[0-9]{8}$
A member price a Customer Group per tier, and one promotion per tier that applies to the sale and excludes every other customer group group Member Gold, a 10% promotion, a member in the group

Steps

  1. Read config.json, and change the names, codes and numbers to the shop's. Names start with PP CFG in the sample only so its test can find and remove them; use the shop's own.

  2. Give the script a key: a user who may edit those records. These roles together are enough: System Manager, Retail Manager, Item Manager, Stock Manager, Sales Master Manager. The key is the shop's administrator's, used once.

  3. Run it:

    PP_BASE=https://your-shop PP_KEY=<api key> PP_SECRET=<api secret> python3 samples/s5_config_pack/apply_config.py
    
    • Run it twice and nothing doubles. The second run says kept for everything, and receives no stock.
    • Each run recomputes the member promotion's exclusion list, so a customer group added since is excluded the next time you run it.
    • --remove puts the switches back to what they were and deletes what the script made. A record a booked sale points at cannot be deleted, so it is retired (a reason code made inactive, the member disabled, the line detail switched off); a later run switches it back on.
    • ⚠ It does not undo the stock. The item, its price, the unsold serial numbers and the submitted Material Receipt (which posts the units' value to the books) stay. On a real shop, use your own IMEIs and quantities, or cancel the receipt if it was a trial.
  4. Make sure the shop has a default Company. Any shop that finished its set-up has one. A sale of a serial-tracked item builds a Serial and Batch Bundle, which takes its company from that default. Without it, the first IMEI sale fails with "Error: Value missing for Serial and Batch Bundle: Company".

  5. The cashier's side: nothing to do. The till offers the reasons it finds, asks for the IMEI of a tracked item, offers the line detail, and applies the member promotion when the member is attached to the sale.

    the member's price

    The gold member's 10%, in the totals.

    a markdown asks for a reason and a comment

    A 10% markdown on the phone asks for a reason; "price match" also asks for a comment.

    the line detail's pattern refuses a wrong value

    The line detail "Warranty card" refuses a value that does not match its pattern.

    the IMEI

    The phone's IMEI, captured before it can be charged.

    a void asks why

    A void asks why, and keeps the voided sale on record.

What is refused, and why

Limits to know before you build

Technical notes

Proven on our test bench.

Notes moved from the steps

What the sample was proven to do (bench :8110, 22 + 2 checks)

Limits, stated

Tests

This page in the kit