How do I modify the products being sold?

Asked by Brian de Alwis

What must I do if I want to add or modify an item for sale?

Question information

Language:
English Edit question
Status:
Solved
For:
BetaPop Edit question
Assignee:
No assignee Edit question
Solved by:
Brian de Alwis
Solved:
Last query:
Last reply:
Revision history for this message
Brian de Alwis (slyguy) said :
#1

This unfortunately is not a trivial situation in BetaPop and requires modifying the BetaPop configuration and database by hand. Before undertaking any of these changes, we recommend that you make a backup of your BetaPop installation.

BetaPop uses two principal files: betapop.cfg describes the configuration parameters, including the item descriptions and their costs, and betapop.db which records the individual balances and items purchased.

1. Start a new billing period with 'betapop newbill': this will incorporate the purchases from the current period into the individual balances. This ensures that there are no purchases to be accounted for.

2. Record the current summary to a file (e.g., 'betapop summary > summary.txt'). We will use this file to validate that the changes have been made correctly as the individual balances should not change.

3. Modify the configuration file, betapop.cfg, to add, modify, or remove the new items. If you only wish to change the costs of your current items, this is the only step necessary, and you can skip to the final confirmation step in #5.

4. Modify the database, betapop.db, to add/modify/remove items. This file has a fixed structure that must be maintained. Towards the top of the file, on what should be the third line, is an items tuple recording the descriptions of the items for sale. The remainder of the database are user records, recording the outstanding balance and current payments, and the items purchase. The items tuple is ordered, and this ordering is used for interpreting the item purchases tuple for each individual record.

There are two steps necessary: first to update the item descriptions tuple to match the configuration file, and second to update the individual records.

   4(a): Modify the items tuple to match the exact descriptions and order as found in the betapop.cfg file. The items tuple must remain on a single line. If you are only modifying item descriptions, then you can skip to the final confirmation step in #5.

   4(b): Because we started a new billing period in #1, every user record should record 0 purchases for each item (e.g., should match a regexp similar to "{ (0[[:space:]]+)+}". Change every item purchase tuple to now contain the same number of items as this items tuple; each element of the tuple should be 0.

5. Verify that the individual balances are the same by executing:

  $ betapop summary >new-summary.txt
  $ diff summary.txt new-summary.txt

The only differences should be for the new, modified, or removed items; the individual balances should remain the same.