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

# Loan Defaulting

> Mark loans as defaulted and automatically recover from securities or write off as bad debt

## Overview

Loan defaulting is the process of marking an uncollectible loan as DEFAULTED. When you default a loan, Agatabo automatically attempts to recover the outstanding balance from securities (borrower's savings, guarantors' savings, or collateral) and writes off any unrecovered amount as bad debt expense.

<Note>
  **Important**: This is a last resort after all collection efforts have failed. Exhaust all collection efforts before defaulting a loan.
</Note>

## How Loan Defaulting Works

### Automatic Recovery Process

When you default a loan, the system automatically attempts recovery in this order:

**1. Borrower's Savings**

* Recovers from the borrower's savings account
* Limited to pledged savings security amount (if specified)
* Limited to actual available balance

**2. Collateral (if pledged)**

* If collateral securities exist, marks recovery as "pending"
* Records the pledged collateral value
* **Note**: If collateral exists, guarantor savings are NOT charged
* Collateral recovery requires manual follow-up to convert to asset

**3. Guarantors' Savings (only if NO collateral)**

* For each guarantor:
  * Recovers from guarantor's savings account
  * Limited to pledged guarantee amount
  * Limited to guarantor's available balance
  * Respects blocked amounts (e.g., if guarantor has other loans)

**4. Bad Debt Expense (Write-off)**

* Any remaining unrecovered amount
* Posted as bad debt expense
* Affects profit & loss statement

### What Gets Cleared

Defaulting clears all outstanding balances:

* Outstanding Principal
* Outstanding Interest
* Outstanding Penalties

## When to Default a Loan

Consider defaulting when:

* All collection efforts have failed (calls, visits, reminders)
* Loan is severely delinquent (typically 90+ days)
* Borrower has disappeared or is deceased with no estate
* Cost of further collection exceeds potential recovery
* Guarantors unable or unwilling to pay
* Collateral insufficient or unavailable

## Before Defaulting a Loan

<Note>
  **Pre-default checklist**:

  * [ ] Document all collection attempts
  * [ ] Contact guarantors (if any) and request payment
  * [ ] Attempt to seize or value collateral
  * [ ] Apply appropriate penalties
  * [ ] Consider legal action if amount justifies cost
  * [ ] Get committee/board approval per policy
  * [ ] Verify borrower's current situation
  * [ ] Confirm no partial payment possibility
  * [ ] Review securities attached to the loan
</Note>

## Defaulting a Loan

<Steps>
  <Step title="Obtain approval">
    Board or loan committee must authorize (per your policy)
  </Step>

  <Step title="Navigate to loan details">
    Loans → Select the delinquent loan
  </Step>

  <Step title="Click 'Default Loan' button">
    Located in the top header (if you have permission)
  </Step>

  <Step title="Review loan information">
    Dialog shows:

    * Loan details (principal, rate, period)
    * Security details (all pledged securities)
    * Total security amount
  </Step>

  <Step title="Select defaulting date">
    Choose the date to post the default (max: today)
  </Step>

  <Step title="Confirm action">
    Click "Default Loan" button
  </Step>
</Steps>

## What Happens When You Default

### 1. Recovery Attempts

The system automatically:

* Debits borrower's savings (up to pledged amount or full balance)
* If collateral exists: marks collateral recovery as pending
* If NO collateral: debits guarantors' savings (up to pledged amounts)

### 2. Journal Entry Created

**Entry type**: LOAN\_DEFAULT

**Example entry** (100,000 principal, 20,000 interest, 5,000 penalties outstanding):

```
Dr. Borrower Savings              50,000  (recovered from borrower)
Dr. Guarantor A Savings           30,000  (recovered from guarantor)
Dr. Bad Debt Expense              45,000  (written off)
   Cr. Loan Receivable                      100,000  (principal cleared)
   Cr. Interest Receivable                   20,000  (interest cleared)
   Cr. Penalty Receivable                     5,000  (penalties cleared)

Total Debits: 125,000 = Total Credits: 125,000
```

### 3. Loan Status Changes

* Status updated to: **DEFAULTED**
* Defaulted date recorded
* Removed from active portfolio (portfolio outstanding decreases)

### 4. Recovery Amounts Tracked

The system records:

* Amount recovered from borrower
* Amount recovered from each guarantor
* Amount recovered from collateral (if any)
* Whether collateral recovery is pending
* Amount written off as bad debt

### 5. Notifications Sent

* Borrower notified of default (if notifications enabled)
* Email/SMS with details about outstanding amounts and recoveries

### 6. Audit Trail

* Full audit log created
* Records who defaulted the loan and when
* Tracks all recovery amounts

## Understanding Collateral Recovery

If collateral was pledged:

**What happens**:

* Collateral recovery is marked as "pending"
* Pledged collateral value is recorded as recovered
* Guarantors' savings are NOT charged
* Flag set: `collateralRecoveryPending: true`

**What you need to do**:

* Follow up manually to seize/sell the collateral
* Create collateral asset record (if configured)
* Document the recovery process

