AdminDoc2.0

From OpenFlyers Documentation
Revision as of 19:53, 12 August 2024 by imported>Claratte (Text replacement - "<sql>" to "<syntaxhighlight lang="sql">")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page is dedicated to receive admin doc of release 2.0.

  • During user import, it's default structure parameters that are applied to user contrary to version 1.2 where there were a list of checkboxes.

Parameters

Menu "club/parameters"

Account management

Currency pattern

Currency pattern is built with the currency symbol defined by the user

Pattern Symbol Separator Example Some countries
Decimal Thousand
$#,##0.00;$-#,##0.00 before comma dot $-1,234.56 Defaut, USA, England, Yen
#,##0.00DZ;-#,##0.00DZ after comma dot -1,234.56DZ Algeria, Maroc
€#.##0,00;€-#.##0,00 before dot comma €-1.234,56 Italy, Belgium
#.##0,00€;-#.##0,00€ after dot comma -1.234,56€ German, Spain, Portuguese
# ##0,00€;-# ##0,00€ after comma space -1 234,56€ French, Russia
Fr#'##0.00;Fr-#'##0.00 before dot quote Fr-1'234.56 Swiss
# ##0€00;-# ##0€00 decimal replaced by symbol space -1 234€56
#,##0$00;-#,##0$00 decimal replaced by symbol comma -1,234$56

If you don't find our, contact us

Create users

To add an user you need first:

  • To create groups (Users/Group) if needed
  • Then you go to Users/Users list and you select "ADD AN USER"

Create instructors

  • You check the instructor box ("Type of user" in the user form) to choosen users and you don't forget to specify the "Instructors Initials"

Create aircrafts

  • You need first to create aircrafts type as needed (in Fleet/Aircraft types)
  • Then you go to Fleet/Aircraft and you select "ADD AN AIRCRAFT"

Flight hours computation

In all formula, due to difference with interpretation of decimal separator in various personal computer, all values should be written without decimal separator, use X/Y to obtain correct value

Do not forget that time is given in sexacentimal. So to convert in hours you have to divide by 600.

1 minute = 10 sexacentimals
5 minutes = 50 sexacentimals
1 hour = 60 minutes = 600 sexacentimals
1 hundredth of hour = 6 sexacentimals
10 hundredth of hour (=1 tenth of hour) = 60 sexacentimals

Example: for 100,10

10010*%DURATION/60000
to round at 5 minutes : roundCeil(X,50)
to round with 10 hundredths : roundCeil(X,60)


Flight hours computation formula

Variable name description
%DURATION flight time input into the form
%COUNTER_DEPARTURE counter departure input into the form
%COUNTER_ARRIVAL counter arrival input into the form
%PILOT The pilot id
Function description Example
max(a,b) return the maximum between a and b
min(a,b) return the minimum between a and b
abs(a) return the absolute value of a
roundCeil(a,b) return the a value round top to b roundCeil(106,5) return 110
sumFlightTime(%PILOT, 'year', 'month', 'day', 'hour', 'minute', 'position' ) Returns the total flight time of a pilot since a starting date. Position at 0 is first pilot, position at 1 is second pilot sumFlightTime(%PILOT, 2008, 01, 01, 00, 00, 0 ) returns the total flight time of first pilot since 2008-01-01 00:00:00

Examples

Difference of the hours

%DURATION

Difference of the counters

%COUNTER_ARRIVAL - %COUNTER_DEPARTURE

Round difference of the hours at (top) 5 minutes

roundCeil(%DURATION, 50)

Round difference of the hours at (bottom) 5 minutes

roundCeil(%DURATION - 40, 50)

Round difference of the hours at (nearest) 5 minutes

roundCeil(%DURATION - 20, 50)

Difference of the counters plus 5 minutes

%COUNTER_ARRIVAL - %COUNTER_DEPARTURE + 50

Round difference of the counters at 10 hundreth

roundCeil(%COUNTER_ARRIVAL - %COUNTER_DEPARTURE, 60)

Greater between difference of the hours and difference of the counters

max(%DURATION, %COUNTER_ARRIVAL - %COUNTER_DEPARTURE)

Greater between difference of the hours and round difference of the counters at 5 minutes

max(%DURATION,roundCeil(%COUNTER_ARRIVAL - %COUNTER_DEPARTURE, 50))

Difference of the counters rounded to the nearest 5 minutes

roundCeil(%COUNTER_ARRIVAL - %COUNTER_DEPARTURE - 25, 50)

Example of results

input value output value
10 10
11 10
12 10
13 15
14 15
15 15

Pricing management

Pricing management formula

The formula knows following variables:

Variable name description
%DURATION Calculated duration recorded for the flight
%COUNTER_DEPARTURE counter departure recorded for the flight
%COUNTER_ARRIVAL counter arrival recorded for the flight
%NOW_DATE date of the input flight
%START_DATE date of the begin of the flight
%USER_TZ User timezone
%ENTITY_TZ Entity timezone/Club default timezone
Function description Example
max(a,b) return the maximum between a and b
min(a,b) return the minimum between a and b
abs(a) return the absolute value of a
roundCeil(a,b) return the a value round top to b roundCeil(106,5) return 110
formatDate('pattern',%SOME_DATE) return the formatted %SOME_DATE formatDate('%w',%START_DATE) returns the day of week of START_DATE
addTime(%SOME_DATE, %SOME_TZ) Returns %SOME_DATE with added time depending of %SOME_TZ addTime(%NOW_DATE, %USER_TZ) returns the current date converted to user timezone by adding timezone time difference
subTime(%SOME_DATE, %SOME_TZ) Returns %SOME_DATE with substracted time depeding of %SOME_TZ subTime(%NOW_DATE, 'Europe/Paris') returns the current date converted to France timezone by substracting timezone time difference

