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

# Understanding Double-Entry Accounting

> Learn the accounting principles behind Agatabo's financial system

## What is Double-Entry Accounting?

**Double-entry accounting** is a method where every financial transaction affects at least two accounts: one is debited, and another is credited. The total debits always equal total credits, keeping the accounting equation balanced.

<Note>
  **Key principle**: For every transaction, total debits = total credits. This ensures the books always balance and errors are easily detected.
</Note>

## The Accounting Equation

```
Assets = Liabilities + Equity
```

Every transaction in Agatabo maintains this fundamental balance:

* **Assets**: What the organization owns (cash, loans receivable, fixed assets)
* **Liabilities**: What the organization owes (member savings, payables)
* **Equity**: The organization's net worth (retained earnings, reserves)

**Example:**

```
Cash: 10,000,000 RWF (asset)
Member Savings: 8,000,000 RWF (liability)
Retained Earnings: 2,000,000 RWF (equity)

10,000,000 = 8,000,000 + 2,000,000 ✓ Balanced
```

***

## Debits and Credits

### Basic Rules

| Account Type                                      | Increase | Decrease | Normal Balance |
| ------------------------------------------------- | -------- | -------- | -------------- |
| **Assets** (Cash, Loans Receivable, Fixed Assets) | Debit    | Credit   | Debit          |
| **Liabilities** (Member Savings, Payables)        | Credit   | Debit    | Credit         |
| **Equity** (Retained Earnings, Reserves)          | Credit   | Debit    | Credit         |
| **Income** (Interest Income, Fees)                | Credit   | Debit    | Credit         |
| **Expenses** (Operating Expenses, Salaries)       | Debit    | Credit   | Debit          |

<Note>
  **Memory aid**: **DEALER**

  * **D**ebits increase: **D**ividends (distributions), **E**xpenses, **A**ssets, **L**osses
  * **C**redits increase: **E**quity (except distributions), **A**ccounts payable, **R**evenue (Income)
</Note>

***

## Transaction Examples (from Agatabo)

### Example 1: Member Deposits Cash

**Transaction**: Member Alice deposits 100,000 RWF to her savings account

**Journal entry created:**

| Account                                 | Type      | Debit   | Credit  |
| --------------------------------------- | --------- | ------- | ------- |
| Cash (organization:org123)              | Asset     | 100,000 |         |
| Member Savings (organizationUser:alice) | Liability |         | 100,000 |

**Effect**:

* Organization has more cash (asset increases)
* Organization owes more to Alice (liability increases)
* Accounting equation remains balanced

**Explanation**: The organization receives cash (debit to increase asset) but must return it on demand, so it's a liability (credit to increase liability).

***

### Example 2: Loan Disbursement

**Transaction**: Organization lends 500,000 RWF to member Bob

**Journal entry created:**

| Account                             | Type  | Debit   | Credit  |
| ----------------------------------- | ----- | ------- | ------- |
| Loan Receivable (loan:bob-loan-123) | Asset | 500,000 |         |
| Cash (organization:org123)          | Asset |         | 500,000 |

**Effect**:

* Cash decreases (credit to decrease asset)
* Loan Receivable increases (debit to increase asset)
* Total assets unchanged (one asset traded for another)

**Explanation**: Cash is given to member, but organization gains a loan receivable (right to collect principal + interest in future).

***

### Example 3: Loan Payment with Interest

**Transaction**: Member Bob repays 110,000 RWF (100,000 principal + 10,000 interest)

**Journal entry created:**

| Account                               | Type   | Debit   | Credit  |
| ------------------------------------- | ------ | ------- | ------- |
| Cash (organization:org123)            | Asset  | 110,000 |         |
| Loan Receivable (loan:bob-loan-123)   | Asset  |         | 100,000 |
| Interest Income (organization:org123) | Income |         | 10,000  |

**Effect**:

* Cash increases by 110,000 (debit to increase asset)
* Loan Receivable decreases by 100,000 (credit to decrease asset)
* Interest Income increases by 10,000 (credit to increase income)

**Explanation**: Organization receives cash, reduces the loan receivable, and earns interest income (revenue).

***

### Example 4: Recording an Expense

**Transaction**: Pay 50,000 RWF rent for office space

**Journal entry created:**

| Account                                 | Type    | Debit  | Credit |
| --------------------------------------- | ------- | ------ | ------ |
| Operating Expense (organization:org123) | Expense | 50,000 |        |
| Cash (organization:org123)              | Asset   |        | 50,000 |

**Effect**:

* Cash decreases by 50,000 (credit to decrease asset)
* Expense increases by 50,000 (debit to increase expense, reduces profit)

**Explanation**: Cash is paid out, and expense is recorded. Expenses reduce net income.

***

### Example 5: Dividend Distribution

**Transaction**: Distribute 200,000 RWF dividends to members (50 members × 4,000 RWF each)

**Journal entry created:**

