> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.haddock.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How do rules work in haddock HR? 📜✨

In haddock HR, **rules** are super important for automatically calculating variables such as worked hours, overtime, night work, and much more. And they're really easy to use! 😎

You can find them in the main menu 👉 **"Rules"**.

![](https://storage.googleapis.com/helpdesk-haddock-images/haddock-hr/contracts-accounts-rules-and-transactions/how-do-rules-work-in-haddock-hr/images/01-how-do-rules-work-in-haddock-hr.png)

There are **3 types** of rules:

1. **Calculated 🧮**
  These rules let you perform **arithmetic operations** (add, subtract, multiply, or divide) between two or more **accounts**.
  For example, you could create a rule that adds normal hours and overtime hours to get the total payable hours.
  ➡️ In addition, calculated rules can be shown in the **"account views"** within the shift planner so that the most relevant information is always visible. Here we explain how to set it up! 👉 [Create account views in the planner](https://help.plain.ninja/es/articles/11148205-crear-vistas-de-cuentas-en-el-plan).
2. **Shift Rules 📅**
  These rules work with **day units** and are automatically activated **every time you assign a shift** to an employee.
  They're perfect for counting, for example, the days someone has worked or has been on call.
3. **Time Type Rules ⏰**
  These use **hour units** and are used to measure specific times within shifts.
  They are ideal for calculating **worked hours**, **night hours**, **extra hours**... and any other time-based situation!

🎯 Thanks to rules, you can customize and automate complex calculations very easily, without having to do anything manually!