Allowed operators / Conditional operator

Operator Example Result
(condition) ? true : false ($DR1 > 100) ? 1 : 0 If variable $DR1 is superior to 100, 1 is returned else 0 is returned
OR ( formatDate('%w', %NOW_DATE) == 0 OR formatDate('%w', %NOW_DATE) == 6) ? 100 : 200 Returns 100 if we are on saturday or sunday else it returns 200
AND ( formatDate('%w', %NOW_DATE) > 0 AND formatDate('%w', %NOW_DATE) < 6) ? 100 : 200 Returns 100 if we are not on saturday or sunday else it returns 200

Allowed timezone

See here

formatDate possible pattern

  • %a abbreviated weekday name (Sun, Mon, Tue)
  • %A full weekday name (Sunday, Monday, Tuesday)
  • %b abbreviated month name (Jan, Feb, Mar)
  • %B full month name (January, February, March)
  • %C century number (the year divided by 100 and truncated to an integer, range 00 to 99)
  • %d day of month (range 00 to 31)
  • %D same as "%m/%d/%y"
  • %e day of month, single digit (range 0 to 31)
  • %E number of days since unspecified epoch (integer, Date_Calc::dateToDays())
  • %H hour as decimal number (00 to 23)
  • %I hour as decimal number on 12-hour clock (01 to 12)
  • %j day of year (range 001 to 366)
  • %m month as decimal number (range 01 to 12)
  • %M minute as a decimal number (00 to 59)
  • %n newline character (\n)
  • %O dst-corrected timezone offset expressed as "+/-HH:MM"
  • %o raw timezone offset expressed as "+/-HH:MM"
  • %p either 'am' or 'pm' depending on the time
  • %P either 'AM' or 'PM' depending on the time
  • %r time in am/pm notation, same as "%I:%M:%S %p"
  • %R time in 24-hour notation, same as "%H:%M"
  • %s seconds including the decimal representation smaller than one second
  • %S seconds as a decimal number (00 to 59)
  • %t tab character (\t)
  • %T current time, same as "%H:%M:%S"
  • %w weekday as decimal (0 = Sunday)
  • %U week number of current year, first sunday as first week
  • %y year as decimal (range 00 to 99)
  • %Y year as decimal including century (range 0000 to 9999)
  • %% literal '%'

Example

  • An aircraft with a cost of 94€ per flight hours, will have:
94*%DURATION/600
  • An aircraft with a cost of 110€ per "counter" hours, will have:
110*(%COUNTER_ARRIVAL-%COUNTER_DEPARTURE)/600
  • When it's week-end, the cost (100€) per flight hours is cut to half, the formula will be:
(formatDate('%w', %START_DATE) == 0 OR formatDate('%w', %START_DATE) == 6) ? 50*%DURATION/600 : 100*%DURATION/600

Qualification

You may define your own qualifications (licence, medical, etc.)

For doing that, you got several parameters available:

Time limitation

For qualifications with a time limitation (pilots will have a date to set for this kind of qualification)

Identifier code management

Add a field for entering the id of the qualification attached to the pilot

Obtaining date management

Add a date field for the obtention date of the qualification

Reserved to instructors

Qualifications reserved to instructors

Blocking qualification

Qualifications will be blocking for flight (not for reservation)

Recent experience: "experience formula"

You may create qualifications checking recent experience like hours or landing number.

Like other qualifications, these ones are managed in the qualification manager (admin menu: users/qualification)

Formula checking recent experience have to be set in the "experience formula" column.

Qualification formula

The formula knows following variables:

Variable name description
%PILOT Pilot id
Function description Example
sumFlightHour(%PILOT,position,day,aircraftType1,aircraftType2,etc) return the flight hours for %PILOT
sumLandingNumber(%PILOT,position,day,aircraftType1,aircraftType2,etc) return the landing number for %PILOT sumLandingNumber(%PILOT,0,45,1,2,3)

Remark: AircraftTypeX is the identification number viewable in "Fleet"/"Aircraft types" column "Identification" of the first table

Example Comment
sumFlightHour(%PILOT,0,45,1,2,3) return the flight hours for %PILOT in Left position (pilot or student) on aircraft type 1,2 and 3
sumLandingNumber((%PILOT,1,45,4,5,3) return the landing number for %PILOT in Right position (flight instructor) on aircraft type 4,5 and 3

Accountancy

Accountancy tips and tricks

Aircraft Type

Tank

  • Goal: allow to an admin to create as many tanks (by aircraft type) as he needs.
  • Use: for each flight, the pilot would be able to say which quantity has been added for each tank created by the admin, before and/or after the flight.

How to create a tank

  • Go to Fleet/Aircraft types
  • then action "modify" for a choosen aircraft type
  • At the bottom of the page (bellow "Tank" title):
    • Fill the "Tank" text area with the choosen name (ex: "main tank")
    • Choose a fuel type and an unit
    • Clic on the "Add" button

Reports

Admin are allowed to create their own database SQL extract and to see them on their browser or to save them in an XML file via the "REPORTS" menu.

Get the list of members whom had subscribed this year

<syntaxhighlight lang="sql">SELECT first_name,last_name FROM authentication RIGHT JOIN member ON member.id=authentication.id WHERE year(member.subscription)=$year ORDER BY last_name,first_name</sql>