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

# Expenses Overview

> Track organizational spending, operational costs, bank charges, and reserve-funded expenses

## What are Expenses?

**Expenses** are money spent by your organization on operational costs such as rent, utilities, supplies, salaries, bank charges, or other business needs. In Agatabo, expenses are automatically recorded in the general ledger, reduce bank account balances, and appear on financial reports.

## Why Track Expenses?

<Note>
  **Key benefits:**

  * Know exactly how much you're spending and on what
  * Create budgets and monitor spending against targets
  * Generate accurate financial reports (Profit & Loss statement)
  * Ensure accountability and transparency
  * Track spending trends over time
  * Manage reserve fund usage
  * Separate operational expenses from capital expenditures
  * Maintain complete audit trail
</Note>

## How Expenses Work

<Steps>
  <Step title="Spend money">
    Organization pays for something (rent, supplies, bank charges, etc.)
  </Step>

  <Step title="Record in Agatabo">
    Enter the expense with title, amount, date, and details
  </Step>

  <Step title="Select funding source">
    Choose bank account or reserve allocation to fund the expense
  </Step>

  <Step title="Automatic journal entries">
    Agatabo creates double-entry accounting records
  </Step>

  <Step title="Bank balance updates">
    Selected bank account balance decreases automatically
  </Step>

  <Step title="Appears in reports">
    Expense shows on Profit & Loss and expense reports
  </Step>
</Steps>

## Types of Expenses

### 1. Standard Operating Expenses

**Regular operational costs** paid from bank account cash.

**Journal Entry**:

```
Kind: EXPENSE_PAYMENT
Date: Expense date

Dr OPERATING_EXPENSE      Amount
   Cr CASH (Bank Account)  Amount
```

**Example**:

```
Office rent for June: 50,000 RWF

Dr OPERATING_EXPENSE (Rent)  50,000
   Cr CASH (Operations Account)  50,000

Bank Account Balance:
Before: 500,000 RWF
After:  450,000 RWF (decreased)
```

**When to use**: Regular operational costs, utilities, salaries, supplies, etc.

***

### 2. Reserve-Funded Expenses

**Expenses paid from designated reserve allocations** (emergency fund, specific reserve).

**Journal Entries** (Two entries created):

**Entry 1: Reserve Release**

```
Kind: RESERVE_RELEASE
Date: Expense date

Dr CASH (Bank Account)       Amount
   Cr RESERVE_ALLOCATION     Amount
```

**Entry 2: Expense Payment**

```
Kind: RESERVE_EXPENSE
Date: Expense date
Parent: Reserve Release Entry

Dr OPERATING_EXPENSE         Amount
   Cr CASH (Bank Account)    Amount
```

**Example**:

```
Emergency equipment repair: 100,000 RWF from Emergency Reserve

Entry 1 - Reserve Release:
Dr CASH (Operations)           100,000
   Cr RESERVE_ALLOCATION (Emergency)  100,000

Entry 2 - Expense:
Dr OPERATING_EXPENSE (Repairs)  100,000
   Cr CASH (Operations)         100,000

Net Effect:
- Reserve balance: -100,000 RWF
- Cash: unchanged (released then spent)
- Expense recorded: +100,000 RWF
```

**When to use**: Emergency expenses, planned spending from reserves, restricted fund usage

[Learn more about reserves →](/tontines/reserves/overview)

***

### 3. Bank Charges

**Bank service fees** linked to parent expenses, assets, or loans.

**Journal Entry**:

```
Kind: BANK_CHARGE
Date: Expense date
Parent: Main expense/asset/loan entry

Dr BANK_CHARGE_EXPENSE   Amount
   Cr CASH (Bank Account)  Amount
```

**Example**:

```
Pay supplier 200,000 RWF + 2,000 RWF bank charge

Entry 1 - Main Expense:
Dr OPERATING_EXPENSE (Supplies)  200,000
   Cr CASH (Operations)          200,000

Entry 2 - Bank Charge:
Dr BANK_CHARGE_EXPENSE   2,000
   Cr CASH (Operations)  2,000

Total cash decrease: 202,000 RWF
```

**Automatic linking**: Bank charges are separate entries linked to parent via `parentExpenseId`

