# 📄 How to Download PDF Reports - Quick Guide

## Haven Grazuri Investment Limited - Accounting PDF Reports

---

## 🎯 Where to Find PDF Reports

### Step 1: Navigate to Financial Reports

```
Main Menu → Reports → Financial Reports → Chart of Accounts
```

**Full URL Path:**
```
/reports/financial/chart-of-accounts/
```

---

## 📊 Available PDF Downloads

### 1. Chart of Accounts PDF (Red Button)

**What you get:**
- Complete list of all accounts
- Organized by: Assets, Liabilities, Equity, Income, Expenses
- Current balances for each account
- Account codes and descriptions

**How to download:**
1. Go to Chart of Accounts page
2. Click the **red "Download PDF"** button (top right)
3. PDF downloads automatically as: `chart_of_accounts_2026-07-15.pdf`

**What's in the PDF:**
```
═══════════════════════════════════════
     Haven Grazuri Investment Limited
        Trusted Microfinance Partner
───────────────────────────────────────

         CHART OF ACCOUNTS
         As of July 15, 2026

📗 ASSETS (5 accounts)
┌──────────┬─────────────────────┬──────────┬─────────────┐
│ Code     │ Account Name        │ Type     │ Balance     │
├──────────┼─────────────────────┼──────────┼─────────────┤
│ 202001   │ Cash and Bank       │ ASSET    │ 150,000.00  │
│ 202002   │ Loan Portfolio      │ ASSET    │ 5,000,000   │
│ ...      │ ...                 │ ...      │ ...         │
└──────────┴─────────────────────┴──────────┴─────────────┘

📕 LIABILITIES (3 accounts)
...

📘 EQUITY (2 accounts)
...

💜 INCOME (4 accounts)
...

💔 EXPENSES (6 accounts)
...
```

---

### 2. Trial Balance PDF (Green Button)

**What you get:**
- All accounts with debit/credit balances
- Total debits and credits
- Balance verification (Balanced ✅ or Out of Balance ⚠️)

**How to download:**
1. Go to Chart of Accounts page
2. Click the **green "Trial Balance PDF"** button (top right)
3. PDF downloads automatically as: `trial_balance_2026-07-15.pdf`

**What's in the PDF:**
```
═══════════════════════════════════════
     Haven Grazuri Investment Limited
        Trusted Microfinance Partner
───────────────────────────────────────

           TRIAL BALANCE
         As of July 15, 2026

┌──────────┬─────────────────────┬──────────────┬──────────────┐
│ Code     │ Account Name        │ Debit (KES)  │ Credit (KES) │
├──────────┼─────────────────────┼──────────────┼──────────────┤
│ 202001   │ Cash and Bank       │ 150,000.00   │ -            │
│ 202002   │ Loan Portfolio      │ 5,000,000.00 │ -            │
│ 301001   │ Client Deposits     │ -            │ 250,000.00   │
│ ...      │ ...                 │ ...          │ ...          │
├──────────┼─────────────────────┼──────────────┼──────────────┤
│          │ TOTAL               │ 5,330,000.00 │ 5,330,000.00 │
└──────────┴─────────────────────┴──────────────┴──────────────┘

✅ Trial Balance is BALANCED
```

---

### 3. Account Ledger PDF (Per Account)

**What you get:**
- Detailed transaction history for ONE specific account
- Date, description, debit, credit, running balance
- Filtered by date range (default: last 90 days)

**How to download:**
1. Go to Chart of Accounts page
2. Click on **any account code** (e.g., "202001 - Cash and Bank")
3. You'll see the Account Ledger page
4. (Optional) Filter by date range using the date pickers
5. Click **"📄 Export PDF"** button (top right, red)
6. PDF downloads as: `account_ledger_202001_2026-04-15_to_2026-07-15.pdf`

**What's in the PDF:**
```
═══════════════════════════════════════
     Haven Grazuri Investment Limited
        Trusted Microfinance Partner
───────────────────────────────────────

         ACCOUNT LEDGER
     202001 - Cash and Bank Balances
   April 15, 2026 to July 15, 2026

┌────────────┬────────────────────┬──────────┬──────────┬────────────┐
│ Date       │ Description        │ Debit    │ Credit   │ Balance    │
├────────────┼────────────────────┼──────────┼──────────┼────────────┤
│ 2026-04-15 │ Opening Balance    │ 100,000  │ -        │ 100,000.00 │
│ 2026-04-20 │ Loan disbursement  │ -        │ 50,000   │ 50,000.00  │
│ 2026-04-25 │ Loan repayment     │ 15,000   │ -        │ 65,000.00  │
│ 2026-05-01 │ Processing fee     │ 5,000    │ -        │ 70,000.00  │
│ ...        │ ...                │ ...      │ ...      │ ...        │
└────────────┴────────────────────┴──────────┴──────────┴────────────┘
```

---

## 🖼️ Visual Button Locations

### On Chart of Accounts Page:

```
┌─────────────────────────────────────────────────────────────┐
│ 📊 Chart of Accounts                                        │
│ Complete overview of all general ledger accounts...         │
│                                                              │
│  [Download PDF]  [Trial Balance PDF]  [← Back to Reports]  │
│     (RED)            (GREEN)            (GRAY)              │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│ 📄 Professional PDF Reports Available                       │
│                                                              │
│ Chart of Accounts PDF: Complete listing of all accounts...  │
│ Trial Balance PDF: Summary verification report...           │
│ 💡 Tip: Click any account code to view detailed ledger      │
└─────────────────────────────────────────────────────────────┘

[ASSET ACCOUNTS]
[LIABILITY ACCOUNTS]
[EQUITY ACCOUNTS]
[INCOME ACCOUNTS]
[EXPENSE ACCOUNTS]
```

### On Account Ledger Page:

```
┌─────────────────────────────────────────────────────────────┐
│ Account: 202001 - Cash and Bank Balances                    │
│ Current Balance: KES 150,000.00                             │
│                                                              │
│  [📄 Export PDF]  [📊 Export Excel]                         │
│      (RED)             (GREEN)                              │
└─────────────────────────────────────────────────────────────┘

[TRANSACTION HISTORY TABLE]
[PAGINATION]
```

---

## ⏱️ When to Download Each Report

### Chart of Accounts PDF
**Use for:**
- Monthly financial reviews
- Management reports
- Audit documentation
- Account structure overview
- Board presentations

**Best time:** End of month, after all transactions posted

---

### Trial Balance PDF
**Use for:**
- Period-end closing
- Balance verification
- Accounting accuracy checks
- Finding posting errors
- Reconciliation support

**Best time:** Before closing each period (monthly/quarterly)

---

### Account Ledger PDF
**Use for:**
- Investigating specific accounts
- Audit trails
- Transaction verification
- Detailed analysis
- Client inquiries

**Best time:** Anytime you need transaction details

---

## 💡 Pro Tips

### Tip 1: Custom Date Ranges
For Account Ledger PDFs, filter by date BEFORE exporting:
1. Set Start Date
2. Set End Date
3. Click "Filter"
4. Then click "Export PDF"

### Tip 2: Monthly Archiving
Download these PDFs monthly for records:
- Chart of Accounts (last day of month)
- Trial Balance (last day of month)
- Key account ledgers (Cash, Loans, etc.)

### Tip 3: Quick Access
Bookmark these URLs:
```
Chart of Accounts:
/reports/financial/chart-of-accounts/

Chart of Accounts PDF (direct):
/reports/financial/chart-of-accounts/pdf/

Trial Balance PDF (direct):
/reports/financial/trial-balance/pdf/
```

### Tip 4: File Organization
Suggested folder structure:
```
Accounting Reports/
├── 2026/
│   ├── July/
│   │   ├── chart_of_accounts_2026-07-31.pdf
│   │   ├── trial_balance_2026-07-31.pdf
│   │   └── ledgers/
│   │       ├── cash_202001_july_2026.pdf
│   │       └── loans_202002_july_2026.pdf
│   └── June/
│       └── ...
└── 2025/
    └── ...
```

---

## 🚨 Troubleshooting

### PDF Not Downloading?
1. **Check pop-up blocker** - Allow pop-ups from your domain
2. **Try different browser** - Chrome, Firefox, Edge all supported
3. **Check Downloads folder** - May have downloaded silently
4. **Right-click button** - Select "Open in new tab"

### PDF Opens in Browser Instead of Downloading?
- This is normal browser behavior
- Use browser's "Save As" or Print → Save as PDF
- Or right-click button → "Save Link As"

### PDF Is Blank or Has Errors?
1. **Check accounting data exists** - Need accounts in system
2. **Run test:** `python test_accounting_pdfs.py`
3. **Check date range** - May be no transactions in period
4. **Contact support** - May be a data issue

### Can't Find the Buttons?
- Make sure you're on the **Chart of Accounts** page
- Not the reports dashboard (go one level deeper)
- Path: Reports → Financial Reports → **Chart of Accounts**
- Look for RED and GREEN buttons at the top right

---

## 📞 Need Help?

If PDFs aren't working or you have questions:

1. **Run the test script:**
   ```bash
   python test_accounting_pdfs.py
   ```
   This will tell you if PDF generation is working

2. **Check documentation:**
   - `ACCOUNTING_PDF_REPORTS.md` - Full user guide
   - `PDF_REPORTS_IMPLEMENTATION_SUMMARY.md` - Technical details

3. **Verify page access:**
   - URL: `/reports/financial/chart-of-accounts/`
   - You should see the PDF download buttons
   - If not, check permissions or contact admin

---

## ✅ Quick Checklist

Before downloading PDFs, make sure:

- [ ] You're logged in as staff/admin
- [ ] You're on the Chart of Accounts page
- [ ] You can see the PDF download buttons
- [ ] Your browser allows downloads from this site
- [ ] Accounting data exists in the system
- [ ] You have appropriate permissions

---

**Last Updated:** July 15, 2026  
**System:** Haven Grazuri Microfinance Accounting  
**Feature:** Chart of Accounts PDF Reports v1.0

---

## 🎉 That's It!

You now have professional PDF reports for your accounting system. All reports include:

✅ Haven Grazuri Investment Limited branding  
✅ Professional layout and design  
✅ Clean data without extra clutter  
✅ Page numbers and timestamps  
✅ Ready for management review

**Happy Reporting!** 📊
