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

# Reports Overview

> Generate financial reports, analytics, and member statements for management, compliance, and decision-making

## What are Reports?

Agatabo provides comprehensive reporting capabilities for financial analysis, management oversight, regulatory compliance, and member communication. All reports are generated from the general ledger and reflect real-time data.

<Note>
  **Permission required**: `reports:read` to access all reports

  Reports are generated on-demand from posted journal entries and ledger account balances. Draft entries are not included in reports.
</Note>

***

## Available Reports

### Financial Statements

<CardGroup cols={2}>
  <Card title="Balance Sheet" icon="scale-balanced" href="/tontines/reports/balance-sheet">
    Assets, Liabilities, and Equity at a point in time
  </Card>

  <Card title="Profit & Loss" icon="chart-line" href="/tontines/reports/profit-and-loss">
    Income and Expenses over a period
  </Card>
</CardGroup>

### Analysis Reports

<CardGroup cols={2}>
  <Card title="Organization Analytics" icon="chart-bar" href="/tontines/reports/analytics">
    Key metrics and performance indicators
  </Card>

  <Card title="Loans Outstanding" icon="money-bill-trend-up" href="/tontines/reports/loans-outstanding">
    Portfolio summary and loan details
  </Card>

  <Card title="Shares Report" icon="users" href="/tontines/reports/shares-report">
    Member ownership distribution
  </Card>
</CardGroup>

### Member Reports

<CardGroup cols={2}>
  <Card title="Member Statements" icon="file-invoice" href="/tontines/reports/member-statements">
    Individual account activity and balances
  </Card>
</CardGroup>

***

## API Endpoints

### Balance Sheet

**Get organization's balance sheet:**

```http theme={null}
GET /reports/balance-sheet?asOfDate={date}
Headers:
  x-organization-id: {organizationId}
```

**Query parameters:**

| Parameter  | Type              | Required | Description                                                |
| ---------- | ----------------- | -------- | ---------------------------------------------------------- |
| `asOfDate` | string (ISO date) | No       | Snapshot date for balance sheet. Defaults to current date. |

**Response:** Assets, Liabilities, and Equity accounts with balances.

[View complete documentation →](/tontines/reports/balance-sheet)

***

### Profit & Loss

**Get profit and loss statement:**

```http theme={null}
GET /reports/profit-loss?startDate={date}&endDate={date}
Headers:
  x-organization-id: {organizationId}
```

**Query parameters:**

| Parameter   | Type              | Required | Description       |
| ----------- | ----------------- | -------- | ----------------- |
| `startDate` | string (ISO date) | No       | Period start date |
| `endDate`   | string (ISO date) | No       | Period end date   |

**Response:** Income and Expense accounts with totals and net income/loss.

[View complete documentation →](/tontines/reports/profit-and-loss)

***

### Organization Analytics

**Get key performance metrics:**

```http theme={null}
GET /reports/analytics?startDate={date}&endDate={date}
Headers:
  x-organization-id: {organizationId}
```

**Query parameters:**

| Parameter   | Type              | Required | Description           |
| ----------- | ----------------- | -------- | --------------------- |
| `startDate` | string (ISO date) | No       | Analysis period start |
| `endDate`   | string (ISO date) | No       | Analysis period end   |

**Response:** Organization-wide metrics including member count, total deposits, total loans, portfolio health, etc.

[View complete documentation →](/tontines/reports/analytics)

***

### Loans Outstanding

**Get loans portfolio summary:**

```http theme={null}
GET /reports/loans-outstanding?expectedDate={date}
Headers:
  x-organization-id: {organizationId}
```

**Query parameters:**

| Parameter      | Type              | Required | Description                                     |
| -------------- | ----------------- | -------- | ----------------------------------------------- |
| `expectedDate` | string (ISO date) | No       | Expected repayment date for arrears calculation |

**Response:** Loan portfolio details including outstanding principal, interest, arrears, and individual loan summaries.

[View complete documentation →](/tontines/reports/loans-outstanding)

***

### Shares Report

**Get member ownership distribution:**

```http theme={null}
GET /reports/shares-report?asOfDate={date}
Headers:
  x-organization-id: {organizationId}
```

**Query parameters:**

| Parameter  | Type              | Required | Description                          |
| ---------- | ----------------- | -------- | ------------------------------------ |
| `asOfDate` | string (ISO date) | No       | Snapshot date for shares calculation |

**Response:** Member savings balances and ownership percentages.

[View complete documentation →](/tontines/reports/shares-report)

***

### Member Statements

**Get ledger account statements (for member accounts):**