**When to use**: Transaction fees, wire transfer fees, check fees, account maintenance charges

***

## Expense Information

Each expense record includes:

### Required Fields

**Amount**:

* How much was spent (minimum 0.01)
* Must match organization's currency decimal places
* Validates against monetary policy

**Title**:

* Short description of what was purchased
* Example: "Office rent - June 2026", "Stationery supplies", "Treasurer stipend"
* Required, non-empty string

**Date**:

* When the expense occurred (ISO date format)
* Can be historical (past dates allowed)
* Cannot be in closed accounting period
* Cannot exceed current date

### Optional Fields

**Description**:

* Detailed explanation of the expense
* Purpose, justification, or additional context
* Example: "Monthly rent for office space at Kimihurura, Period: June 2026"

**Bank Account**:

* Which account paid the expense
* Falls back to default account if not specified
* Must be active account

**Documents**:

* Supporting receipts, invoices, or reference documents
* Stored as JSON array of DocumentItemDto
* Includes document type, URL, and metadata

**Reserve Allocation**:

* For reserve-funded expenses only
* Selects which reserve fund to draw from
* Must have sufficient reserve balance

**Bank Charge Amount**:

* Additional bank service charge (optional)
* Automatically creates linked BANK\_CHARGE entry
* Included in total reserve release if reserve-funded

**Skip Negative Balance Check**:

* Advanced option to allow negative balances
* Requires special permission
* Use only for opening balance adjustments

### Automatically Generated

**Expense ID**: Unique identifier (UUID)

**Journal Entry ID**: Links to accounting entry

**Organization ID**: Scope to organization

**Created At**: Timestamp of creation

**Parent IDs**: Links to parent expense/asset/loan (for bank charges)

## Common Expense Categories

Most tontines track these types of expenses:

| Category                  | Examples                                              | Typical Amount |
| ------------------------- | ----------------------------------------------------- | -------------- |
| **Operating Expenses**    | Rent, utilities, internet, phone                      | Medium to High |
| **Salaries & Wages**      | Treasurer pay, accountant fees, staff salaries        | High           |
| **Office Supplies**       | Paper, pens, ledgers, printer ink                     | Low            |
| **Bank Charges**          | Account maintenance fees, transaction fees, wire fees | Low            |
| **Meeting Expenses**      | Room rental, refreshments, member gatherings          | Medium         |
| **Transportation**        | Treasurer travel, bank trips, member visits           | Low to Medium  |
| **Professional Services** | Audit fees, legal consultation, training, software    | Medium to High |
| **Communication**         | SMS notifications, printing, postage                  | Low            |
| **Technology**            | Software subscriptions, computer equipment            | Medium         |
| **Maintenance & Repairs** | Office repairs, equipment maintenance                 | Medium         |
| **Insurance**             | Office insurance, liability coverage                  | Medium         |
| **Other**                 | Miscellaneous expenses                                | Varies         |

<Note>
  **Category best practices:**

  * Use consistent category names across all expenses
  * Create organization-specific categories as needed
  * Don't include loan disbursements, dividends, or asset purchases as expenses
  * Separate capital expenditures (buy assets) from operational expenses
</Note>

[Learn more about expense categories →](/tontines/expenses/expense-categories)

## What's NOT an Expense?

These operations are **not expenses** and should be tracked separately:

❌ **Loan Disbursements**: Track as loans, not expenses
❌ **Dividend Distributions**: Track as dividends, not expenses
❌ **Member Savings Withdrawals**: Track as savings withdrawals
❌ **Reserve Allocations**: Track as reserve top-ups (separate feature)
❌ **Asset Purchases**: Track as fixed assets
❌ **Bank Transfers**: Move money between accounts (internal, not expense)
❌ **Opening Balance Adjustments**: Use dedicated adjustment feature

## Expense Operations

### What You Can Do

<CardGroup cols={2}>
  <Card title="Record Expenses" icon="plus" href="/tontines/expenses/recording-expenses">
    Create new expense entries
  </Card>

  <Card title="View History" icon="clock-rotate-left" href="/tontines/expenses/viewing-expense-history">
    Browse and search past expenses
  </Card>

  <Card title="Edit Expenses" icon="pen-to-square" href="/tontines/expenses/recording-expenses#editing-expenses">
    Update expense details
  </Card>

  <Card title="Delete Expenses" icon="trash" href="/tontines/expenses/recording-expenses#deleting-expenses">
    Remove expense entries
  </Card>
