# Branches and SMS Credits

## Purpose

Branches identify the office responsible for users and records in the system. This makes it possible to distinguish work performed by Head Office (HQ) from work performed by other offices.

The system normally assigns a branch automatically. Users do not need to select a branch every time they create a record.

> Branch ownership identifies where a record belongs. It does not, by itself, restrict users to viewing only their own branch. Access to screens and actions is controlled by user roles and permissions.

## Key Concepts

### Head Office (HQ)

- One branch must always be designated as HQ.
- Only one branch can be HQ at a time.
- Marking another branch as HQ automatically removes the HQ designation from the previous branch.
- The HQ branch cannot be deleted.
- HQ holds SMS credits that have not yet been assigned to another branch.

### Regular Branch

A regular branch is any branch that is not HQ. It can have users, records, and its own SMS-credit balance.

### Active and Inactive Branches

- Active branches can be selected when assigning users.
- An inactive branch is retained for historical reference but is not intended for new assignments.
- Existing records continue to display their branch after the branch is made inactive.

### Unassigned Records

A record may display **Unassigned** when:

- it is an older record created before branches were introduced;
- its source record or user did not have a branch; or
- its branch was deleted.

An administrator should review unassigned records and their related users, clients, or matters.

## Where Branches Are Managed

Open:

**Settings > System Configuration > Branches**

Depending on permissions, a user can:

- view and search branches;
- create a branch;
- edit its name, code, HQ designation, or active status; and
- delete an eligible non-HQ branch.

The branch list also shows the number of assigned users and the current SMS-credit balance.

## Creating a Branch

1. Open **Settings > System Configuration > Branches**.
2. Select **New Branch**.
3. Enter a unique branch name.
4. Enter a unique branch code.
5. Select **HQ branch** only when the new branch should become Head Office.
6. Leave **Active** selected when the branch should be available for assignments.
7. Select **Save Branch**.

Branch codes are saved in uppercase. Codes can contain letters, numbers, dashes, and underscores.

## Editing or Deleting a Branch

Use the edit action beside a branch to update its details.

The following safeguards apply:

- The system will not allow all branches to be left without an HQ.
- The HQ branch cannot be deleted.
- A non-HQ branch cannot be deleted while users are assigned to it. Move those users to another branch first.
- Deleting an eligible branch can leave its historical records marked **Unassigned**. Making a branch inactive is preferable when its history should remain clearly identified.

## Assigning Users to Branches

Every user must be assigned to a branch when the user account is created or updated.

The user's branch is important because it becomes the default branch for records that are not linked to another branch-owned record. It also determines which SMS-credit balance is used when that user sends an SMS.

When a user transfers offices, update the branch on the user account. This affects new user-based records. Existing records retain the branch under which they were created unless they are separately corrected.

## How a Record's Branch Is Inferred

The system follows the related business record wherever possible. This keeps connected records under the same branch.

### Client-Based Records

| Record | Branch source |
| --- | --- |
| Client | The branch of the user creating the client |
| Conflict check | The client's branch |
| Matter | The client's branch |
| Payment | The client's branch |
| Trust deposit or withdrawal | The client's branch |
| Client portal message without a matter | The client's branch |

### Matter-Based Records

| Record | Branch source |
| --- | --- |
| Document | The matter's branch |
| E-filing | The matter's branch |
| Time entry | The matter's branch |
| Expense | The matter's branch |
| Invoice | The matter's branch |
| Client portal message linked to a matter | The matter's branch |

### User-Based and Operational Records

| Record | Branch source |
| --- | --- |
| Communication entered from the Communications screen | The branch of the user creating it |
| Task linked to a matter | The matter's branch |
| Task without a matter | The creating user's branch |
| Calendar event linked to a matter | The matter's branch |
| Calendar event without a matter | The creating user's branch |
| Staff profile | The staff member's branch |
| Leave request | The staff member's branch |
| Payroll record | The staff member's branch |
| Attendance session | The staff member's branch |
| Performance review | The staff member being reviewed |
| Performance goal | The staff member assigned the goal |

