# Using POSper/Administrator guide

To do the changes below make sure you are running as Administrator.

## Interface

The interface uses similar elements in all the panels.
| First | Previous | This. Edits the selected item | Next | Last | Reload | Find | Sort (an A, Z and an arrow) | New (a blank paper with an orange star) | Delete (the red cross) | Save (a floppy disk) |

## Setting up your Stock
### Taxes

On the left side of the Screen are some menus for you to select from. Let's set up the taxes first. Under “Administration”, click “Maintenance”, and then “Taxes”. Here you can set up tax bands that will later be associated with products. This allows taxation calculations to be performed automatically.
* After you are done, save using the save button.
* If you want to delete a tax, you can click on the delete button
* You can add more taxes by clicking on the new button

### Categories

The second thing you'd want to do is to setup your categories. Managing the catalog consists of setting up categories and adding products to those categories. Note that
* Categories can be nested
* Products can belong to at most one category
Under “Administration”, click “Products”, and then click the button that says “Categories.” You will notice that the interface is very much alike to that of the taxes screen. Here you can define several categories under which you can fit your products.
* Figure out how you want to categorize your items. This is key to avoid problems later.
* The ID needs to be numeric. It is suggested making each category an increment of 100.
* You can also add pictures for each category, this field is, however optional.
* Make sure you save after each category.

### Products

After you have made all of your categories, you will need to type in your products. “Administration”, “Products”, then “Edit Products”.
* Once again, each item must have it’s own unique reference. Products can have anything as reference, not just numbers.
* Figure out how much each individual item costs you, if you do not know, type in some number below what you are selling it at. This is required, so you need to type in a number to make the program happy. You can give it as many digits as you like.
* For “Sell price”, enter the amount that you intend to sell the item at (before taxes).
* Select the tax and the category this product fits in (optional).
* You can also set up the product's minimum and maximum stock under the stock tab.
* On the Properties tab you can set whether the product is displayed on the catalog. If you select the in Catalog checkbox, the product will appear in to system users when they select the appropriate category

## Change the default ticket
### Create a resource

In POSper much of the advanced configuration is managed from the resources panel rather than with a GUI. Such is the case for the Tickets
To change the default ticket you must go to the Resources Panel and go to the Printer.Ticket resource POSper uses Apache Velocity to parse the XML templates. The reference to Velocity contains further information for the syntax used.

### Editing the ticket

In the ticket there are available all of the public methods of the class in the $ticket variable and the public methods of the class in the $ticketlines variable.
The default ticket template can serve as a good starting point.

### Editing the image

The default image can be changed by adding a new resource of type image on the resources panel. The resource must be named Printer.Ticket.Logo The image types supported vary by printer. Most thermal printers support them, and most dot-matrix ones don't. The image must be 256 px wide at most.
To remove the image from the ticket you have to edit the Printer.Ticket resource and remove the references to the Printer.Ticket.Logo resource

## Managing Users
### Editing the roles

For editing the permissions you would have to create a new role and edit the permissions in there. The format used is an XML file which describes the forms to which the role has permission to access. The default template for the administrator role can serve as inspiration.

### Users

Go to “Maintenance” under Administration and Select “Users”
Click on the icon with the flower on it to add a new employee. (I recommend adding yourself first). Type in the name under “Name”, and then select their role. You want them to be visible, so leave that alone.
As far as roles go, make sure you give yourself the role of “Administrator.” Now you can go two ways. You can either make your employees “User” or “Manager.” If you give them “User”, they will only have access to the sales and the will not be able to “Close-cash during the night, or pull up a shopping list for you. However, “Manager” will give them this access.
Personally, I recommend “Manager”. You can give them passwords, but they can do this for themselves as well. Also, I recommend that you delete the default Users (“Admin”, “Employee”, “Guest”, and “Manager”) or at least turn off their visibility. That way each employee must log on as themselves.

## Reports

If you need reports that are not available in POSper you'll have to make your own. It is not that hard, however, you will need some SQL knowledge on most cases.
* Gather info about your database from POSper's sidebar: System:Configuration>Database. You'll need all the information under the Database heading, including the password. (Btw, you'll have to create another username if you intend to have the app open at the same time as when you run reports.)
* What kind of report do you want?
* What do you want to be on the report? You can use any of the SQL Queries already made.

### Reporting from the Command Line

Here we are retrieving the information from the database using the command line tools. Remember SQL is case sensitive, even in Windows.
For postgres installations: To run in Windows, save this as filename.bat and simply double-click it:
To create a file that you can import into (for example) excel, add this to the end:
For MySql installations:
You'll need to replace "username" with a real username and "posper" with the database name (posper is default). You will be prompted for a password after you hit enter.

### Postgres' pgAdmin

Extremely Easy. Once the server connection has been added, go to tools, Query Tool. You simply need to paste the query into the box.

### iReport

iReport. iReport is a tool that helps to visually create reports. POSper's reports are created on this tool.
iReport makes easy to create printable information, as it offers a feature to export to pdf and several other formats by default. For further information you can check the iReport documentation

### phpMyAdmin

Easy. click on the SQL button and enter the query. It will return a table with the results. phpMyAdmin can also export to excel, making the data selection easier if you are used to that kind of tools.

## Troubleshooting
### Cannot create a new record

If you reuse an ID you will receive the error message
If you select the Information button from the error dialog, you should see the following message
This is the databases way of telling you that you have reused an ID value.