# Bonus calculation

Bonus calculation is a configuration reference surface for reviewing bonus settings in
stage order, from **Costs** through **Bonus distribution**. Use it when you need to review
branch values, salary groups, targets, achievement settings, or the distribution of a bonus.

| If you need to… | Go to |
| --- | --- |
| Confirm which bonus stage you are reviewing | [Read the stages and fields](#read-the-stages-and-fields) |
| Open the configuration surface | [Open Bonus calculation](#open-bonus-calculation) |
| Review or change stage values | [Review and maintain stage values](#review-and-maintain-stage-values) |
| Handle a branch or popup variation | [Handle stage and popup variations](#handle-stage-and-popup-variations) |
| Match a message to the action that produced it | [When a calculation action goes wrong](#when-a-calculation-action-goes-wrong) |

## Before you start

**Prerequisites**

- You have access to the configuration area.
- You know which year you need. The **Year** list contains `2021`, `2022`, and `2023`.
- You know which stage you need to review. The available stage tabs depend on the current
  stage data loaded for the selected year.

The selected year loads the bonus header and its current stage. When no usable year is provided,
the page uses `2021`.

With these prerequisites in place, open Bonus calculation from the configuration menu.

## Open Bonus calculation

Open Bonus calculation from the configuration menu when you need to review a particular year.

**Prerequisites**

- You have the required configuration access.
- You have a year value from the **Year** list.

**Steps**

1. Open the configuration area.
2. Select **Bonus calculation**.
3. Check that **Year** and the bonus stage controls appear.
4. If another page opens, return to **Bonus calculation** from the configuration area.

![Check that the configuration page opens with its expected controls.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/8cb1b9b8db1e9f4d786c4b304c2b1c73.png)

The rendered page displays **Sort by Booking**, **Sort by Target**, and **Sort by Achievement**
instead of the bonus stages.

![Check that the address bar and page controls belong to the requested configuration surface.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/e8db9011e06f3a16d8c8accd4dee2508.png)

![Check the page reached after the year route is requested.](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/8cb1b9b8db1e9f4d786c4b304c2b1c73.png)

**Result:** The page is ready when **Year** and the bonus stage controls are visible.

Continue with the stage and field descriptions below.

## Read the stages and fields

The page presents the exact stages **Costs**, **Salaries**, **Achievement**, and
**Bonus distribution**, with target values shown in the stage data. A branch section opens
only when its branch data is present and the branch is opened.

The stages form a year-based sequence. **Costs** records branch cost inputs, **Salaries**
records salary amounts and optional service usage, **Achievement** displays sales-team
booking and tendency values and accepts teamless performance and a minimum booking rate,
and **Bonus distribution** sets the share of net earning used as a bonus and displays
distribution results by team and teamless group.

> **Note:** Target settings are not available from the rendered stage bar.

| Stage or area | What appears there | When it appears |
| --- | --- | --- |
| **Costs** | Cost-related numeric fields and earning choices | A branch is open and cost-branch data exists |
| **Salaries** | Salary values, salary portions, and usage values | A branch is open and salary-branch data exists |
| Target settings | Branch target values and sales-team target values | A branch is open; some values require a sales team |
| **Achievement** | Performance and teamless-group values | A branch is open; one value requires a teamless group |
| **Bonus distribution** | Branch distribution percentages and distribution choices | Branch data exists, the branch is open, it is not hidden for the widget, and the page is not displayed as a widget |
| Group popup | **Group name** | The add-group or edit-group popup is open; No group-type field appears in this popup. |
| Usage area | Salary-usage percentage values | The usage table is open and salary-branch data exists |

The labels available for the fields include **Year**, **Min margin**, **Salary portion for teamless**,
**Commission/Margin distribution**, and **Group name**. No group-type field appears on this page.
The year choices are `2021`, `2022`, and `2023`.

| Field | Type and rule |
| --- | --- |
| **Year** | Select from `2021`, `2022`, or `2023`. |
| **Group name** | Text field; required in the add-group and edit-group popup. |
| **Min margin** | Numeric field with a minimum of `0`; it is not available on this page. |
| **Commission/Margin distribution** | Numeric field with a range from `0` to `100`; it is not available on this page. |

The page-level form's **Save** action is not available. Use **Save** in the Bonus distribution
when that stage is open.

Continue with the ordered review procedure when you know which stage and field you need.

## Review and maintain stage values

Use the stage-choice table to open the path that matches your task. Each stage exposes branch
values only after its branch is open.

**Prerequisites**

- The bonus-calculation surface is open.
- The selected year has loaded its stage data.
- A branch is available when the step requires branch values.

**Stage choice**

| If you need to review… | Select | Follow |
| --- | --- | --- |
| Cost, salary, or achievement values | **Costs**, **Salaries**, or **Achievement** | Costs, Salaries, and Achievement progression |
| Distribution values | **Bonus distribution** | Distribution |
| Earning calculation values | **Bonus distribution** | Earning panel |

### Distribution

**Steps**

1. Select **Bonus distribution**.
2. In the distribution area, select **In ratio of salaries** when the distribution should use
   the salary-ratio mode.
3. Select **Save** in **Bonus distribution**.

**Result:** The distribution values remain on screen, and a successful save displays
`Your request was completed successfully`.

### Earning panel

**Steps**

1. Select **Bonus distribution**.
2. In an earning panel, select **Earning up today** for earnings up to today.
3. In an earning panel for an earlier year, select **Earning till 31 Dec**.
4. Select **Including Forecast** when forecast booking is included in the earning calculation.
5. Select **Save** in **Bonus distribution**.

**Result:** The earning-panel values remain on screen after the distribution save.

### Costs, Salaries, and Achievement progression

After selecting **Costs** in the stage-choice table, follow the stages in order.

**Steps**

1. In **Costs**, select **Save**.
2. In **Costs**, select **Next step**.
3. In **Salaries**, select **Save**.
4. In **Salaries**, select **Next step**.
5. In **Achievement**, select **Save**.
6. In **Achievement**, select **Next step**.

**Result:** The selected stage advances through the available progression after each stage save.

<!--
-->

<!--
-->

<!--
-->

<!--

-->

Use the variation table below when branch data or a popup changes what you can select.

## Handle stage and popup variations

The fields and actions change with the branch data and the kind of popup that is open. Use
the path that matches what is on screen.

**Prerequisites**

- The relevant stage is open.
- The branch or popup condition in the table below is true.

| If you need to… | Use this condition |
| --- | --- |
| Review cost values | An open branch has cost-branch data. |
| Review salary values | An open branch has salary-branch data. |
| Review usage values | The usage table is open and salary-branch data exists. |
| Add or edit a group | The group popup is in add-group or edit-group mode. |
| Review sales-team target values | The open branch contains a sales team. |
| Review the teamless achievement value | The open branch contains a teamless group. |
| Review distribution values | Branch data exists, the branch is open, the branch is not hidden for the widget, and the page is not displayed as a widget. |
| Import a file | The shared popup is in import mode. |

**Steps**

1. Choose one path from the table above.
2. When a shared popup presents alternatives, use the control that matches your intended
   outcome:

   | If you want to… | Select |
   | --- | --- |
   | Leave without saving | **Don't Save** |
   | Close the popup or cancel the task | **Cancel** |
   | Upload an import file | **Upload** |
   | Reject a confirmation | **No** |
   | Confirm a confirmation | **Yes** |
   | Close an alert | **Ok** |
   | Leave a subscription-upgrade surface outside a popup | **Back** |

**Result:** The applicable branch, field group, or shared popup remains on screen for the
selected path.

## When a calculation action goes wrong

Use the exact text of the message to identify the action that stopped.

| What you see | What to do |
| --- | --- |
| `An error occurred while processing your request` | Review the values involved in the action and retry the same save or submit control. |
| `Salary portions exceeded the total salary of sales teams` | Review the salary portions and bring their total to `100` or less before submitting. |

### Out of scope

The shared-popup messages are outside the page-level calculation flows unless a live flow
opens that popup.

| Situation | What to do |
| --- | --- |
| Another page opens | If another page opens, select **Bonus calculation** from the configuration menu. |

## After reviewing the calculation

After reviewing a stage, leave the values in the stage you intend to maintain and check the
result message after an available save action. The available checks for this page are:

| Check | What to confirm |
| --- | --- |
| Stage review | The selected stage and its branch values remain visible. |
| Distribution save | `Your request was completed successfully` appears after a successful save. |
| Salary validation | `Salary portions exceeded the total salary of sales teams` appears when the salary-portion total is above `100`. |
| General failure | `An error occurred while processing your request` identifies the general error path. |

**Result:** You have the outcome message for the action you performed and can return to the
stage you need.
