[Configure PowerTill]

Edit the PowerTill configuration file to enable the interface. 

All configuration items should already exist in the file and have their value
changed.

Default location: C:\Powr7-1\System\PowrCfgv7.ini

1. Choose the output type
     No item level information
       HOTEL_PMS=f

     Full item information (needed for sales group split)
       HOTEL_PMS=R

2. Set the directory where both PowerTill and ResRequest should look for data
     POST_RemoteDir=c:\pos
     POST_RemoteDir2=c:\pos

3. (Optional) Set revenue centre may be set by changing the first two digits of
   the POST_Config
     POST_Config=02010101

4. (Optional) If ResRequest and PowerTill are on separate servers, and the link
   is slow, the timeout may be increased
     HOTEL_Delay=30


[Configure ResRequest]

1. Ensure there are no room name conflicts across all properties and
   accommodation types being linked.
     If there are the recommended solution is to add a prefix to all rooms
     (eg. 1 -> 101, 2 -> 102, etc).

2. Edit the rf_database entry for the environment being used (eg. PA)
     Set rf_db_pos_folder the same as PowerTill (eg. c:\pos)
     If on separate servers a Windows share hosted on the PowerTill server
     should be used. On the ResRequest server this should be mapped to a drive
     (Windows) or a directory (Linux/Unix).

     If required the default delay of 2 seconds between polling events may be
     changed by editing rf_db_pos_frequency

3. Add an entry to rf_db_business for each property being serviced by the
   PowerTill interface.

[Run the interface service]

The interface service should be run from this directory (utils/POS) with the
following command:
  php POS_Service.php

Debugging may be enabled using:
  php POS_Service.php debug

A service manager (eg nssm for Windows or supervisor for Linux) should be used
to ensure the service is always running.


[Room inquiry]

1. PowerTill initiates the room inqiry by creating an inquiry request file with
   the transaction sequence number
     eg. InqSnd01008645.csa

     This file contains the name of the room as input on PowerTill which may any
     combination of letters or numbers.

2. ResRequest reads in the requested room number and does the following:
     a. Checks if the room exists, otherwise returns "INVALID ROOM"
     b. Checks if the room is checked in, otherwise returns "ROOM VACANT"
     c. Checks if any guests are setup for the room
     d. Allows for an option of "Cash" plus the names of any guests found,
        reduced to a maximum of 16 characters each
     e. Each option is stored in the zp_session_guest table to allow it to be
        mapped back to the correct guest later based on it's position in the
        list
     f. Adds each name to a temporary file (eg. InqRsp01008645.csa.tmp) padded
        to 16 characters
     g. Renames the temporary file to the final response file name
        (eg. InqRsp01008645.csa)

See examples/Inq*.csa


[Transaction posting]

1. PowerTill initiates the posting by creating a posting file with the
   transaction sequence number
  eg. PstSnd01008645.csa

  This file contains two lines of data within fixed-width fields giving an overview of the transaction.

  If item information has been enabled (HOTEL_PMS=R) then additional lines a line per item will 

2. ResRequest reads in the transaction data and does the following:
     a. Checks if an extra has been setup for the revenue centre, otherwise
        returns "There is no extra setup...." error
     b. Checks for zp_session and zp_session_guest entries. If these are not
        found then a "Session has expired..." error is returned
     c. Checks for a property billing unit. If this is not found then a 
        "There is no billing entity..." error is returned
     d. Checks for a property currency. If this is not found then a 
        "There is no property currency..." error is returned
     e. If the taxable amount is non-zero then a taxed extra is created
     f. If the zero rates amount is non-zero then a zero-rated extra is created
     g. Results are written to a temporary file (eg. PstRsp01008645.csa.tmp)
     h. Renames the temporary file to the final response file name
        (eg. PstRsp01008645.csa)
     i. POS session data is removed from zp_session and zp_session_guest

See examples/Pst*.csa
