iVendNextDevelopers My apps

S26 — Derived price lists (a price list worked out from another, kept in step)

Start an app from this sample

One price list worked out from another: the selling list is 1.5 times the buying list, or the wholesale list is 0.9 of the retail list. When someone changes a price on the source list, the app changes the derived price within seconds. Nothing changes at the till: the cashier sells at the list's price as before. A price a person set on the target list is kept and listed, never overwritten. A deleted source price ends its derived price from yesterday, and a rule's target can be another rule's source.

The recipe: A price list worked out from another, kept in step

Industries: every industry

Start from it

ivn new acme_prices --from s26

What to change

What a partner usually changes:

More: the recipe.

The customer sets: the rules (the source and target lists, the factor and the rest) and the decimal places to match its currency. The rights of the role PP DPL Integration are the install's and the manifest's, not the retailer's: the install gives it read on Item Price, the record type the feed follows, and role_rights give read on Price List and create and write on Item Price. With these rights the app's key can change any item price, so only the app's own user holds the role. Needs POS build 2.1.0.691 or later: on an earlier site the install warns role_rights as unknown and skips it, and gives the feed's user no read, so the events wait; the service's log says which record type was refused (ivn logs).

Run it

ivn check
ivn try

The service runs on your server with the integration user's key in the environment: sync.py run --base <site> --state state/dpl.sqlite --watch 5, and sync.py reconcile reads every target price against its source and changes nothing.

Try it at the till

Versions

0.2.3

0.2.2

0.2.1

0.2.0

0.1.1

Needs this serves

This page in the kit