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

# Viewing Expense History

> Review and analyze past organizational spending with pagination, filtering, and sorting

## Overview

The expense history page shows all recorded expenses, allowing you to review spending, identify trends, verify transactions, and analyze patterns. You can filter by date range, search by title, and sort by various fields.

## Accessing Expense History

<Steps>
  <Step title="Navigate to Expenses">
    Click **Expenses** in the sidebar
  </Step>

  <Step title="View expense list">
    All expenses displayed with pagination
  </Step>

  <Step title="Use controls">
    Filter, search, and sort as needed
  </Step>
</Steps>

## Expense List Display

Each expense in the list shows:

| Field            | Description                                 | Source                                  |
| ---------------- | ------------------------------------------- | --------------------------------------- |
| **Title**        | Expense description/name                    | Free-form text (use for categorization) |
| **Amount**       | How much was spent                          | From journal entry                      |
| **Date**         | When the expense occurred                   | Transaction date                        |
| **Description**  | Additional details                          | Optional field                          |
| **Bank Account** | Which account paid (if shown)               | From CASH ledger line                   |
| **Reserve**      | Reserve allocation (if funded from reserve) | Reserve-funded expenses only            |
| **Bank Charge**  | Linked bank charge (if any)                 | Separate linked entry                   |

<Note>
  **No "Category" column**: Agatabo doesn't have a built-in category field. Categories are implemented through consistent title naming patterns (e.g., "Operating Expenses - Rent", "Salaries - Treasurer").
</Note>

## Pagination

Expenses are displayed in pages to improve performance:

**Default settings**:

* **Page size**: 10 expenses per page
* **Default sort**: Newest first (by date, descending)

**Navigation**:

* Use page numbers or next/previous buttons
* Jump to specific page
* Change items per page (typically 10, 25, 50, or 100)

**Total information**:

* Total count of expenses
* Total pages
* Current page number

## Filtering Expenses

### By Date Range

Filter expenses to a specific time period using start and end dates:

<Steps>
  <Step title="Set start date (optional)">
    Expenses on or after this date
  </Step>

  <Step title="Set end date (optional)">
    Expenses on or before this date
  </Step>

  <Step title="Apply filter">
    List updates to show only expenses in range
  </Step>
</Steps>

**Common date ranges** (implemented in frontend):

* Today
* This Week
* This Month
* Last Month
* This Quarter
* This Year
* Custom Range

**Example filters**:

```
Start Date: 2026-06-01
End Date: 2026-06-30
Result: All June 2026 expenses

Start Date: 2026-01-01
End Date: (empty)
Result: All expenses from Jan 1, 2026 onwards

Start Date: (empty)
End Date: 2026-05-31
Result: All expenses up to May 31, 2026
```

### By Title (Search)

Search for expenses by title using text search:

<Steps>
  <Step title="Enter search term">
    Type keyword or phrase in search box
  </Step>

  <Step title="Search executes">
    Case-insensitive partial match on title field
  </Step>

  <Step title="Results update">
    Only matching expenses shown
  </Step>
</Steps>

**Search is case-insensitive and matches partial titles**:

**Examples**:

```
Search: "rent"
Matches:
- "Operating Expenses - Office Rent - June 2026"
- "Operating Expenses - Office Rent - May 2026"
- "Rent payment"

Search: "salaries"
Matches:
- "Salaries - Treasurer Stipend"
- "Salaries - Accountant Fee"
- "Staff Salaries - June"

Search: "bank charges"
Matches:
- "Bank Charges - Wire Transfer"
- "Bank Charges - Account Maintenance"
```

<Note>
  **Using search for categories**: Since categories are in the title, you can search by category prefix. Search "Operating Expenses" to see all expenses with that category in the title.
</Note>

## Sorting Expenses

Click column headers or use sort controls to reorder the list:

**Available sort fields**:

* **Title**: Alphabetical order (A-Z or Z-A)
* **Amount**: Smallest to largest or largest to smallest
* **Date**: Oldest to newest or newest to oldest
* **Created At**: When expense was recorded in system

**Sort order**:

* **Ascending (asc)**: Low to high, A to Z, oldest to newest
* **Descending (desc)**: High to low, Z to A, newest to oldest

**Default**: Date descending (newest expenses first)

### Sorting Examples

**Sort by Title (ascending)**:

```
Results appear alphabetically:
- "Bank Charges - Account Fee"
- "Bank Charges - Wire Transfer"
- "Meeting Expenses - Refreshments"
- "Operating Expenses - Electricity"
- "Operating Expenses - Rent"
- "Salaries - Treasurer"
```

