Difference between revisions of "EposQueries"

From Warwick Student Cinema
Jump to: navigation, search
(Selling tickets)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
  +
{{Update}}
  +
 
==Details on how the EPOS system works==
 
==Details on how the EPOS system works==
   
Line 4: Line 6:
   
 
==Selling tickets==
 
==Selling tickets==
  +
The same page is used for listing tickets to be sold as searching for members. It works through the page in the following order, only following some tasks if the person has be identified by their person id.<br>
'''Is this once a number has been scanned? What happens when names are entered?'''
 
  +
Scanning names is the same as scanning uni_nos. If it matches the regexp for a uni_no it searches on uni_no otherwise it assumes its a name.<br>
  +
 
*Checks the validity of the session (see till sessions)
 
*Checks the validity of the session (see till sessions)
*If got person id '''Search people table?'''
+
*If got person id '''Search people table?''' - person id returned by use of member search form (below)
 
- Get person details
 
- Get person details
- Get memberships (Check union if required) '''Check members table for current membership then on failure check union?'''
+
- Get memberships (Check union if required)
  +
- Check members table else
- Get tickets available to person '''How do tickets work?'''
 
  +
- Check union for membership else
  +
- Check union for socs fed
  +
- Get tickets available to person (See selecting tickets)
 
- Auto select best of available tickets
 
- Auto select best of available tickets
 
*Display member search form
 
*Display member search form
Line 15: Line 22:
 
- Check for person on ldap
 
- Check for person on ldap
 
- Cache person details if found
 
- Cache person details if found
- Reload page with person id and clear day table '''What's the day table for?''' - The day table is for caching tickets which are preselected, so ticket preselection will make use of this table.
+
- Reload page with person id and clear day table '''What's the day table for?''' - The day table is for caching tickets which are selected
*List each of the available tickets '''Is this just standard tickets plus results from memberships and/or status?'''
+
*List each of the available tickets '''Is this just standard tickets plus results from memberships and/or status?''' - Any tickets for which the person qualifies (See selecting tickets)
 
**Highlight ticket if its in day table
 
**Highlight ticket if its in day table
 
**Add / remove tickets to day table
 
**Add / remove tickets to day table
  +
*Confirm - Go to processtransaction.php to process the transaction
*Confirm '''Is this thesecond time a ticket is validated?'''
 
   
 
==Till sessions==
 
==Till sessions==
  +
Till session conveniently collect together a whole bunch of session variables and authentication plus uniquly identifies a till for records.<br>
'''What are till sessions for?'''
 
  +
If there was no till session, the checks described below would have to be done on every page load.<br>
  +
You would also need to repeatedly get the session vars from the database.<br>
  +
Finally, you can reliably identify the user and till used for any transaction.<br>
 
*Check for till session id in cookie
 
*Check for till session id in cookie
 
*If no session id exists, create a till session
 
*If no session id exists, create a till session
Line 37: Line 47:
 
- till ip address
 
- till ip address
 
- Number of seats show is set up with
 
- Number of seats show is set up with
  +
  +
==Selecting tickets==
  +
*Get all the tickets that can be sold for this show based on show setup
  +
*Foreach ticket check if the sale of the ticket would be valid (see Determining if a sale is valid)
   
 
==Auto selecting tickets==
 
==Auto selecting tickets==

Latest revision as of 23:12, 9 February 2019

Details on how the EPOS system works

Show setup

Selling tickets

The same page is used for listing tickets to be sold as searching for members. It works through the page in the following order, only following some tasks if the person has be identified by their person id.
Scanning names is the same as scanning uni_nos. If it matches the regexp for a uni_no it searches on uni_no otherwise it assumes its a name.

  • Checks the validity of the session (see till sessions)
  • If got person id Search people table? - person id returned by use of member search form (below)
- Get person details
- Get memberships (Check union if required)
  - Check members table else
  - Check union for membership else
  - Check union for socs fed
- Get tickets available to person (See selecting tickets)
- Auto select best of available tickets
  • Display member search form
- Check for person in filmsoc db
- Check for person on ldap
- Cache person details if found
- Reload page with person id and clear day table What's the day table for? - The day table is for caching tickets which are selected
  • List each of the available tickets Is this just standard tickets plus results from memberships and/or status? - Any tickets for which the person qualifies (See selecting tickets)
    • Highlight ticket if its in day table
    • Add / remove tickets to day table
  • Confirm - Go to processtransaction.php to process the transaction

Till sessions

Till session conveniently collect together a whole bunch of session variables and authentication plus uniquly identifies a till for records.
If there was no till session, the checks described below would have to be done on every page load.
You would also need to repeatedly get the session vars from the database.
Finally, you can reliably identify the user and till used for any transaction.

  • Check for till session id in cookie
  • If no session id exists, create a till session
- Check priv required
- Check show is active
- Check user is signed up to show
- Create cookie
- Store session info in database
  • Check session id, user id & screening id against till session in database
  • Retrive session information including
- user id
- screening id
- film title
- till ip address
- Number of seats show is set up with

Selecting tickets

  • Get all the tickets that can be sold for this show based on show setup
  • Foreach ticket check if the sale of the ticket would be valid (see Determining if a sale is valid)

Auto selecting tickets

  • Take list of available tickets
  • For each ticket select first and replace with current if
1. Current ticket is cheaper
2. Current ticket is free and not a multifilm ticket (ie. a complementary ticket)
3. Ticket has a higher priority

Processing the transaction

  • Take tickets in day table
  • If not a dm override session, check the sale is valid
  • Add transaction details to db
  • Add ticket details to db
  • Print tickets

Determining if a sale is valid

This is the same as checking if a ticket is available

  • Is the person qualified for the ticket (Based on memberships)
  • Is the ticket a multifilm ticket
- Are there tickets avilable on previously sold passes
- Has a pass been added in current transaction
- No tickets are remaining, return false
  • Are there any tickets remaining (based on member_limit)