> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Finance & Accounting - Chart of Accounts Guide

> The Chart of Accounts (CoA) module provides comprehensive fund accounting capabilities for behavioral health organizations, including fund tracking, department…

## Overview

The Chart of Accounts (CoA) module provides comprehensive fund accounting capabilities for behavioral health organizations, including fund tracking, department hierarchies, program management, and fiscal period control.

## Table of Contents

1. [Chart of Accounts Setup](#chart-of-accounts-setup)
2. [Fund Management](#fund-management)
3. [Department Hierarchy](#department-hierarchy)
4. [Programs Configuration](#programs-configuration)
5. [Fiscal Period Management](#fiscal-period-management)
6. [Starter Chart of Accounts](#starter-chart-of-accounts)

***

## Chart of Accounts Setup

### Creating Accounts

1. Navigate to **Finance** → **Chart of Accounts**

2. Click **New Account**

3. Fill in required fields:
   * **Account Number**: Unique identifier (e.g., `1000`)
   * **Account Name**: Descriptive name (e.g., `Cash - Operating`)
   * **Account Type**: Asset, Liability, Equity, Revenue, or Expense
   * **Account Subtype**: Specific classification within type
   * **Normal Balance**: Debit or Credit

4. Optional configuration:
   * **Parent Account**: Create hierarchical structure
   * **Default Fund**: Assign to specific fund
   * **Requires Fund**: Force fund selection on transactions
   * **Requires Department**: Force department selection
   * **Allows Posting**: Enable direct journal entries

### Account Hierarchy

Accounts support multi-level hierarchies:

* **Control Accounts**: Summary accounts (e.g., `1000 - Assets`)
* **Sub-Accounts**: Detail accounts (e.g., `1010 - Cash`, `1020 - A/R`)
* **Level**: Auto-calculated based on parent relationships

***

## Fund Management

### Fund Types

**Unrestricted Funds**

* General operating funds
* No donor restrictions
* Maximum flexibility in usage

**Temporarily Restricted Funds**

* Donor-imposed restrictions
* Released when conditions met
* Time or purpose-based

**Permanently Restricted Funds**

* Endowments
* Principal permanently restricted
* Only earnings may be spent

**Special Purpose Funds**

* Designated for specific programs
* Board-restricted or donor-restricted

**Capital Funds**

* Building and equipment purchases
* Major capital improvements

**Operating Funds**

* Day-to-day operations
* Program-specific operating expenses

### Creating Funds

1. Navigate to **Finance** → **Funds**
2. Click **New Fund**
3. Configure:
   * **Fund Number**: Unique code
   * **Fund Name**: Descriptive name
   * **Fund Type**: Select from types above
   * **Restrictions** (if applicable):
     * Donor restrictions
     * Purpose restrictions
     * Time restrictions

### Fund Tracking Best Practices

* Create separate funds for each grant/contract
* Use descriptive names (e.g., `SAMHSA-BH-2024`)
* Document all restrictions in the system
* Review fund balances monthly
* Track restriction releases

***

## Department Hierarchy

### Creating Departments

1. Navigate to **Finance** → **Departments**
2. Click **New Department**
3. Fill in:
   * **Department Code**: Short identifier (e.g., `ADMIN`)
   * **Department Name**: Full name
   * **Parent Department**: Create hierarchy
   * **Cost Center**: Accounting reference
   * **Is Clinical**: Flag for clinical departments

### Hierarchical Organization

Example structure:

```
Administration (ADMIN)
├── Finance (FIN)
├── HR (HR)
└── IT (IT)

Clinical Services (CLIN)
├── Residential Treatment (RES)
├── Outpatient (OP)
└── Case Management (CM)

Support Services (SUPP)
├── Facilities (FAC)
└── Maintenance (MAINT)
```

### Department Reporting

* Cost center tracking
* Department-level P\&L
* Budget vs. actual by department
* Cross-department allocations

***

## Programs Configuration

### Creating Programs

1. Navigate to **Finance** → **Programs**
2. Click **New Program**
3. Configure:
   * **Program Code**: Unique identifier
   * **Program Name**: Service line name
   * **Department**: Link to owning department
   * **Revenue Generating**: Yes/No flag

### Program Types

**Revenue-Generating Programs**

* Direct client service programs
* Track program-specific revenue
* Allocate costs appropriately

**Non-Revenue Programs**

* Administrative functions
* Support services
* Overhead allocation targets

### Program Tracking

Use programs to:

* Track service line profitability
* Allocate indirect costs
* Report to funders by program
* Analyze program efficiency

***

## Fiscal Period Management

### Creating Fiscal Years

1. Navigate to **Finance** → **Fiscal Periods**

2. Click **New Fiscal Year**

3. Enter:
   * **Year Code**: e.g., `FY2024`
   * **Start Date**: Fiscal year start
   * **End Date**: Fiscal year end
   * **Is Current**: Mark as active year

4. System auto-generates 12 monthly periods

### Period Status

**Closed** (Default)

* No journal entries allowed
* Safe state for future periods

**Open**

* Posting enabled
* Current working period
* Can close/reopen as needed

**Locked**

* Permanently closed
* Prevents any changes
* Used after audit/finalization
* Requires confirmation to lock

### Period Controls

**Opening a Period:**

1. Select period
2. Click **Open Period**
3. Begin posting transactions

**Closing a Period:**

1. Verify all entries posted
2. Run month-end reports
3. Click **Close Period**
4. Optional: Lock if finalized

**Locking a Period:**

1. Ensure period is closed
2. Complete audit/review
3. Click **Lock Period**
4. Confirm warning dialog
5. ⚠️ **This cannot be easily reversed**

### Best Practices

* Open only current period
* Close previous period before opening next
* Lock periods only after final audit
* Maintain clear period boundaries
* Document period-end procedures

***

## Chart of Accounts Templates

Encore Health OS ships a **Template Library** of pre-configured chart-of-accounts templates. Applying a template creates the template's accounts in your current organization in a single action and is safe to re-run — accounts whose numbers already exist are skipped.

### Available Templates

| Template ID                   | Name                                 | Source                                        | Best for                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------------- | ------------------------------------ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `samhsa-behavioral-health`    | SAMHSA Behavioral Health             | SAMHSA                                        | Grant-funded behavioral-health organizations reporting against SAMHSA grant cost categories (personnel, fringe, travel, equipment, supplies, contractual, occupancy, indirect, other direct).                                                                                                                                                                                                                                 |
| `behavioral-health-baseline`  | Behavioral Health Baseline           | Encore                                        | General-purpose CoA for BH and recovery-housing organizations. Includes payer-split AR (Medicaid / Commercial / Self-Pay), payroll clearing, employer-tax and benefit-withholding payables, Resident Trust (PNA) liability, contractual adjustments (contra-revenue), and bad debt.                                                                                                                                           |
| `hrsa-fqhc-behavioral-health` | HRSA / FQHC Behavioral Health        | HRSA Bureau of Primary Health Care UDS Manual | HRSA Section 330 grantees, FQHCs, and FQHC look-alikes operating BH programs. Includes HRSA grants receivable, sliding-fee discounts (contra-revenue), 340B drug program revenue and inventory, in-kind contributions, and HRSA UDS Table 5 personnel categories (clinical / enabling services / administrative).                                                                                                             |
| `recovery-housing-narr`       | Recovery Housing (NARR-aligned)      | NARR National Standard 3.0                    | Recovery housing operators across NARR Levels I–IV. Includes per-level program-fee revenue, scholarship income / scholarships granted (contra-revenue), security/move-in deposits payable, Resident Trust (PNA) liability, occupancy by site, food/household, peer-support stipends, and house-manager compensation. Add jurisdiction-specific certification (e.g., AzRHA in Arizona) via PF-96.                              |
| `medicaid-bh-practice`        | Medicaid Behavioral Health Practice  | Encore (PM-aligned)                           | Outpatient BH practices billing state Medicaid (e.g., AHCCCS in Arizona via PF-96), Medicare, and commercial insurance. Includes payer-split AR, allowance for doubtful accounts (contra-asset), capitation/PMPM revenue (PM-33 aligned), service-line FFS revenue (OP/IOP/PHP/MAT/Telehealth), contractual adjustments and charity-care write-offs (contra-revenue), clearinghouse/EDI fees, EHR/PM software, credentialing. |
| `nonprofit-ucoa-baseline`     | Nonprofit Baseline (UCOA-aligned)    | NCCS Unified Chart of Accounts                | Any 501(c)(3) starting from a Form-990-mappable baseline. Account `description`s reference the corresponding Form 990 lines (Part VIII Statement of Revenue and Part IX Statement of Functional Expenses).                                                                                                                                                                                                                    |
| `sober-living-single-house`   | Sober Living - Single House Operator | Encore                                        | Single-house sober living operators not yet operating with formal nonprofit fund accounting. Minimal \~17 accounts including PNA liability and security deposits payable. Migrate to `recovery-housing-narr` as the operator grows into multi-house, certified, or licensed status.                                                                                                                                           |

> All built-in templates use **FASB ASU 2016-14 (ASC 958-205)** net-asset terminology — *Net Assets Without Donor Restrictions* and *Net Assets With Donor Restrictions* — rather than the legacy "Unrestricted / Temporarily Restricted / Permanently Restricted" classes.

### Applying a Template

1. Navigate to **Finance** → **Chart of Accounts**.
2. Open the **Templates** action.
3. Review each template card: name, source badge, account count, description.
4. Click **Apply**.
5. Confirm in the dialog. The system inserts the template's accounts into your organization in chunks and reports the result as a toast: `Template applied. N accounts created. M already existed.`

The apply flow is org-scoped, runs as a finance-admin action, and writes audit fields (`created_by`, `created_at`) on every new account.

### Idempotency

* Re-running **Apply** on the same template is safe — accounts whose `account_number` already exists are skipped.
* This makes templates safe to use both for greenfield setup and for incrementally extending an existing CoA with template-aligned accounts.

### Customizing After Applying

After applying a template:

1. Add organization-specific accounts.
2. Create additional sub-accounts.
3. Link accounts to funds.
4. Configure department requirements.
5. Set up default posting rules.

### Saving Your CoA as a Custom Template

Once you've configured your chart of accounts the way you want it, you can save the current state as a **custom template** that other users in your organization can apply to bring up new tenants, sites, or test environments quickly.

1. Navigate to **Finance** → **Chart of Accounts**.
2. Open the **Templates** action.
3. Click **Save current CoA as template**.
4. Enter a name (and optional description); choose whether to include active funds and active programs alongside the accounts.
5. Click **Save template**. The new custom template appears in the same Apply Template list, distinguished from built-ins by a **"Custom"** badge.

Custom templates are scoped to your organization (other organizations cannot see or apply them). They capture only **active** items — inactive accounts, funds, and programs are excluded so saved templates don't carry stale entries.

### Apply-Template Audit Trail

Every Apply Template action — for both built-in and custom templates — writes one row to the `fa_template_applications` audit table recording the template id, name, source, who applied it, when, and counts of accounts/funds/programs created and skipped. Built-in template applies use the template's kebab-case id (e.g., `samhsa-behavioral-health`); custom-template applies use the `db:<uuid>` id prefix so reports can cleanly distinguish source.

### Quick Reference — Standard Number Ranges

| Range     | Account class | Examples                                                                                                                                                                             |
| --------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1000–1999 | Assets        | Cash (operating, payroll, restricted, reserve), AR (Medicaid / Commercial / Self-Pay), fixed assets, accumulated depreciation (contra-asset)                                         |
| 2000–2999 | Liabilities   | AP, accrued payroll, **Resident Trust (PNA)**, payroll clearing, employer payroll tax payable, health-insurance payable, 401(k) withholding payable, refunds payable, long-term debt |
| 3000–3999 | Net assets    | Net Assets Without Donor Restrictions, Net Assets With Donor Restrictions                                                                                                            |
| 4000–4999 | Revenue       | Resident program fees, insurance reimbursements, **contractual adjustments (contra-revenue)**, grants, donations                                                                     |
| 5000–5999 | Expenses      | Salaries, benefits, occupancy, utilities, food/supplies, transportation, professional services, depreciation, **1099 contractor expense**, **bad debt expense**                      |

***

## Integration with Other Modules

### Forms & Workflow (FW)

* Use forms for budget requests
* Workflow approvals for large expenses
* Automated posting from form submissions

### Recovery Housing (RH)

* Bill resident fees by program
* Track revenue by site/facility
* Allocate operating costs

### Workforce & HR (HR)

* Payroll expense allocation
* Department-based labor costs
* Employee benefit tracking

***

## Troubleshooting

### Common Issues

**Can't Post to Account**

* Check `allows_posting` is enabled
* Verify period is open
* Ensure account is active

**Fund Required Error**

* Account has `requires_fund` enabled
* Select fund on transaction
* Or update account settings

**Period Locked**

* Period has been permanently locked
* Contact admin to review
* Post to current period instead

**Department Not Available**

* Department may be inactive
* Check parent department is active
* Verify organizational hierarchy

***

## Reporting

### Standard Reports

* **Trial Balance**: All account balances
* **Fund Balance Report**: By fund type
* **Department P\&L**: Revenue and expenses by dept
* **Program Analysis**: Program-level profitability
* **Period Comparison**: Month-over-month trends

### Custom Reports

Use the **Reports** module to create custom financial reports with:

* Account filters
* Fund groupings
* Department breakdowns
* Program summaries
* Date range comparisons

***

## Security & Permissions

### Role-Based Access

**Finance Admin** (`finance_admin`)

* Full CoA management
* Create/edit accounts, funds, departments
* Manage fiscal periods
* Lock/unlock periods

**Finance Staff** (`finance_staff`)

* View all financial data
* Post journal entries
* Run reports
* Cannot modify structure

**Staff** (`staff`)

* View assigned accounts
* Department-level access
* Limited reporting

**Org Admin** (`org_admin`)

* All finance permissions
* System configuration
* User management

***

## Next Steps

1. **Set up your Chart of Accounts**
   * Load starter CoA or create custom
   * Configure account hierarchy
   * Link to funds and departments

2. **Create Funds**
   * Add grants and contracts
   * Document restrictions
   * Set up default accounts

3. **Build Department Structure**
   * Organize hierarchically
   * Assign cost centers
   * Link programs

4. **Configure Fiscal Periods**
   * Create fiscal years
   * Open current period
   * Establish close procedures

5. **Ready for FA-02: Journal Entries**
   * Begin posting transactions
   * Track account balances
   * Run financial reports

***

**For Technical Support:** Contact your system administrator
**For Training:** See FA module documentation in `docs/fa/`
**For API Access:** See FA module specifications in `specs/fa/`
