# Calculated profit factor

## Configuration

To configure the calculated profit factor the feature for this must be enabled. The feature is listed in the Modules section under Setup / Settings / General.

<figure><img src="https://497021537-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsGm2gYUXX6xCfrrWgU-887967055%2Fuploads%2FgwgOMMcC5aytum8fyUUL%2Fimage.png?alt=media&#x26;token=940f0145-df9c-4808-9a57-b1ce8eed7d4f" alt=""><figcaption></figcaption></figure>

By activating the feature (remember to save), a new menu item will be available in the left panel in Setup / Settings / Projects.&#x20;

<figure><img src="https://497021537-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsGm2gYUXX6xCfrrWgU-887967055%2Fuploads%2FUmmnDQg3ltYzqIXvmpn8%2Fimage.png?alt=media&#x26;token=53c2fede-e7d9-4b4b-b034-dce2641bc9f4" alt=""><figcaption></figcaption></figure>

Select "Calculated" and save this selection to get started.

## Visualization

The profit factor is shown in a few places when this has been done.

#### Project

On the project main page, the profit factor is shown at the bottom of the first left section. The value is shown as - if not yet calculated or a number when calculated. To calculate it on demand, click on the calculator icon next to the value.

<figure><img src="https://497021537-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsGm2gYUXX6xCfrrWgU-887967055%2Fuploads%2FoqgHDJJSQpRjph2vVBRs%2Fimage.png?alt=media&#x26;token=eb1e705c-b935-4e57-8eb3-1c918094a84d" alt=""><figcaption></figcaption></figure>

#### Project Report

In the project report, there is the option to enable/show a column with the calculated profit factor. The value shown is the latest calculated value.

<figure><img src="https://497021537-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsGm2gYUXX6xCfrrWgU-887967055%2Fuploads%2FRt1pWyVfNKAvwgteFIuJ%2Fimage.png?alt=media&#x26;token=83c27dc4-5ce3-42f2-a647-72bb00576442" alt=""><figcaption></figcaption></figure>

## Calculation

The triggering of the calculation of the profit factor is done in a few different ways. All of these will calculate in the same way.

* On demand\
  The calculation can be done at any time from the main page of the project by clicking the afore mentioned calculator icon.
* For all projects\
  All projects can be calculated at once using a tool. The tool is located under Setup / Tools / Main. \
  The section named "Set all project in company" is used for this purpose. Click on "Run" to execute the calculations.<br>

  <figure><img src="https://497021537-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsGm2gYUXX6xCfrrWgU-887967055%2Fuploads%2FEEkt18EorY8uFuS9YDpm%2Fimage.png?alt=media&#x26;token=bd986118-cbb0-41c4-9c34-fea6cc1bdb66" alt=""><figcaption></figcaption></figure>
* Scheduled\
  In addition to these two manual methods of calculation, there is an automated solution in place that is running on a scheduler. This is executed once per day, at midnight, at this time all projects will be updated based on any new registrations of hours or expenses made during the day.&#x20;

## Values calculated

The data taken into account when calculating the profit factor are the hours registered in the project, and the expenses registered in the project that are linked to a supplier.&#x20;

The calculation uses the summarized values for each of hours invoice value and cost as well as expense value.

### Hours

For each hour registered, the hourly rate is multiplied with time registered. The total of this is *HoursTotalValue*.

For each hour registered, the total cost is multiplied with time registered. The total of this is *HoursTotalCost*.

### Expenses

All supplier expenses summed up is *SupplierExpenseTotalValue*.

### Formula

To get the profit factor these values are calculated using this formula:

$$
HoursTotalValue - SupplierExpenseTotalValue / HoursTotalCost
$$
