> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hitaji360.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost Centers

> A cost center is a label you attach to transactions so you can see where your money is earned and spent, independent of which account it hit.

A **cost center** is a label you attach to transactions so you can see *where* your money is earned and spent, independent of *which account* it hit. Where your chart of accounts answers "what kind of cost was this?" (rent, salaries, fuel), a cost center answers "which part of the organisation did it belong to?" (Head Office, the Kampala branch, the Maintenance team, a specific project). The same expense account — say "Utilities" — can be split across many cost centers, and Hitaji can then show you a profit-and-loss statement for any one of them.

Cost centers are an **analytical dimension only**. Tagging a transaction with a cost center changes nothing about the double-entry bookkeeping — the debits and credits land in exactly the same accounts. It simply adds a tag that the reports can group by later.

**You'll find this at:** `/accounting/cost-centers` — in the left navigation under **Accounting → Cost Centers**.

> 📷 *Screenshot: Cost Centers page showing the tree on the left, the Details panel on the right, and the four stat tiles (Total, Postable, Groups, Inactive) — to be added.*

***

## Multi-business note

Cost centers are stored **per accounting book**. If your organisation runs more than one business (book), each book keeps its own, separate cost-center tree — a cost center created in one book is invisible to another. Switch the active business using the business switcher in the top bar before you build or edit your tree, and make sure you are in the right book before tagging a transaction. Budgets, the Cost-Center P\&L report, and the org-unit sync described below all operate within a single book.

***

## Who can use cost centers

Viewing and managing the cost-center tree requires the **`accounting:read`** scope (the same access that lets you open the rest of the Accounting module). Anyone who can open Accounting can create, edit, move, and delete cost centers; there is no separate "cost-center admin" permission.

***

## The cost-center tree

Cost centers are organised as a **hierarchy** (a tree), the same way your chart of accounts is. Every book has a single invisible **root** that the system creates for you the first time you open the page — you never edit or delete it. Underneath the root you build whatever structure mirrors how you think about your organisation, for example:

```
(root)
├── Head Office          (group)
│   ├── Administration   (postable)
│   └── Finance          (postable)
├── Kampala Branch       (group)
│   ├── Sales            (postable)
│   └── Warehouse        (postable)
└── Projects             (group)
    └── Project Alpha    (postable)
```

### Groups vs. postable leaves

Every node is one of two kinds:

| Kind              | Can you tag a transaction to it? | What it's for                                                                                                                             |
| ----------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Group node**    | No                               | A heading that organises its children (e.g. "Head Office", "Projects"). Groups roll up the figures of everything beneath them in reports. |
| **Postable leaf** | Yes                              | The actual cost centers you tag transactions and budget lines against (e.g. "Administration", "Sales").                                   |

This is the single most important rule to understand: **you can only post to leaves, never to groups.** When you create a node you decide which it is with the **Group node** checkbox. A group exists purely to give structure and to provide subtotals; the real tagging always happens on a leaf.

The four stat tiles at the top of the page summarise the tree: **Total** nodes, **Postable (leaves)**, **Groups**, and **Inactive**.

***

## Creating a cost center

1. Go to **Accounting → Cost Centers** (`/accounting/cost-centers`).
2. Click **New Cost Center** (top-right) to add a node under the root, or hover a node in the tree and use its **Add child** action to add beneath that specific node.
3. Fill in the fields below.
4. Click **Save** — or **Save & Add New** to immediately create another.

> 📷 *Screenshot: "Add Cost Center" modal showing the Parent selector, Code, Display order, Name, Description, and the Group node / Active toggles — to be added.*

### Fields

| Field             | Required | Notes                                                                                                                                                                                                                                      |
| ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Parent**        | No       | The group node this cost center sits under. Only **group** nodes can be chosen as a parent. Leave blank to create directly under the root. When you launch the form from a node's "Add child" action, the parent is pre-filled and locked. |
| **Code**          | Yes      | A short identifier, **unique within the book** (max 64 characters), e.g. `ADMIN-UTIL`. Hitaji rejects a second cost center with the same code.                                                                                             |
| **Name**          | Yes      | The display name, e.g. "Utilities" (max 200 characters).                                                                                                                                                                                   |
| **Display order** | No       | Controls the order among siblings in the tree. Lower numbers sort first; ties break alphabetically by name. Defaults to 0.                                                                                                                 |
| **Description**   | No       | Free text for your own reference.                                                                                                                                                                                                          |
| **Group node**    | No       | Tick this to make the node a heading that organises children but cannot be posted to. Leave unticked (the default) to create a postable leaf.                                                                                              |
| **Active**        | No       | Inactive cost centers stay in the tree and keep their history but are hidden from pickers when tagging new transactions. Defaults to active.                                                                                               |

**Behind the scenes:** the parent you pick must already be a group. If you try to create a child under a leaf, Hitaji refuses with *"Parent cost center is a leaf and cannot have children. Convert it to a group first."* Convert the would-be parent to a group via **Edit** first (see below).

***

## Editing, moving, and deleting

Select a node in the tree to see its **Details** panel (code, name, type, parent, active status, and — for a leaf — its mapped org unit). Hover a node to reveal its row actions.