```http theme={null}
POST /ledger-accounts/statements
Headers:
  x-organization-id: {organizationId}
Body:
{
  "accountIds": ["acc-123", "acc-456"],
  "from": "2026-01-01",
  "to": "2026-06-30",
  "option": "period",
  "excludeZeroTransactionAccounts": false
}
```

**Request body:**

| Field                            | Type              | Required | Description                                                 |
| -------------------------------- | ----------------- | -------- | ----------------------------------------------------------- |
| `accountIds`                     | string\[]         | Yes      | Array of ledger account IDs (e.g., member SAVINGS accounts) |
| `from`                           | string (ISO date) | Yes      | Statement period start                                      |
| `to`                             | string (ISO date) | Yes      | Statement period end                                        |
| `option`                         | enum              | Yes      | Statement option: 'all', 'current', 'period', 'custom'      |
| `excludeZeroTransactionAccounts` | boolean           | No       | Exclude accounts with no transactions in period             |

**Response:** Detailed transaction history for each account with opening balance, transactions, and closing balance.

[View complete documentation →](/tontines/reports/member-statements)

***

## Report Types

### Financial Statements

**Standard accounting reports for compliance and management:**

**Balance Sheet (Statement of Financial Position):**

* Assets = Liabilities + Equity
* Snapshot at a specific date
* Shows financial position
* Used for: Board reports, audits, regulatory filing

**Profit & Loss (Income Statement):**

* Income - Expenses = Net Income
* Performance over a period
* Shows operational results
* Used for: Monthly reports, performance tracking, tax filing

**Key characteristics:**

* ✅ Based on double-entry accounting
* ✅ Generated from ledger account balances
* ✅ Comply with accounting standards (GAAP, IFRS)
* ✅ Required for external audits

***

### Analysis Reports

**Performance metrics and portfolio analysis:**

**Organization Analytics:**

* Member growth trends
* Deposit and loan volumes
* Portfolio health indicators
* Key performance metrics (KPIs)

**Loans Outstanding:**

* Total principal outstanding
* Interest and penalties receivable
* Arrears aging analysis
* Individual loan details

**Shares Report:**

* Member savings distribution
* Ownership percentages
* Equity allocation by member
* Dividend distribution basis

**Key characteristics:**

* ✅ Real-time data from ledger
* ✅ Customizable date ranges
* ✅ Support decision-making
* ✅ Track organizational health

***

### Member Reports

**Individual and aggregate member information:**

**Member Statements:**

* Savings account activity
* Deposits and withdrawals
* Dividend allocations
* Loan payments
* Opening and closing balances

**Purpose:**

* ✅ Member communication
* ✅ Quarterly/annual statements
* ✅ Account reconciliation
* ✅ Transparency and trust

***

## Generating Reports

<Steps>
  <Step title="Navigate to Reports">
    Click **Reports** in sidebar or use API endpoint directly
  </Step>

  <Step title="Select report type">
    Choose from:

    * Balance Sheet
    * Profit & Loss
    * Analytics
    * Loans Outstanding
    * Shares Report
    * Member Statements
  </Step>

  <Step title="Set parameters">
    **Date parameters:**

    * Balance Sheet: asOfDate (defaults to today)
    * Profit & Loss: startDate and endDate (period)
    * Analytics: startDate and endDate (period)
    * Loans Outstanding: expectedDate (for arrears)
    * Shares Report: asOfDate (defaults to today)
    * Member Statements: from and to dates (period)

    **Filters:**

    * Member Statements: accountIds array
    * Loans Outstanding: expectedDate for arrears calculation
  </Step>

  <Step title="Generate report">
    Click **Generate** or call API endpoint
  </Step>

  <Step title="Export (optional)">
    Download as PDF, Excel, or CSV (if supported by UI)
  </Step>
</Steps>

***

## Common Use Cases

### Monthly Board Reports

**Package for monthly board meeting:**

* Balance Sheet (as of last day of month)
* Profit & Loss (for the month)
* Loans Outstanding (current status)
* Organization Analytics (monthly performance)

**API calls:**

```http theme={null}
GET /reports/balance-sheet?asOfDate=2026-06-30
GET /reports/profit-loss?startDate=2026-06-01&endDate=2026-06-30
GET /reports/loans-outstanding
GET /reports/analytics?startDate=2026-06-01&endDate=2026-06-30
```

***

### Quarterly Member Statements

**Generate statements for all members:**

1. Get all member SAVINGS account IDs
2. Call POST /ledger-accounts/statements with:
   * accountIds: \[all member SAVINGS account IDs]
   * from: Start of quarter
   * to: End of quarter
   * option: 'period'

**Distributes:**