</CardGroup>

### How Editing Works

**Reverse-and-Repost Pattern**:

* System doesn't modify existing entries
* Instead, reverses old entry and creates new one
* Maintains complete audit trail
* All linked entries (bank charges, reserve releases) also reversed and recreated

**What you can change**:

* Amount
* Title
* Description
* Date
* Bank account
* Reserve allocation
* Bank charge amount

**Constraints**:

* Cannot edit expenses in closed accounting periods
* Cannot edit reversed expenses
* Must have `expenses:write` permission

### How Deletion Works

**Reversal Process**:

* Reverses main expense entry
* Reverses all linked bank charges
* Reverses linked reserve release (if reserve-funded)
* Updates bank account balances back to original state

**Constraints**:

* Cannot delete expenses in closed accounting periods
* May create negative balance (check before deleting)
* Requires `expenses:write` permission

## Integration with Other Features

### Bank Accounts

Expenses **decrease bank account balances** through CASH ledger credits.

**How it works**:

1. You select which bank account pays the expense
2. System creates journal entry crediting CASH (bank account)
3. Bank account balance decreases automatically
4. Transaction appears in bank account history

**Best practice**: Always select the correct bank account to match where money actually came from.

[Learn about bank accounts →](/tontines/bank-accounts/overview)

***

### Reserves

**Reserve-funded expenses** draw from designated reserve allocations.

**How it works**:

1. Select reserve allocation when recording expense
2. System releases funds from reserve (Dr CASH, Cr RESERVE\_ALLOCATION)
3. System records expense (Dr EXPENSE, Cr CASH)
4. Reserve balance decreases, expense recorded, bank unchanged

**Benefits**:

* Track which expenses came from reserves
* Prevent overspending reserve allocations
* Better reserve fund reporting
* Separate restricted from unrestricted spending

**Example use cases**:

* Emergency equipment repair from Emergency Fund
* Audit fees from Statutory Reserve
* Training expenses from Development Fund

[Learn about reserves →](/tontines/reserves/overview)

***

### Financial Reports

Expenses appear on **Profit & Loss (Income Statement)**.

**Impact on P\&L**:

```
Revenue:
  Interest Income                 500,000
  Entry Fees                       50,000
Total Revenue:                    550,000

Expenses:
  Operating Expenses             (200,000)
  Salaries                       (100,000)
  Bank Charges                    (10,000)
  Professional Services           (50,000)
Total Expenses:                  (360,000)

Net Income:                       190,000
```

**What this means**:

* Higher expenses = lower net income
* Net income affects dividends available
* Expense trends show operational efficiency

[Learn about P\&L reports →](/tontines/reports/profit-and-loss)

***

### General Ledger

All expenses create **journal entries** in the general ledger.

**Every expense**:

* Creates at least one journal entry (may create 2-3 if reserve-funded with bank charge)
* Debits OPERATING\_EXPENSE or BANK\_CHARGE\_EXPENSE
* Credits CASH (bank account)
* Maintains balanced double-entry accounting

**Audit trail**:

* Every entry records who, when, what, why
* Reversals are tracked separately (not deleted)
* Complete history maintained permanently

[Learn about the general ledger →](/tontines/general-ledger/overview)

## Validation and Constraints

### Input Validation

**Amount**:

* ✅ Must be at least 0.01
* ✅ Must match organization's currency decimal places (e.g., 2 decimals for RWF)
* ❌ Cannot be negative
* ❌ Cannot be zero

**Title**:

* ✅ Must be non-empty string
* ❌ Cannot be blank

**Date**:

* ✅ Must be valid ISO date
* ✅ Can be historical (past dates)
* ❌ Cannot be in closed accounting period
* ❌ Cannot exceed current date

**Bank Account**:

* ✅ Must be active account
* ✅ Falls back to default if not specified
* ❌ Cannot use inactive accounts

**Reserve Allocation** (if provided):