**Benefit**: Groups expenses with same category prefix together

***

**Sort by Amount (descending)**:

```
Results appear largest to smallest:
- 500,000 RWF - "Annual Audit Fee"
- 200,000 RWF - "Equipment Purchase"
- 150,000 RWF - "Office Rent"
- 50,000 RWF - "Treasurer Stipend"
- 15,000 RWF - "Office Supplies"
```

**Benefit**: Identify largest expenses quickly

***

**Sort by Date (descending)**:

```
Results appear newest to oldest:
- 2026-06-15 - Recent expense
- 2026-06-10 - Last week
- 2026-06-01 - Beginning of month
- 2026-05-28 - Previous month
```

**Benefit**: See most recent spending first (default)

## Combining Filters and Sorting

You can combine multiple filters and sorting for powerful analysis:

### Example 1: June Operating Expenses by Amount

```
Filters:
- Start Date: 2026-06-01
- End Date: 2026-06-30
- Search: "Operating Expenses"

Sort:
- Sort By: Amount
- Order: Descending

Result: All June operating expenses, largest first
```

### Example 2: Recent Salary Payments

```
Filters:
- Start Date: 2026-01-01
- End Date: (empty)
- Search: "Salaries"

Sort:
- Sort By: Date
- Order: Descending

Result: All salary payments from this year, newest first
```

### Example 3: All Bank Charges Alphabetically

```
Filters:
- Search: "Bank Charges"

Sort:
- Sort By: Title
- Order: Ascending

Result: All bank charges grouped by title
```

## Viewing Expense Details

Click on an expense to see full details:

**Detailed view shows**:

* Complete title and description
* Exact amount
* Transaction date
* Bank account used
* Reserve allocation (if reserve-funded)
* Linked bank charge (if any)
* Documents/receipts attached
* Who recorded the expense
* When it was recorded
* Journal entry information
* Edit and delete options (if permitted)

**From detail view you can**:

* Edit expense details
* Delete expense
* View/download attached documents
* See related journal entries
* Access bank account details

## What Expenses Are Shown

The expense list includes:

**Included**:

* ✅ Standard expenses (EXPENSE\_PAYMENT kind)
* ✅ Reserve-funded expenses (RESERVE\_EXPENSE kind)
* ✅ Posted (active) expenses only

**Excluded**:

* ❌ Bank charges (shown as linked to parent expense, not standalone)
* ❌ Reversed/deleted expenses
* ❌ Loan disbursements (not expenses)
* ❌ Dividend distributions (not expenses)
* ❌ Savings withdrawals (not expenses)

<Note>
  **Bank charges**: Separate BANK\_CHARGE journal entries are linked to their parent expense and shown within the parent's details, not as standalone items in the expense list.
</Note>

## Common Use Cases

### Monthly Expense Review

**Goal**: Review current month's spending

<Steps>
  <Step title="Set date filter">
    Start Date: First day of month (e.g., 2026-06-01)
    End Date: Last day of month (e.g., 2026-06-30)
  </Step>

  <Step title="Sort by title">
    Groups expenses by category prefix
  </Step>

  <Step title="Review each category">
    Check amounts against budget
  </Step>

  <Step title="Identify unusual expenses">
    Look for unexpected or large amounts
  </Step>
</Steps>

***

### Find Specific Expense

**Goal**: Locate a particular expense by description

<Steps>
  <Step title="Use search">
    Enter keyword from title or description
  </Step>

  <Step title="Add date filter if needed">
    Narrow down if you remember approximate date
  </Step>

  <Step title="Scan results">
    Find matching expense
  </Step>

  <Step title="Click to view details">
    See full information
  </Step>
</Steps>

**Example**:

```
Looking for: Audit fee payment from April

Search: "audit"
Start Date: 2026-04-01
End Date: 2026-04-30

Result: "Professional Services - Annual Audit Fee"
```

***

### Category Analysis

**Goal**: See all expenses in a specific category

<Steps>
  <Step title="Search by category prefix">
    Enter category name (e.g., "Salaries", "Operating Expenses")
  </Step>

  <Step title="Optional date filter">
    Limit to specific period
  </Step>

  <Step title="Sort by date or amount">
    Depending on what you want to analyze
  </Step>

  <Step title="Review results">
    Calculate totals, identify patterns
  </Step>
</Steps>

**Example**:

```
Analyze salary expenses for the year:

Search: "Salaries"
Start Date: 2026-01-01
End Date: 2026-12-31
Sort By: Date
Order: Ascending

Result: All salary payments chronologically
Manual calculation: Sum all amounts for yearly total
```

***

### Prepare for Audit

**Goal**: Generate complete expense list for auditor

<Steps>
  <Step title="Set audit period">
    Use date range for fiscal year or audit period
  </Step>

  <Step title="Remove search filter">
    Show all expense types
  </Step>

  <Step title="Sort by date">
    Chronological order (ascending)
  </Step>

  <Step title="Review for completeness">
    * Ensure all expenses have descriptions
    * Check for missing receipts/documents
    * Verify amounts are reasonable
  </Step>

  <Step title="Note any follow-up needed">
    Missing documentation, unclear expenses
  </Step>
</Steps>

<Note>
  **Export capability**: Check if your implementation supports exporting expense data to Excel/CSV. If not, you may need to manually compile the list or use the Profit & Loss report.
</Note>

***

### Compare Month-to-Month

**Goal**: Compare spending across months

<Steps>
  <Step title="Filter to first month">
    Example: June 2026
  </Step>

  <Step title="Search by category">
    Example: "Operating Expenses"
  </Step>

  <Step title="Note total amount">
    Manually sum or use calculator
  </Step>

  <Step title="Change date filter to second month">
    Example: July 2026
  </Step>

  <Step title="Compare totals">
    Identify increases or decreases
  </Step>
</Steps>

## Limitations and Workarounds

### No Amount Range Filter

**Backend doesn't support**: Minimum/maximum amount filtering

**Workaround**:

1. Retrieve all expenses for period
2. Sort by amount
3. Manually scan for desired range
4. Or export and use spreadsheet filters

***

### No Category Filter

**Backend doesn't support**: Dedicated category dropdown filter

**Workaround**:

* Use title search with category prefix (e.g., search "Salaries")
* Sort by title to group categories together
* Consistent naming makes this effective

***

### No Export Function

**Backend doesn't support**: Direct export to Excel/CSV (at API level)

**Workarounds**:

* Check if frontend implements export
* Use Profit & Loss report (includes expense breakdown)
* Manual data entry from expense list
* Copy-paste into spreadsheet

***

### No Bank Account Filter

**Backend doesn't support**: Filter by which bank account paid

**Workaround**:

* View bank account transaction history instead
* Review all expenses and note bank account manually
* Use bank reconciliation reports

***

### Maximum 100 Per Page

**Backend limitation**: Maximum 100 expenses per page request

**Workaround**:

* Use date filters to narrow results
* Navigate through multiple pages
* Use search to reduce results

## Best Practices

<Note>
  **Expense review tips:**

  **Regular reviews:**

  * Review expenses weekly for recent period
  * Monthly review of entire month
  * Quarterly and annual reviews for trends

  **Search effectively:**

  * Use category prefixes in search (benefit of consistent naming)
  * Combine search with date filters
  * Try different keywords if first search doesn't work

  **Sorting strategies:**

  * Sort by title to group categories
  * Sort by amount to find largest expenses
  * Sort by date for chronological review

  **Verification:**

  * Compare expense list to bank statements
  * Check for missing expenses (gaps in dates)
  * Verify large or unusual amounts
  * Ensure all expenses have adequate descriptions

  **Documentation:**

  * Click through to verify documents are attached
  * Note any missing receipts for follow-up
  * Ensure descriptions are clear enough for audit

  **Analysis:**

  * Look for spending patterns
  * Identify categories with consistent overspending
  * Notice seasonal variations
  * Track recurring expenses (are amounts consistent?)
</Note>

## Permissions Required

| Action               | Permission       | Scope |
| -------------------- | ---------------- | ----- |
| View expense list    | `expenses:read`  | ANY   |
| View expense details | `expenses:read`  | ANY   |
| Edit expense         | `expenses:write` | ANY   |
| Delete expense       | `expenses:write` | ANY   |

<Note>
  **Typical access**: Most members have `expenses:read` to review organizational spending. Only Accountants and Administrators typically have `expenses:write` for editing.
</Note>

## Related Topics

<CardGroup cols={2}>
  <Card title="Recording Expenses" icon="plus" href="/tontines/expenses/recording-expenses">
    Add new expenses to the system
  </Card>

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

  <Card title="Expenses Overview" icon="receipt" href="/tontines/expenses/overview">
    Understand expense types and features
  </Card>

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