* Opening balance
* All deposits and withdrawals
* Dividend allocations
* Closing balance

***

### Audit Preparation

**Package for external auditors:**

* Balance Sheet (as of fiscal year-end)
* Profit & Loss (full fiscal year)
* Ledger account statements (all accounts)
* Journal entries (all for year)
* Shares Report (member ownership)

**API calls:**

```http theme={null}
GET /reports/balance-sheet?asOfDate=2025-12-31
GET /reports/profit-loss?startDate=2025-01-01&endDate=2025-12-31
GET /reports/shares-report?asOfDate=2025-12-31
GET /ledger-accounts/journal-search?from=2025-01-01&to=2025-12-31
POST /ledger-accounts/statements (for all accounts)
```

***

### Year-End Tax Compliance

**Annual financial statements for tax filing:**

* Balance Sheet (as of Dec 31)
* Profit & Loss (full year)
* Documentation of income and expenses

**API calls:**

```http theme={null}
GET /reports/balance-sheet?asOfDate=2025-12-31
GET /reports/profit-loss?startDate=2025-01-01&endDate=2025-12-31
```

***

### Performance Monitoring

**Track organizational health:**

* Monthly analytics reports
* Loan portfolio trends
* Member growth tracking
* Income/expense ratios

**API calls:**

```http theme={null}
GET /reports/analytics?startDate=2026-01-01&endDate=2026-06-30
GET /reports/loans-outstanding
GET /reports/shares-report
```

***

## Report Data Sources

**All reports are generated from:**

**Ledger Accounts:**

* Account balances (current or historical)
* Account types and roles
* Scope keys (organization, member, loan, reserve)

**Journal Entries:**

* Posted transactions only (DRAFT entries excluded)
* Transaction dates within report period
* Debit and credit lines
* Journal entry kinds and metadata

**Member Data:**

* Organization user records
* Member status (active/inactive)
* Member registration dates

**Loan Data:**

* Loan principal and terms
* Payment schedules
* Arrears calculations
* Interest and penalties

***

## Best Practices

<Note>
  **Report generation best practices:**

  **Timing:**

  * ✅ Generate Balance Sheet at month-end after all transactions posted
  * ✅ Run Profit & Loss after period close for accurate results
  * ✅ Generate member statements quarterly or annually
  * ✅ Review analytics monthly for performance tracking

  **Accuracy:**

  * ✅ Ensure all transactions are posted before generating reports
  * ✅ Verify no draft entries pending
  * ✅ Close accounting periods before finalizing year-end reports
  * ✅ Cross-check report totals with ledger account balances

  **Distribution:**

  * ✅ Board reports: Balance Sheet + Profit & Loss + Analytics
  * ✅ Member statements: Quarterly or annual with cover letter
  * ✅ Regulatory reports: As required by law (annual financial statements)
  * ✅ Audit reports: Complete package with supporting schedules

  **Documentation:**

  * ✅ Keep copies of all distributed reports
  * ✅ Archive year-end reports permanently
  * ✅ Document report parameters (dates, filters used)
  * ✅ Note any adjustments or corrections made

  **Export:**

  * ✅ Export to PDF for official distribution
  * ✅ Export to Excel for analysis and formatting
  * ✅ Export to CSV for data processing
  * ✅ Include organization header and date on all reports
</Note>

***

## Report Permissions

**All reports require `reports:read` permission:**

```typescript theme={null}
Permission: 'reports:read'
Scope: 'ANY' (organization-level permission)
```

**Users with this permission can:**

* ✅ Generate all financial reports
* ✅ View balance sheet and profit & loss
* ✅ Access analytics and performance metrics
* ✅ Generate member statements
* ✅ Export reports to various formats

**Users without this permission:**

* ❌ Cannot access /reports endpoints
* ❌ Cannot generate financial statements
* ❌ Cannot view organization-wide analytics

**Typical roles with reports:read:**

* Administrator (full access)
* Accountant (full access)
* Treasurer (full access)
* Board Member (read-only access)

***

## Related Topics

<CardGroup cols={2}>
  <Card title="General Ledger" icon="book" href="/tontines/general-ledger/overview">
    Accounting foundation for all reports
  </Card>

  <Card title="Journal Entries" icon="book-open" href="/tontines/general-ledger/viewing-journal-entries">
    View transactions behind reports
  </Card>

  <Card title="Accounting Periods" icon="calendar" href="/tontines/concepts/accounting-periods">
    Period closing for accurate reports
  </Card>

  <Card title="Understanding Double-Entry" icon="scale-balanced" href="/tontines/general-ledger/understanding-double-entry">
    Accounting principles for reports
  </Card>
</CardGroup>
