Accounting

<<Back to Main Menu

Description:
Displays revenue information

Accessible by:
Managers

Accessed from:
Main Menu
Itself

Input parameters:
showInfo

Output
Revenue information:
Default is just to show total income but manager can select to show other information (in the form of a link to Itself, with the 'showInfo' param set in the URL), this includes:
Airport revenue (shows total and average revenue for each airport with links to View Airport)
Route revenue (shows total and average revenue for each route with link to View Route)
Past Flight revenue (shows total revenue from Flights which are in the past)
Future flight revenue (shows revenue from flights which are in the future - i.e. that are still bookable, meaning that it is not the final revenue figure for the flight)


Pseudo Code:
get session
if ('usertype' param in session == 'm') {
   get parameters from the form
   if (showInfo param is empty) {
      get booking information from the database
      display general revenue information
   }
   else if (showInfo param == 'airport') {
      get booking, flight, route and airport information from the database
      for each airport, display total revenue relating to flights flown on routes serving that airport
      divide this figure by the number of days since the first flight to/from that airport to get average revenue
   }
   else if (showInfo param == 'route') {
      get booking, flight and route information from the database
      for each route, display total revenue relating to flights flown on that route
      divide this figure by the number of days since the first flight on that route to get average revenue
   }
   else if (showInfo param == 'pastFlight') {
      get flight information for all past flights from the database
      for each flight, display total revenue relating to it.
   }
   else if (showInfo param == 'futureFlight') {
      get flight information for all future flights from the database
      for each flight, display total revenue relating to it
   }
}
else {
   display error message that user must be a manager
}