About

The following is an implementation of a cashier created for Dragan Lakic's project for a business education simulation. A vendor enters the prices for the products bought by the customer after which the cashier calculates the grand total. The customer then pays with money (made out of primitives) and the cashier takes the money (primitives delete themselves) and gives the customer the change.

Design

The cashier and money system is created to simulate a real cashier system. It uses money primitives that are have special names that are processed by the key-value data system. This ensures a consistent communication between the money and the till.

One notable feature of the cashier is that it also implements a money system. In the examples below, a till was created as well as money bills for 100, 50, 20, 5 and 1. Should the customer pay more than the required amount, the till effectively hands back the remainder, starting with the large bills and down to the smaller bills. Technically, this is performed by using insertion sort and handing out the largest bills first (as a polite teller would do).

The system however does not support sub-units since that would be more difficult to implement and unattractive from a code perspective. In either case, Linden-based worlds do not support sub-units and the lowest currency possible is the non-divisable value 1.

Using named primitives in conjunction with the key-value data system, the system is not restricted to pre-defined money values. A user can implement their own money system and create bills with different values, provided that they name the money consistently.

Setup

  • First design your bills, they can have any values. The example set-up used in the screenshots in the following section, uses the Australian dollar system with bills of 100, 50, 20, 5 and 1 - excluding sub-units. When creating the bills, see the money section and give the bills the corresponding names. For example, a 50 bill primitive will have its object name set to money=50. Be sure to drop the money script into the bills as well since it will take care of removing (consuming) the money primitives.
  • Finally, design your till and add the cashier script to it. Also, drop one of each money primitives into the till as seen in the screenshot on the till page.

Operation

  • The teller touches the till and enters the values of the products, one by one, just like a real till. At every step when the products are entered, the till asks the teller whether to finalize the transaction or whether to keep adding products.
  • Once the teller finalizes the transaction, the till says the grand total on the local channel and waits for the customer to pay.
  • The customer then rezzes money primitives on the desk to match the required value. The customer may need to pay more than the required value.
  • Once the customer has paid more than the required value, the till calculates the difference, de-rezzes the customer's money and gives them back the change.

Extensions and Remarks

It is interesting to note that this is one case where the permission system of the virtual world can be exploited to the build's advantage. For example, the money primitives could be set to transfer-only, so that once the customer rezzes the money and the till consumes them, then the customer will not have the original value in their inventory.

Index


secondlife/cashier.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.