* ✅ Must exist and be active
* ✅ Must have sufficient balance
* ❌ Cannot exceed reserve balance

### Business Logic Validation

**Balance Checks**:

* System verifies bank account won't go negative (unless explicitly skipped)
* Checks reserve balance before releasing funds
* Validates total amount against available cash

**Accounting Period**:

* Cannot create expense in closed period
* Cannot edit expense in closed period
* Cannot delete expense in closed period

**Idempotency**:

* All operations require idempotency key
* Prevents duplicate entries from retries
* Safe for network failures and refreshes

## Permissions Required

| Action                 | Permission       | Scope |
| ---------------------- | ---------------- | ----- |
| View expenses          | `expenses:read`  | ANY   |
| Create expense         | `expenses:write` | ANY   |
| Edit expense           | `expenses:write` | ANY   |
| Delete expense         | `expenses:write` | ANY   |
| View financial reports | `reports:read`   | ANY   |

<Note>
  **Typical roles**: Accountants and Administrators usually have `expenses:write`. Regular members typically have `expenses:read` (view only) or no access.
</Note>

## Best Practices

<Note>
  **Expense management tips:**

  * Record expenses promptly (same day or within a week)
  * Keep physical receipts and upload as documents
  * Use clear, consistent titles (include month/period)
  * Add detailed descriptions for large or unusual expenses
  * Always select the correct bank account
  * Use reserve-funded expenses for emergency/planned spending from reserves
  * Separate bank charges from main expenses (use bank charge field)
  * Review expense reports monthly
  * Set spending limits and get approval for large purchases
  * Don't use expenses for loan disbursements or asset purchases
  * Reconcile bank statements to catch missing expenses
  * Close accounting periods regularly to lock historical data
</Note>

## Common Scenarios

### Scenario 1: Regular Monthly Rent

```
Amount: 50,000 RWF
Title: "Office Rent - June 2026"
Date: 2026-06-01
Bank Account: Operations Current Account
Description: "Monthly office space rental at Kimihurura"

Result:
Dr OPERATING_EXPENSE (Rent)     50,000
   Cr CASH (Operations)         50,000

Bank Balance: Decreased by 50,000 RWF
```

***

### Scenario 2: Bank Wire Transfer with Fee

```
Amount: 200,000 RWF
Title: "Payment to Supplier XYZ"
Date: 2026-06-05
Bank Account: Operations Current Account
Bank Charge Amount: 3,000 RWF
Description: "Purchase order #123 - Office supplies"

Result (2 entries):
Entry 1:
Dr OPERATING_EXPENSE (Supplies)  200,000
   Cr CASH (Operations)          200,000

Entry 2 (Auto-linked):
Dr BANK_CHARGE_EXPENSE  3,000
   Cr CASH (Operations)  3,000

Total Bank Decrease: 203,000 RWF
```

***

### Scenario 3: Emergency Repair from Reserve

```
Amount: 100,000 RWF
Title: "Equipment Repair - Emergency"
Date: 2026-06-10
Reserve Allocation: Emergency Fund
Bank Account: Operations Current Account
Description: "Broken printer repair - urgent"

Result (2 entries):
Entry 1 - Reserve Release:
Dr CASH (Operations)                100,000
   Cr RESERVE_ALLOCATION (Emergency)  100,000

Entry 2 - Expense:
Dr OPERATING_EXPENSE (Repairs)  100,000
   Cr CASH (Operations)         100,000

Reserve Balance: Decreased by 100,000 RWF
Bank Balance: Unchanged (released then spent)
```

## Getting Started

<CardGroup cols={2}>
  <Card title="Record Your First Expense" icon="rocket" href="/tontines/expenses/recording-expenses">
    Step-by-step expense recording guide
  </Card>

  <Card title="Expense Categories" icon="tags" href="/tontines/expenses/expense-categories">
    Organize spending by category
  </Card>

  <Card title="View Expense History" icon="list" href="/tontines/expenses/viewing-expense-history">
    Browse and analyze past spending
  </Card>

  <Card title="Profit & Loss Report" icon="chart-bar" href="/tontines/reports/profit-and-loss">
    See expense impact on profitability
  </Card>
</CardGroup>