### Edit

Change a cost center's code, name, description, display order, active flag, or its group/leaf type. Two guardrails apply when you change the **type**:

* You **cannot turn a group into a leaf** while it still has children — move or delete the children first.
* You **cannot turn a leaf into a group** while it is still referenced by other records (e.g. an expense-claim type that defaults to it) — reassign those first.

### Move (re-parent a subtree)

Moving a node relocates it *and everything beneath it* under a new parent. The new parent must be a group, you cannot move the root, and you cannot move a node into one of its own descendants (that would create a loop). Hitaji enforces all three and keeps the tree's internal ordering correct for you.

### Delete

Deleting is a **soft delete** — the record is hidden, not erased, so history is preserved. You can only delete a **leaf** that has **no children** and is **not referenced** by any other record. If either is true, Hitaji blocks the delete and tells you what to clean up first. The root can never be deleted.

> 📷 *Screenshot: Cost-center row hover actions (Add child, Edit, Delete) and the Details panel — to be added.*

***

## Tagging transactions with a cost center

A cost center only becomes useful once your transactions carry it. Across the accounting documents that support it, you pick a cost center from a **Cost Center** picker — for example, the **Cost Center** selector on a **bill** applies that center to the bill's lines. The picker shows your postable leaves (groups are normally not selectable when tagging actual spend), searchable by name or code.

When the transaction posts to the general ledger, the chosen cost center is stamped onto each ledger line as a dimension (`cost_center_id`). That stamp is what every cost-center report and the budget-vs-actual figures read back later. A transaction with no cost center simply isn't attributed to any center and won't appear in a single-center report.

> 📷 *Screenshot: Create-Bill modal with the "Cost Center (applies to all lines)" selector — to be added.*

**Behind the scenes:** because the tag lives on the GL line, *anything* that posts to the ledger with a center attached counts — bills, expenses, journal entries, petty cash, and payroll accruals all feed the same reports. This is why payroll cost can show up against a cost center even though you never touched the Cost Centers page during a payroll run (see the next section).

***

## Where cost centers come from automatically: org-unit sync

If your organisation uses the HR **org structure** (departments, teams, branches as *org units*), Hitaji can derive cost centers from it automatically so that **payroll cost is attributed to the right department without any manual tagging**.

Here is what happens. When a payroll run posts the cost of a contract and that contract's salary assignment carries no explicit cost center, Hitaji looks at the contract's **org unit** and, on first use, **creates a matching leaf cost center** for that org unit inside the accounting book. The new cost center:

* is a **postable leaf**, named after the org unit;
* is given a deterministic code derived from the org unit (so re-runs always land on the same cost center rather than creating duplicates);
* records which org unit it represents (shown as the **Org unit** row in the Details panel).

From then on, every payroll posting for staff in that department flows to that cost center. And because the link follows the *org unit*, a **department transfer** — which moves the employee's contract to a different org unit — automatically re-routes their payroll cost to the new department's cost center on the **next run**. You don't have to remember to re-tag anyone.

This sync only ever **creates** cost centers; it never deletes or renames the ones you maintain by hand. A cost center you built yourself and a cost center the system minted from an org unit live side by side in the same tree. For a leaf, the Details panel tells you whether it is mapped to an org unit (`Mapped` / `Not mapped`).

> 📷 *Screenshot: Details panel of an org-unit-derived cost center showing the "Org unit" mapping row — to be added.*

***

## How cost centers feed the Cost-Center P\&L report

The pay-off for tagging is the **Cost-Center Profit & Loss** report (`/accounting/reports/cost-center-profit-and-loss`, under **Accounting → Financial Reports**). It is an ordinary income statement — revenue, expenses, and net result — but **filtered to a single cost center** instead of the whole book.

1. Pick a **cost center** from the dropdown (leaves and groups are both selectable here).
2. Choose the **period**.
3. Decide whether to **Include sub-centers**.

When **Include sub-centers** is on (the default), the report rolls in every cost center beneath the one you picked — so selecting a group like "Head Office" gives you the combined P\&L of Administration, Finance, and anything else under it. Turn it off to see *only* the lines tagged to the exact cost center you chose.

The figures come straight from the GL lines that carry each cost center's `cost_center_id` dimension, so payroll accruals, expense bills, and petty cash are all included — it is GL-truth, not an estimate. The report can be exported to **PDF, CSV, or XLSX**. Note that, unlike the statutory statements, the Cost-Center P\&L is an analytical drill-down and is **not frozen at period close** — it always reflects current GL data for the period you select.

> 📷 *Screenshot: Cost-Center P\&L report with the cost-center dropdown, "Include sub-centers" toggle, and the Revenue / Expenses columns — to be added.*

***

## Related

* [Budgets](/accounting/user/budgeting/budgets) — set targets against cost centers and compare budget vs. actual.
* [Accounting basics](/accounting/user/basics/accounting-basics) — chart of accounts and the double-entry foundations cost centers sit on top of.
* [Dashboard](/accounting/user/basics/dashboard) — where the accounting module starts.
