# Flex Time

## Flex is Calculated Automatically

In the user card on the tab _Administration - User - Users_, indicate whether the user is entitled to _Flex_.

<figure><img src="https://540380137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzAi1nm81I4wWkROifDVb%2Fuploads%2FyMylcarA37R3Ib3sRFVX%2Fbild.png?alt=media&#x26;token=d2f97b7e-a237-436e-bb35-b4dc7df458ea" alt=""><figcaption></figcaption></figure>

When the "Flex" permission is active, the user can follow the flex change per day and the current flex balance directly in their time registration view.

The starting point for the flex time calculation is the underlying scheduled time of the user. Either the user follows the calendar for the normal working hours or the user uses a schedule specifying the working time. The recorded time is compared to the underlying working time to calculate how the flex changes day by day. Read more about Calendar and Schedule in the related sections.

When the user records more hours than the scheduled hours of the day, the flex balance increases by the excess hours. When the user registers less time than the scheduled hours of the day, the flex balance is automatically reduced.

<figure><img src="https://540380137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzAi1nm81I4wWkROifDVb%2Fuploads%2FPuwvt8acQYL0lfHcCyUy%2Fbild.png?alt=media&#x26;token=0a2f3d48-2e5d-43e2-8faa-04c785518943" alt=""><figcaption><p>Example from week view: The user can follow the flex change day by day and to the right in the view you can see the flex amount of the specific week.</p></figcaption></figure>

In the “Info” view at the bottom left of the time registration view, the user can see how the flex has changed during the period (you can look at values both for the whole month and for a week at a time) - both excl. today's date and incl. today's date.

“Flex sum” presents the total flex balance up to today's date. So when you go home for the day and have finished reporting your day, you will see how much flex time you have in your total flex balance under the heading “Flex - sum”.



<div align="left"><figure><img src="https://540380137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzAi1nm81I4wWkROifDVb%2Fuploads%2FLmaJtnMlECa7wYeUgh6H%2Fbild.png?alt=media&#x26;token=f1246f24-37a7-4e4e-8f0f-d5cb664fe5d6" alt=""><figcaption></figcaption></figure></div>

## Activity for Flex Withdrawal

The most common practice is to simply use the system's built-in flex calculation as described above and no registration handling flex is required by the users. However, there is the possibility to enable users to record time to mark they are making a flex withdrawal. Reasons why you would want to do so could be:

* To make it clear that hours are taken out of the flex bank and thus fill up the day in time reporting up to the scheduled time.
* Use warning/blocking when the user lock month and week (possible to configure in the system). If there are days with fewer hours recorded than the normal working time, the system warn or block for weekly/monthly locking with the request to report at least up to the scheduled time every day of the period to make the period possible to be locked. In order for the user not to see the warning (or blocking) box when the week/month is about to be locked, the user must register flex withdrawals on the days not reported as full-time.

In order to register flex withdrawals, it is necessary to add an activity for this purpose. To add a new activity, go to _Administration - Settings - Project - Activity_. The activity needs to have configurations as follows:

* Activity name that describes what the activity is used for. For example, it can be called “Flex withdrawal”, “Withdrawal of flex” or similar.
* Activity type to be selected - usually “Absence”.\
  Absence type must be “Flex withdrawal”.

<figure><img src="https://540380137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzAi1nm81I4wWkROifDVb%2Fuploads%2FFTh4I3ZBdZU3NHAuhXE2%2Fbild.png?alt=media&#x26;token=5e30d2f1-a1b2-4c1c-b644-958ec572690f" alt=""><figcaption></figcaption></figure>

The activity is preferably added as an additional activity in the “Absence project” - to appear as an additional selection among the absence activities in the time registration view.

How the flex changes day by day is not affected by whether the user reports time on an activity with absence type “Flex withdrawal” or not. The system keeps track of the flex change regardless. Read more above in the section “Flex is calculated automatically”.
