> ## 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.

# Customers & Vendors (Contacts)

> Contacts are the people and organisations your business buys from and sells to.

Contacts are the people and organisations your business buys from and sells to. Every invoice you raise is addressed to a **customer**, every bill or expense you record is owed to a **vendor**, and every payment you receive or make is matched to one of these contacts. Keeping a clean contact list is what lets Hitaji show you, at a glance, *how much each party owes you and how much you owe them*.

**You'll find this at:** `/accounting/contacts` — in the left navigation under **Accounting → Customers & Vendors**.

> 📷 *Screenshot: Customers & Vendors list page with the All / Customers / Vendors tabs and the Outstanding Balance summary card — to be added.*

***

## Multi-business note

Contacts are stored **per accounting book**. If your organisation runs more than one business (book), each book keeps its own customer and vendor list. Switch the active business using the business switcher in the top bar before adding or editing contacts, and you will only see — and only affect — the contacts that belong to the book you are currently in.

***

## Contact types

When you create a contact you must choose a **type**. The type controls where the contact appears (the Customers tab, the Vendors tab, or both) and which documents it can be used on.

| Type         | Meaning                                            | Where you'll use it                                    |
| ------------ | -------------------------------------------------- | ------------------------------------------------------ |
| **Customer** | Someone you sell to and invoice.                   | Invoices, customer receipts, debts (receivables).      |
| **Vendor**   | Someone you buy from and owe.                      | Bills, expenses, vendor payments.                      |
| **Both**     | A party that is both a customer *and* a supplier.  | Appears on both the Customers and Vendors tabs.        |
| **Employee** | A staff member acting as a financial counterparty. | Created automatically — see "Employee contacts" below. |

You normally only pick **Customer**, **Vendor**, or **Both** yourself. The **Employee** type is special and is managed for you by the system.

### Employee contacts (automatic)

When a member of staff first transacts in a book — for example, a salary advance, a loan, a reimbursement, or a payroll settlement — Hitaji automatically creates a hidden **Employee** contact for that person in that book. This is what lets staff balances (advances owed, salary payable, loans) show up in your aged receivables and payables grouped by the real person. You do not create or edit these yourself; they appear automatically the first time the employee has a financial transaction in the book. There is at most **one Employee contact per person per book**.

***

## Creating a contact

1. Go to **Accounting → Customers & Vendors** (`/accounting/contacts`).
2. Click **Add Customer or Vendor** (top-right).
3. Fill in the fields below.
4. Save.

> 📷 *Screenshot: Create-contact form showing type selector, name, and tax fields — to be added.*

### Fields

| Field                        | Required | Notes                                                                                                                                   |
| ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Type**                     | Yes      | Customer, Vendor, or Both.                                                                                                              |
| **Name**                     | Yes      | The company or individual name. This becomes the contact's display name on documents. Max 200 characters.                               |
| **First name / Last name**   | No       | For individuals. If you leave **Name** blank, the display name is built from first + last name.                                         |
| **Email**                    | No       | Must be a valid email. **Must be unique within the book** — Hitaji rejects a second contact with the same email.                        |
| **Phone**                    | No       |                                                                                                                                         |
| **Address / City / Country** | No       | Used on printed invoices and bills.                                                                                                     |
| **Tax ID / TIN**             | No       | The party's tax identification number. Used for EFRIS e-invoicing and on tax documents.                                                 |
| **Buyer type**               | No       | EFRIS buyer classification for Uganda fiscalisation: B2B, B2C, Foreigner, or B2G. If left blank, fiscalisation treats the buyer as B2C. |
| **Legal name**               | No       | The authoritative legal name (as confirmed by URA TIN validation). May differ from the trading/display name.                            |
| **NIN**                      | No       | National Identification Number, for individuals or foreigners.                                                                          |
| **BRN**                      | No       | Business Registration Number, for organisations that do not have a TIN.                                                                 |
| **Notes**                    | No       | Free text for your own reference.                                                                                                       |

> **Display name rule.** Hitaji always stores a display name. It uses **Name** if you provide it; otherwise it joins first + last name; otherwise the email; and as a last resort "Unnamed Contact". So at minimum, give the contact a name or an email.