| Account                                 | Type      | Debit   | Credit |
| --------------------------------------- | --------- | ------- | ------ |
| Retained Earnings (organization:org123) | Equity    | 200,000 |        |
| Member Savings (organizationUser:alice) | Liability |         | 4,000  |
| Member Savings (organizationUser:bob)   | Liability |         | 4,000  |
| Member Savings (organizationUser:carol) | Liability |         | 4,000  |
| ... (50 members total)                  | Liability |         | ...    |

**Effect**:

* Retained earnings decreases by 200,000 (debit to decrease equity)
* Each member's savings balance increases (credit to increase liability)
* Total liabilities increase by 200,000

**Explanation**: Dividends distribute accumulated profits (equity) to member savings accounts (liability). Members can withdraw their dividends or leave them to compound.

<Warning>
  **Common misconception**: Dividends in Agatabo credit SAVINGS accounts (liability), NOT a separate "Member Equity" account. Member savings are liabilities because the organization owes these funds to members on demand.
</Warning>

***

### Example 6: Reserve Allocation

**Transaction**: Allocate 1,000,000 RWF from retained earnings to emergency fund reserve

**Journal entry created:**

| Account                                     | Type   | Debit     | Credit    |
| ------------------------------------------- | ------ | --------- | --------- |
| Reserve Allocation (reserve:emergency-fund) | Equity | 1,000,000 |           |
| Retained Earnings (organization:org123)     | Equity |           | 1,000,000 |

**Effect**:

* Reserve balance increases by 1,000,000 (debit to increase equity)
* Retained earnings decreases by 1,000,000 (credit to decrease equity)
* Total equity unchanged (internal transfer within equity)

**Explanation**: Both are equity accounts. This is an internal reclassification of equity from general retained earnings to a designated reserve.

***

### Example 7: Member Withdraws Savings

**Transaction**: Member Alice withdraws 50,000 RWF from her savings

**Journal entry created:**

| Account                                 | Type      | Debit  | Credit |
| --------------------------------------- | --------- | ------ | ------ |
| Member Savings (organizationUser:alice) | Liability | 50,000 |        |
| Cash (organization:org123)              | Asset     |        | 50,000 |

**Effect**:

* Alice's savings balance decreases by 50,000 (debit to decrease liability)
* Cash decreases by 50,000 (credit to decrease asset)
* Both assets and liabilities decrease equally

**Explanation**: Organization pays cash to Alice, reducing its liability (what it owes her) and its cash (asset).

***

## Scope Keys and Per-Entity Accounts

Agatabo uses **scope keys** to create separate accounts for different entities:

**Format:** `{entity_type}:{entity_id}`

**Examples:**

* `organizationUser:alice123` - Alice's personal SAVINGS account
* `organizationUser:bob456` - Bob's personal SAVINGS account
* `loan:loan-789` - Specific loan's LOAN\_RECEIVABLE account
* `reserve:emergency-fund` - Emergency fund RESERVE\_ALLOCATION account
* `organization:org123` - Organization-wide CASH account

**Why this matters:**

* Each member has their own SAVINGS account (all are liabilities, but tracked separately)
* Each loan has its own LOAN\_RECEIVABLE account
* Each reserve has its own RESERVE\_ALLOCATION account
* Enables per-member, per-loan, per-reserve accounting

***

## Why Agatabo Uses Double-Entry

<Note>
  **Benefits:**

  **Accuracy & Error Detection:**

  * Errors are immediately apparent (debits must equal credits)
  * Unbalanced entries are rejected by the system
  * Self-checking mechanism prevents many common mistakes

  **Complete Transaction View:**

  * See both sides of every transaction (what's given and what's received)
  * Understand impact on multiple accounts simultaneously
  * Clear audit trail for every financial event

  **Automated Financial Statements:**

  * Balance Sheet generated from account balances
  * Income Statement from income and expense accounts
  * Cash Flow Statement from account changes

  **Compliance & Audit:**

  * Required for formal financial reporting
  * Meets accounting standards (GAAP, IFRS)
  * Provides complete audit trail
  * Supports external audits and reviews

  **Business Insights:**

  * Track exactly where money comes from and goes to
  * Understand financial health at a glance
  * Make informed decisions based on complete data
  * Monitor profitability, liquidity, and solvency
</Note>

***

## Journal Entries in Agatabo

Every transaction in Agatabo creates a **journal entry** with:

**Components:**

* **Kind**: Type of transaction (SAVINGS\_DEPOSIT, LOAN\_DISBURSEMENT, DIVIDEND\_DISTRIBUTION, RESERVE\_TOP\_UP, EXPENSE\_PAYMENT, etc.)
* **Transaction date**: When transaction occurred
* **Status**: POSTED (permanent, affects balances) or DRAFT (temporary, can be edited)
* **Lines**: 2 or more lines showing debits and credits (must balance)
* **Metadata**: Title, description, supporting documents
* **Idempotency key**: Prevents duplicate entries

**Example journal entry structure:**

