Menu

Usage

Bogdan Drozdowski

After installation (see [Installing]), point your browser to the Trinventum login page, like http://some-host/trinventum/login.php.
You enter 4 parameters there:

  1. the username of the DATABASE (not system) user you've created
  2. the password of the DATABASE user you've created
  3. the database address (IP address or hostname, can also be the local socket's directory (/run/postgresql in some versions, /tmp in other) if the database is running locally using the default settings )
  4. the database name, which would be trinventum

After the first successful login, the database structures are created. If the current database needs to be upgraded, the required scripts are run.

After logging in to the application, you're presented with the list of currently-existing categories of product types (there will be one during the first run - Uncategorised products).

Use the "Categories" link to add new product type categories (this is optional).

To add a new product, use the "Add a new product" link. Supply all the details and press "Add product". Remember that the photos you add will take at least the same amount of space in the database as on disk, so keep the photographs smaller than usual. You can use the convert utility from the
ImageMagick package to shrink image sizes:

    convert original.jpg -resize 50% smaller_copy.jpg

The "50%" means to shrink both the width and height to 50% of the original size (thus effectively making the image have 4 times fewer pixels). To shrink all images in the current directory, run

    for i in *.jpg; do convert "$i" -resize 50% "$i-small.jpg"; done

This utility can also change the image format (you can convert from JPEG to other picture formats, like PNG).

If everything goes well, you'll be redirected back to the main page with the new product already visible.

Click the product ID or the photo (intentionally shrunk) to modify the product type.

You'll see the current product details (click the photo to see it in its full size) and a form to modify the details.
Depending on the settings, you can perform one of these operations:

  1. Update all the product details at the same time.
    Due to HTML/browser limitations, the photo field will be empty (so you need to upload the same photo each time when you want to update the details).
    The rest of the details will be pre-filled. Change the required fields and press "Update product". All the data (including the photo) will be modified by this operation.
  2. Update the product details one by one.
    You can use the "Update" button in every field to change the value of just that field in the product.

In both cases:

  • if you modify the cost, the cost of all product pieces will be modified,
  • you cannot decrease the number of product pieces, but you can increase it.

Below the product type details, you'll see a list of current product pieces of the given type. To modify a piece, click on its ID. You can only change the status between READY and SELLING (which means that the product is put for sale). When the piece is SOLD, you can't change it back to READY or SELLING, you can update only the cost then, unless:

  • the piece's transaction is modified to actually select another piece, or
  • the transaction is deleted, in which case the product piece's status is changed automatically to READY.

Below the list of product pieces you'll see a list of product sales, showing which buyers bought the pieces and which sellers sold them. You can also see the history of the changes made to the product definition.

Use the "Manage sellers" and "Manage buyers" to add and modify buyers and sellers, required to register transactions.

Use the "Manage transactions" to see a list of currently-registered transactions (the "List all transactions" link) and register new ones (the "Register a new transaction" link).

After clicking "Register a new transaction", you'll be presented with a transaction form.

If modifying the product which took part in the transaction is allowed, first you choose the product type. Next, you select a product piece. You can only select products which are in the SELLING state (you have to set that state manually).

Then you input the rest of the transaction parameters:

  • the buyer (selected from the list of registered buyers)
  • the seller (selected from the list of registered sellers)
  • selling price
  • paying status (pain/unpaid)
  • sending status (sent/unsent)
  • selling date
  • sending price
  • sending cost

If you get "Record version doesn't match" errors (anywhere, not just in transactions), then someone must have updated the object you're working on. Refresh the page, double-check the values, re-enter your changes and retry the operation.

After finishing work, click the "Logout" link to clean up the session on the server. Depending on the server settings, you may get logged-out automatically after some period of inactivity. See the session.cookie_lifetime entry in your php.ini file (/etc/php.ini on Linux) to see how long does the session cookie live for (in seconds).


To backup the database, for PostgreSQL, you would do:

    pg_dump -Fc trinventum > trinventum.dmp

and provide the DATABASE user password.

To restore the database, for PostgreSQL, you would do:

    pg_restore -d trinventum trinventum.dmp

and provide the DATABASE user password.

To delete and re-create the database schema, run (for PostgreSQL):

    psql -U trinventum -d trinventum -c 'drop schema trinventum cascade'

After this, you need to re-login to the Trinventum application as a user with full access to the database schema (like the schema owner trinventum created earlier) to re-create the structures.

To delete and recreate the whole database, run (for PostgreSQL, login to the system as the database user postgres and run):

    dropdb trinventum
    createdb trinventum

After this, you need to re-login to the Trinventum application as a user with full access to the database schema (like the schema owner trinventum created earlier) to re-create the structures.


Related

Wiki: Home
Wiki: Installing