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

# Recurring Invoices

> Manage recurring invoice templates that automatically generate invoices on schedule; create, view, edit, pause, resume, and delete templates.

The Recurring Invoices page (`/fa/recurring-invoices`) lists all recurring invoice templates for the organization and provides controls to activate, pause, or delete them.

## Overview

The Recurring Invoices list displays all recurring invoice templates scoped to the current organization. The page shows summary statistics — active template count, paused template count, and the next scheduled generation date — followed by a filterable table.

Templates can be filtered by status (`active`, `paused`, or all) and by customer. Each template row links to the recurring invoice detail page.

## Who it's for

Requires permission: `fa.recurring_invoices.view`. Creating requires `fa.recurring_invoices.create`. Pausing, deleting, and editing require `fa.recurring_invoices.edit`.

## Before you start

* At least one customer must exist in the system.
* You need `fa.recurring_invoices.view` permission to view the list.
* For creating, identify the customer and invoice amount/line items, and determine the billing frequency and start date.

## Steps

**View recurring invoice templates**

1. Navigate to `/fa/recurring-invoices`.
2. Use the Status and Customer filters to narrow the list.
3. Click a template row to open its detail page.

**Create a new recurring invoice template**

1. Click **New** (requires `fa.recurring_invoices.create`).
2. Complete the creation form and save.

**Pause or resume a template**

1. Locate the template in the list.
2. Use the Pause or Resume action to toggle the template status.

## Key concepts

* **Template**: A recurring invoice definition that drives automatic invoice generation on a scheduled basis.
* **Active / Paused**: Status values observed in code (`status === 'active'` or `'paused'`).
* **Next generation date**: The `next_generation_date` field on each template; the list sorts by this field to surface the soonest upcoming invoice.

## Viewing a recurring invoice

The Recurring Invoice Details page at `/fa/recurring-invoices/:id` shows the full detail of a recurring invoice template with status management actions, generation history, and schedule information. Requires permission `fa.recurring_invoices.view`.

`RecurringInvoiceDetailPage` fetches data via `useRecurringInvoice` and `useRecurringInvoiceHistory`. The page shows the template header (customer, schedule, amounts) with `StatusBadge` for status (`active`, `paused`, `completed`, `cancelled`). Tabbed views are available. Available actions: **Pause/Resume** (`usePauseRecurringInvoice`), **Generate Now** (`useGenerateFromRecurringInvoice`), **Edit** (links to `/fa/recurring-invoices/:id/edit`), and **Delete** (`useDeleteRecurringInvoice`). The delete action is guarded by an `AlertDialog`.

Key concepts:

* **Template statuses** — `active`, `paused`, `completed`, `cancelled`.
* **`next_generation_date`** — The scheduled date for the next automatic invoice generation.
* **Generation history** — Records of invoices previously generated from this template, loaded via `useRecurringInvoiceHistory`.

1. Navigate to **Finance & Revenue → Recurring Invoices** and select a template, or go to `/fa/recurring-invoices/:id`.
2. Review the template header: customer, frequency, next generation date, and status.
3. Use **Pause** to suspend automatic generation, or **Resume** to reactivate.
4. Use **Generate Now** to manually trigger invoice creation from this template.
5. Review the generation history tab.
6. Use **Edit** to modify the template, or **Delete** to remove it (confirmation required).

## Creating a recurring invoice

The New Recurring Invoice page at `/fa/recurring-invoices/new` launches the Recurring Invoice Setup Wizard. Requires permission `fa.recurring_invoices.create`. `RecurringInvoiceCreatePage` renders `RecurringInvoiceSetupWizardPage` in `create` mode. The wizard is part of the PF-41 wizard infrastructure.

Key concepts:

* **Recurring invoice template** — A configuration record stored in `fa_recurring_invoices` (inferred) that controls automatic invoice generation. Tracked by `next_generation_date`.
* **Wizard mode** — The wizard host accepts a `mode` prop; this route passes `"create"`.

1. Navigate to **Finance & Revenue → Recurring Invoices** and select **New Recurring Invoice**, or go to `/fa/recurring-invoices/new`.
2. Follow the setup wizard steps to define customer, amounts, frequency, and start date.
3. Complete the wizard. A recurring invoice template is created with `status: active` (or as set by the wizard).
4. The template appears in the Recurring Invoices list and will generate invoices on schedule.

## Editing a recurring invoice

The Edit Recurring Invoice page at `/fa/recurring-invoices/:id/edit` opens the recurring invoice setup wizard in edit mode. Requires permission `fa.recurring_invoices.edit`. `RecurringInvoiceEditPage` reads `:id` from the route via `useParams` and renders `RecurringInvoiceSetupWizardPage` in `mode="edit"`. The wizard hydrates its draft from the existing recurring invoice record. The breadcrumb label is set to the invoice ID prefix or "Edit Recurring Invoice".

Key concepts:

| Concept                           | Description                                                                                        |
| --------------------------------- | -------------------------------------------------------------------------------------------------- |
| `RecurringInvoiceSetupWizardPage` | Multi-step wizard for recurring invoice configuration; `mode="edit"` hydrates from existing record |
| `mode` prop                       | Controls whether the wizard creates a new record or updates an existing one                        |

1. Navigate to the Receivables Hub (`/fa/receivables`) or `/fa/recurring-invoices` and open the recurring invoice.
2. Click **Edit** to go to `/fa/recurring-invoices/:id/edit`.
3. The setup wizard opens in edit mode, pre-populated with the existing record.
4. Update the relevant steps in the wizard.
5. Submit to save changes.

## Related

<Columns cols={2}>
  <Card title="Finance & Revenue" icon="building-columns" href="/fa/overview">
    Finance & Revenue core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/fa.tsx
  * src/cores/fa/pages/RecurringInvoicesPage.tsx
  * src/cores/fa/pages/RecurringInvoiceDetailPage.tsx
  * src/cores/fa/pages/RecurringInvoiceCreatePage.tsx
  * src/cores/fa/pages/RecurringInvoiceEditPage.tsx
  * src/cores/fa/hooks/useRecurringInvoices.ts
  * src/cores/fa/wizards/recurring-invoice-setup/RecurringInvoiceSetupWizardPage.tsx
  * src/cores/fa/components/RecurringInvoicesTable.tsx
</Accordion>