```json theme={null}
{
  "id": "je-123",
  "kind": "SAVINGS_DEPOSIT",
  "transactionDate": "2026-06-12",
  "status": "POSTED",
  "lines": [
    {
      "side": "DEBIT",
      "amount": 100000,
      "account": "Cash (organization:org123)"
    },
    {
      "side": "CREDIT",
      "amount": 100000,
      "account": "Savings (organizationUser:alice)"
    }
  ]
}
```

[Learn about journal entries →](/tontines/general-ledger/viewing-journal-entries)

***

## Common Questions

### Q: Do I need to understand debits and credits to use Agatabo?

**A**: No! Agatabo creates journal entries automatically when you record deposits, loans, expenses, dividends, and reserves. Understanding double-entry helps with:

* Troubleshooting discrepancies
* Creating manual journal entries
* Advanced accounting tasks
* Financial statement interpretation

But it's **not required** for daily operations like recording deposits or loan payments.

***

### Q: What if debits don't equal credits?

**A**: Agatabo won't allow posting unbalanced entries:

* All automatic entries are validated before creation
* Manual journal entries are rejected if debits ≠ credits
* System enforces balance requirement at all times

If you somehow encounter an unbalanced entry, it's a system bug that should be reported.

***

### Q: Why does my cash go up (debit) but member savings also go up (credit)?

**A**: Because they're **different account types**:

* Cash (asset) increases with **debit**
* Member Savings (liability) increases with **credit**

Both can increase simultaneously because the transaction affects different parts of the accounting equation:

```
Assets (Cash ↑) = Liabilities (Savings ↑) + Equity
```

The equation remains balanced!

***

### Q: What's the difference between Income and Revenue?

**A**: In Agatabo (and many accounting systems):

* **Income**: Preferred term for earned revenue (INTEREST\_INCOME, FEE\_INCOME, PENALTY\_INCOME)
* **Revenue**: General term for money earned

They mean the same thing. Agatabo uses "Income" in account names for consistency.

***

### Q: Why are member savings a liability?

**A**: Because the organization **owes** these funds to members:

* Members can withdraw their savings at any time
* Organization has an obligation to return the funds on demand
* This is a liability (money owed to others)

Even though members are "owners," their savings accounts are liabilities, not equity. Dividends that members choose to leave in savings also increase this liability.

***

### Q: How do reserves work in double-entry?

**A**: Reserves are **equity accounts** (designated retained earnings):

* Both Retained Earnings and Reserve Allocations are equity
* Allocating to reserves moves money from general equity to designated equity
* Total equity doesn't change (internal reclassification)
* Both sides of the entry are equity accounts

**Example:**

```
DEBIT: Reserve Allocation (equity) +1,000,000
CREDIT: Retained Earnings (equity) -1,000,000
```

***

## Visual Guide: Account Flow

```
ASSETS                    LIABILITIES
┌─────────────┐          ┌─────────────┐
│             │          │             │
│  Cash       │          │  Member     │
│  Loans      │          │  Savings    │
│  Fixed      │          │             │
│  Assets     │          │             │
│             │          │             │
└─────────────┘          └─────────────┘
      ↕                        ↕
  Debit ↑                  Credit ↑
 Credit ↓                   Debit ↓

EQUITY                    INCOME
┌─────────────┐          ┌─────────────┐
│             │          │             │
│  Retained   │          │  Interest   │
│  Earnings   │          │  Fees       │
│  Reserves   │          │  Penalties  │
│             │          │             │
│             │          │             │
└─────────────┘          └─────────────┘
      ↕                        ↕
 Credit ↑                  Credit ↑
  Debit ↓                   Debit ↓

EXPENSES
┌─────────────┐
│             │
│  Operating  │
│  Bad Debt   │
│  Bank       │
│  Charges    │
│             │
└─────────────┘
      ↕
  Debit ↑
 Credit ↓
```

***

## Best Practices

<Note>
  **For non-accountants:**

  * Trust automatic journal entries (they're correct)
  * Focus on business transactions, not accounting mechanics
  * Review financial reports (Balance Sheet, Income Statement) instead of raw journal entries
  * Ask an accountant if creating manual entries

  **For accountants:**

  * Review journal entries regularly for accuracy
  * Verify trial balance balances monthly
  * Document all manual journal entries clearly
  * Use consistent account names and classifications
  * Train staff on basic double-entry concepts
  * Monitor for unusual transactions or patterns
</Note>

***

## Need Help?

<CardGroup cols={2}>
  <Card title="Viewing Journal Entries" icon="book" href="/tontines/general-ledger/viewing-journal-entries">
    See transaction details and audit trail
  </Card>

  <Card title="General Ledger Overview" icon="book-open" href="/tontines/general-ledger/overview">
    Complete accounting system overview
  </Card>

  <Card title="Balance Sheet" icon="file-invoice-dollar" href="/tontines/reports/balance-sheet">
    See accounting equation in action
  </Card>

  <Card title="Income Statement" icon="chart-line" href="/tontines/reports/income-statement">
    View revenue and expenses
  </Card>

  <Card title="Manual Journal Entries" icon="pen-to-square" href="/tontines/general-ledger/manual-journal-entries">
    Create manual accounting entries
  </Card>
</CardGroup>