<Warning>
  **Important**: The system does NOT automatically create collateral assets. If collateral exists, guarantors are skipped, and you must manually follow up to recover the collateral value.
</Warning>

## Undoing a Default

Despite the warning in the UI, loan defaults **can be reversed**:

<Steps>
  <Step title="Navigate to loan details">
    Find the defaulted loan
  </Step>

  <Step title="Click 'Undo Default' button">
    Located in the top header (if loan is DEFAULTED)
  </Step>

  <Step title="Confirm">
    Confirm you want to reverse the default
  </Step>
</Steps>

**What happens**:

* Reverses the default journal entry
* Loan status changes back to ACTIVE
* Outstanding balances are restored
* Recovered amounts are returned to savings accounts

**Cannot undo if**:

* Active collateral assets are linked to this loan (must reverse/delete those first)
* Later loan events exist after the default date

<Note>
  **Use case**: Undo default if you discover the member is able to make payments, or if the default was recorded in error.
</Note>

## After Defaulting

### Accounting Impact

* **Loan Receivable**: Removed from balance sheet assets
* **Bad Debt Expense**: Appears on profit & loss statement
* **Borrower/Guarantor Savings**: Reduced by recovered amounts
* **Portfolio Outstanding**: Decreased by loan amount

### Member Impact

* Loan appears as "DEFAULTED" in member's record
* Member may be ineligible for future loans (per your policy)
* Credit history negatively affected
* Savings balance reduced by recovery amount

### Legal Considerations

* Default is an **accounting action**, not legal forgiveness
* Organization can still pursue collections legally
* Member still legally owes the debt
* Consult legal counsel for collection options

### Recovery After Default

If the member later makes a payment:

* Record as recovery income (not a loan payment)
* Use manual journal entry or income recording feature
* Document the recovery clearly

## Financial Reporting

Defaulted loans appear in:

**Profit & Loss**:

* Bad Debt Expense (amount written off)

**Balance Sheet**:

* Reduced Loan Receivable (asset decrease)

**Loan Analytics**:

* Status distribution (shows defaulted count)
* Loan Book Snapshot (defaulted category)

**Audit Reports**:

* Complete default transaction history
* Recovery amounts by source

## Example Scenarios

### Full Recovery from Borrower

```
Loan: 200,000 principal, 50,000 interest, 10,000 penalties
Borrower savings: 300,000
Securities: 260,000 pledged savings

Recovery:
- From borrower savings: 260,000 (full outstanding)
- Written off: 0

Result: Loan fully recovered, no bad debt expense
```

### Partial Recovery with Write-off

```
Loan: 500,000 principal, 100,000 interest, 20,000 penalties
Borrower savings: 100,000
Securities: No collateral, 2 guarantors (200,000 each)
Guarantor A savings: 150,000
Guarantor B savings: 250,000

Recovery:
- From borrower: 100,000
- From Guarantor A: 150,000
- From Guarantor B: 200,000 (pledged amount, not full balance)
- Total recovered: 450,000
- Written off: 170,000 (620,000 - 450,000)

Result: 73% recovery, 27% bad debt
```

### Collateral Recovery Pending

```
Loan: 1,000,000 principal, 200,000 interest
Borrower savings: 50,000
Securities: Land title valued at 1,500,000, 1 guarantor (300,000)

Recovery:
- From borrower: 50,000
- From collateral: 1,150,000 (pending - manual follow-up required)
- From guarantor: 0 (skipped due to collateral)
- Written off: 0

Result: Collateral recovery pending, must seize land
```

## Best Practices

<Note>
  **Defaulting tips:**

  * Only default as last resort after exhausting all collection efforts
  * Document all collection attempts before defaulting
  * Get board/committee approval per policy
  * Review securities carefully before defaulting
  * If collateral exists, prepare to follow up on seizure/sale
  * Consider member's circumstances (hardship vs. intentional default)
  * Maintain consistent defaulting criteria across all loans
  * Track default patterns to improve credit assessment
  * Use defaults as learning opportunity to strengthen lending practices
</Note>

## Permissions Required

| Action            | Permission      | Scope |
| ----------------- | --------------- | ----- |
| View loan details | `loans:read`    | ANY   |
| Default loan      | `loans:approve` | ANY   |
| Undo default      | `loans:approve` | ANY   |

<Note>
  **Organization Setting**: Loan defaulting can be disabled organization-wide via `disable_loan_defaulting` setting in loan settings.
</Note>

## Related Operations

<CardGroup cols={2}>
  <Card title="Applying Penalties" icon="circle-exclamation" href="/tontines/loans/applying-penalties">
    Try penalties before defaulting
  </Card>

  <Card title="Viewing Loan Details" icon="file-lines" href="/tontines/loans/viewing-loan-details">
    Check loan status and arrears
  </Card>

  <Card title="Loan Analytics" icon="chart-line" href="/tontines/loans/loan-analytics">
    Monitor portfolio at risk
  </Card>

  <Card title="Recording Payments" icon="money-bill-transfer" href="/tontines/loans/recording-loan-payments">
    Record recovery payments
  </Card>
</CardGroup>