### Follow-On Records

Records created from another transaction retain the original branch. For example, reversing a trust transaction creates a counter-entry under the same branch as the original transaction.

## Branch Visibility

Branch details are shown throughout the system, including:

- clients, matters, conflict checks, documents, e-filings, and communications;
- time entries, expenses, invoices, payments, trust records, and reports; and
- tasks, calendar events, staff, leave, payroll, performance, and attendance.

The display normally includes the branch name and code. HQ records also carry an **HQ** label.

## SMS Credits

SMS credits control how many messages a branch can send.

Open:

**Settings > System Configuration > SMS Credits**

The page shows:

- **Total Credits:** all SMS credits across the firm;
- **HQ Pool:** credits held at HQ and not assigned to another branch; and
- each branch's current balance.

### Who Can Manage Credits

To update or assign credits, a user must:

- belong to the HQ branch; and
- have the **Manage SMS Credits** permission.

A user with only the **View SMS Credits** permission can view balances but cannot change them.

### Setting the Firm-Wide Total

1. Enter the firm's total available credits.
2. Select **Update**.

The system recalculates the HQ pool as:

**Firm-wide total - credits already assigned to non-HQ branches**

The total cannot be reduced below the credits already held by non-HQ branches.

### Assigning Credits to a Branch

1. Select a non-HQ branch.
2. Enter the number of credits to assign.
3. Select **Assign**.

The assigned amount is deducted from the HQ pool and added to the selected branch. The system will reject the assignment when HQ does not have enough credits.

Credits cannot be assigned to HQ through this action because HQ already represents the unassigned pool.

### How Credits Are Used

- An SMS uses the balance of the branch assigned to the user who sends it.
- Each single-recipient message normally reserves one credit.
- A bulk send reserves credits for the intended recipients.
- Sending is blocked when the user's branch has no branch assignment or insufficient credits.
- A reserved credit is returned when delivery fails according to the SMS provider response.
- Each credit adjustment, assignment, use, and refund is recorded for audit purposes.

The branch shown on a client or matter does not decide which branch pays for an SMS. The sending user's branch is the source of SMS credits.

## Common Scenarios

### A User Creates a Client and Matter

The client receives the user's branch. The matter then receives the client's branch. Documents, time entries, expenses, and invoices linked to that matter inherit the same branch.

### HQ Assigns SMS Credits

HQ enters the firm-wide total, then assigns part of the HQ pool to each regular branch. Each branch spends only its own balance when its users send messages.

### A User Moves to Another Branch

An administrator updates the user's branch. New user-based records and future SMS messages use the new branch. Existing business records retain their recorded branch.

### A Branch Closes

Mark the branch inactive to preserve its identity on historical records. Reassign its users to active branches. Delete the branch only when retaining the branch label on historical records is not required.

## Troubleshooting

| Message or condition | Meaning and action |
| --- | --- |
| **Unassigned** | Check the related user, client, or matter and ensure it has a branch. |
| **At least one branch must remain HQ** | Select another branch as HQ before removing the current designation. |
| **The HQ branch cannot be deleted** | Designate another branch as HQ first, then reassess whether deletion is appropriate. |
| **Move users to another branch before deleting this branch** | Reassign every user attached to the branch. |
| **SMS credits can only be managed from HQ** | Sign in with an HQ user who has the required permission. |
| **HQ does not have enough unassigned SMS credits** | Increase the firm-wide total or assign a smaller amount. |
| **This branch does not have enough SMS credits** | Ask an authorized HQ user to assign more credits. |
| **SMS cannot be sent without a branch** | Assign the sending user to an active branch. |

## Permissions Reference

| User-facing permission | Purpose |
| --- | --- |
| View Branches | View and search branch records |
| Manage Branches | Create, edit, and delete eligible branches |
| View SMS Credits | View firm-wide and branch credit balances |
| Manage SMS Credits | Set the total and assign credits; the user must also belong to HQ |
| Send SMS | Send messages, subject to the sending branch's available credits |
