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

# Credit Memos

> List, create, and view customer credit memos with line items, application history, and lifecycle actions such as issue, void, and apply.

Credit Memos lists all customer credit memo records for the organization with status, type, and date filters, and summary metric cards. Route: `/fa/credit-memos`

## Overview

The route `/fa/credit-memos` is a legacy route that redirects to `/fa/receivables?tab=credit-memos` in the router. However, the `CreditMemosPage` component is also rendered for this context. The page fetches credit memos via `useCreditMemoList(organizationId, filters)`. Filters include `status`, `creditType`, `startDate`, and `endDate`. Summary cards show: total credits (`total_amount` sum), unapplied balance (`unapplied_amount` sum), and credits applied this calendar month (`applied_amount` sum for current month). The **Create Credit Memo** button navigates to `/fa/credit-memos/new`.

## Who it's for

Access follows your organization's role and module configuration.

## Before you start

* Customers must exist before credit memos can be created.
* At least one active customer and GL accounts must exist for creating a credit memo.

## Steps

<Steps>
  <Step title="Navigate to Credit Memos">
    Go to `/fa/credit-memos` or the Credit Memos tab in the Receivables hub.
  </Step>

  <Step title="Review summary cards">
    Check total credits, unapplied balance, and current-month applied amounts.
  </Step>

  <Step title="Filter the list">
    Set status, credit type, start date, or end date filters.
  </Step>

  <Step title="Open a credit memo">
    Click a row to navigate to its detail page at `/fa/credit-memos/:id`.
  </Step>

  <Step title="Create a credit memo">
    Click **Create Credit Memo** to navigate to `/fa/credit-memos/new`.
  </Step>
</Steps>

## Key concepts

* **`useCreditMemoList`** — Primary list hook; accepts `organizationId` and filter object.
* **`total_amount`** — Total value of the credit memo.
* **`unapplied_amount`** — Portion of the credit memo not yet applied to invoices.
* **`applied_amount`** — Portion already applied to invoices.

## Viewing a credit memo

The detail view at `/fa/credit-memos/:id` shows a single credit memo record including its line items, credit applications to invoices, and actions to issue, void, or delete the memo.

The page loads the credit memo via `useCreditMemo(id, organizationId)`, its applications via `useCreditApplications`, and customer invoices via `useInvoiceList` (filtered by customer). Breadcrumb shows `credit_memo_number`. The `CreditMemoStatusBadge` reflects current status. Available actions: Issue (`useIssueCreditMemo`), Void (`useVoidCreditMemo`, with confirmation dialog), Delete (`useDeleteCreditMemo`, with confirmation dialog), and Apply to Invoice (`CreditApplicationDialog`). Line items are displayed in a card (`CreditMemoLine[]`).

Key concepts:

* **`useCreditMemo`** — Primary data hook; fetches a single credit memo by `id` and `organizationId`.
* **`CreditMemoLine`** — Type representing a line item on the credit memo.
* **`useCreditApplications`** — Hook fetching application records linking this memo to invoices.
* **`CreditApplicationDialog`** — Component for applying the memo to a selected invoice.
* **`CreditMemoStatusBadge`** — Visual status indicator.

1. Go to `/fa/credit-memos/:id` directly or via a link from the credit memos list.
2. Review the header information, status badge, and line items.
3. Review the applications section to see which invoices this credit memo has been applied to.
4. Click Issue to call `useIssueCreditMemo` and change the status (if in draft).
5. Click Apply to open `CreditApplicationDialog` and select an invoice.
6. Use Void or Delete with confirmation dialogs as appropriate.

## Creating a credit memo

The New Credit Memo page (`/fa/credit-memos/new`) creates a credit memo for a customer. The page has a two-column layout:

* **Left (2/3):** Credit Memo Details card (`CreditMemoForm` — customer, credit memo date, credit type, optional original invoice reference, reason, notes; number auto-generated via `useGenerateCreditMemoNumber`) and Line Items card (`CreditMemoLineEditor` — line number, description, account, quantity, unit price, computed line amount).
* **Right (1/3):** Actions card (Save as Draft or Issue Credit Memo; both disabled until `formData` and at least one line are present) and Summary card (line count and total credit amount).

On submit, `useCreateCreditMemo` creates the header and `useCreateCreditMemoLine` creates each line. Navigates to `/fa/credit-memos/:id` on success.

Key concepts:

* **Credit type:** `return` (product return), `discount` (price adjustment), `error_correction` (billing error), `other`.
* **Save as Draft:** `status: "draft"` — can be edited later.
* **Issue:** `status: "sent"` — treated as issued to the customer.

1. Navigate to `/fa/credit-memos/new`.
2. Complete the **Credit Memo Details** form (customer, date, credit type, optional invoice, reason, notes).
3. Add at least one line item in the **Line Items** section (description, account, quantity, unit price).
4. Review the **Summary** card for total credit amount.
5. Click **Save as Draft** to save without issuing, or **Issue Credit Memo** to set status to `sent`.
6. On success, you are redirected to the credit memo detail page.

## 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/CreditMemosPage.tsx
  * src/cores/fa/pages/CreditMemoDetailPage.tsx
  * src/cores/fa/pages/CreditMemoCreatePage.tsx
  * src/cores/fa/hooks/useCreditMemos.ts
  * src/cores/fa/hooks/useCreditMemoLines.ts
  * src/cores/fa/hooks/useCreditApplications.ts
  * src/cores/fa/hooks/useInvoices.ts
  * src/cores/fa/components/CreditMemosTable.tsx
  * src/cores/fa/components/CreditMemoStatusBadge.tsx
  * src/cores/fa/components/CreditApplicationDialog.tsx
  * src/cores/fa/components/CreditMemoForm.tsx
  * src/cores/fa/components/CreditMemoLineEditor.tsx
</Accordion>