### Duplicate email

If you enter an email that already belongs to another contact in the same book, the save is blocked with *"Contact with email '…' already exists"*. Email is the system's de-duplication key — change the email or find the existing contact instead of creating a second one.

***

## Editing a contact

Open a contact from the list and change any field. The same rules apply as on create: a changed email must still be unique within the book, and the display name is recomputed if you edit the name fields. Tax details (TIN, legal name, NIN, BRN, buyer type) can be updated at any time.

***

## Contact balances

Each contact row shows an **outstanding balance**. This is the single most useful number on the page: it tells you the net amount standing between you and that party.

* A **positive balance** means the contact (a customer) **owes you** money — open receivables.
* A **negative balance** means **you owe** the contact (a vendor) — open payables.

### Behind the scenes — how the balance is calculated

The balance is **receivables minus payables** for that contact in the current book:

* **Receivables** = the sum of the *balance still due* on that contact's invoices, counting only invoices that are live (not Draft and not Void).
* **Payables** = the sum of that contact's expenses that are awaiting approval or approved **and** still unpaid.

So `balance = open invoice balances − open unpaid expenses`. A customer with one unpaid 500,000 invoice shows **+500,000**; a vendor you owe 300,000 shows **−300,000**.

> **Note for accountants.** The list-level balance figure is driven by invoices and expenses. Staff sub-ledger balances (advances, loans, salary payable) on Employee contacts surface through the aged receivables/payables reports rather than this single number.

### Why a balance might look slightly out of date

For speed, Hitaji keeps a **cached balance** for each contact and refreshes it automatically:

* The cache is considered fresh for **5 minutes**. Within that window the stored figure is shown instantly.
* Whenever a journal entry that touches a contact is **posted**, that contact's balance is **recomputed immediately** in the background.

In practice the balance is up to date the moment you post something. If you ever suspect a figure is stale, reopening the contact (which forces a fresh read after 5 minutes) brings it current.

***

## How a contact links to invoices, bills and payments

A contact is the connective tissue across the whole accounting module:

* **Invoices** are raised *to a customer*. The invoice's outstanding amount feeds that customer's receivable balance.
* **Bills and expenses** are recorded *against a vendor*. Their unpaid amounts feed that vendor's payable balance.
* **Payments** (receipts and disbursements) are matched to the same contact and clear down the invoices or bills, which in turn reduces the contact's balance.

Because every document carries the contact, you can open a customer or vendor and trust that their balance reflects every live invoice, bill, expense and payment in that book.

***

## Linking a contact to a CRM contact

If you also use the CRM module, the same real-world person or company may exist both as an **accounting contact** (customer/vendor) and as a **CRM contact**. Hitaji lets you connect the two so they refer to the same party.

* The link is **one-to-one**: an accounting contact can be linked to exactly one CRM contact, and vice-versa.
* If you try to link a customer/vendor that is already linked to a *different* CRM contact (or the CRM contact is already linked elsewhere), Hitaji blocks it with a clear message. Unlink the existing pairing first.
* Unlinking is always safe and is a no-op if nothing was linked.

This linking is what allows sales activity in the CRM and financial activity in accounting to be recognised as the same customer.

> 📷 *Screenshot: Contact detail with the "Link CRM contact" action — to be added.*

***

## Deleting a contact

You can delete a contact from its row or detail view. Deletion is a **soft delete** — the record is hidden, not physically destroyed, so historical documents that reference it remain intact.

**You cannot delete a contact that has an outstanding balance.** If the contact still owes you (or you owe them), Hitaji refuses with *"Cannot delete contact with outstanding balance"*. Settle or clear the open invoices/bills first, then delete.

***

## Access & permissions

* **Viewing** customers & vendors requires the `accounting:read` scope (the page is gated on `accounting-contacts:read` in navigation).
* Creating, editing, and deleting contacts is available to users with accounting write access in the book.

***

## Related

* [Categories](/accounting/user/masters/categories)
* [Tax codes](/accounting/user/masters/taxes)
* [Withholding tax](/accounting/user/masters/withholding-tax)
* [Payment terms](/accounting/user/masters/payment-terms)
