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

# Financial Documents Overview

> Generate branded PDF Quotes, Invoices, Receipts, Refunds, Installment schedules, and order Summaries from Order and Financial Event records.

## Overview

Financial Documents let your staff hand a customer a professional, branded PDF straight from a sales record. You click one button on a record, and fusionCore opens a formatted document in a new browser tab. There is no Word export or manual formatting step.

The feature works on two kinds of records:

* An **Order** is the Salesforce record that represents a sale. From an Order you can open a **Quote**, an **Invoice**, or a **Summary** document.
* A **Financial Event** (API name `FCORE_PAY__Financial_Event__c`) is the record that represents one payment, refund, or installment against an order. From a Financial Event you can open a **Receipt**, a **Refund**, or an **Installment** document.

Financial Documents adds buttons named **View Document** and **View Summary Document** to these records. When you click one, fusionCore figures out which document type applies and renders the matching PDF.

## Document Types

| Document    | Opened from                           | Button                    |
| ----------- | ------------------------------------- | ------------------------- |
| Quote       | Order with type `Quote`               | **View Document**         |
| Invoice     | Order with type `Invoice`             | **View Document**         |
| Summary     | Order                                 | **View Summary Document** |
| Receipt     | Financial Event of type `Payment`     | **View Document**         |
| Refund      | Financial Event of type `Refund`      | **View Document**         |
| Installment | Financial Event of type `Installment` | **View Document**         |

## How the Documents Are Built

You do not need to understand the internals to use the buttons, but it helps when configuring them:

* Each document is rendered by a **Visualforce page**, used here only to produce PDF output. The package ships six: `InvoiceDocument`, `QuoteDocument`, `ReceiptDocument`, `RefundDocument`, `InstallmentDocument`, and `SummaryDocument`.
* Which Visualforce page renders a given document type, and which fields appear on it, are not hard-coded. They are driven by **Custom Metadata** records of type `FCORE_BASE__Constant__mdt`, plus **field sets**.

Because of this design, an administrator can re-point a document at a different Visualforce template, or change which fields print, without writing any code. See [Configuring Financial Documents](/end-user-guides/accounting/financial-documents/configuring-financial-documents).

## Prerequisites

Before staff can use the buttons, an administrator must do the following one-time setup:

<Steps>
  <Step title="Grant both permission sets">
    Assign the user **both** permission sets: `FS_Financial_Documents_View_Document_Actions` (which makes the buttons run) **and** `FS_Financial_Documents_VF_Pages` (which grants access to the Visualforce pages the buttons open). Both are required end to end.
  </Step>

  <Step title="Add the buttons to the record pages">
    On the **Order** Lightning record page, click the gear icon, click **Edit Page**, and add the **View Document** and **View Summary Document** actions to the page's action list. On the **Financial Event** record page, add the **View Document** action. The buttons do not appear on their own — an administrator must place them.
  </Step>
</Steps>

<Warning>
  If you assign only `FS_Financial_Documents_View_Document_Actions`, the button runs but the document fails to open with an access error. The user also needs `FS_Financial_Documents_VF_Pages` to render the PDF.
</Warning>

## Working with Financial Documents

<CardGroup cols={2}>
  <Card title="Where to find your Financial Documents" icon="file-invoice" href="/end-user-guides/accounting/financial-documents/where-to-find-your-financial-documents" arrow="true">
    Click **View Document** or **View Summary Document** on an Order or Financial Event to open the matching PDF.
  </Card>

  <Card title="Configuring Financial Documents" icon="gear" href="/end-user-guides/accounting/financial-documents/configuring-financial-documents" arrow="true">
    Swap the Visualforce template or change which fields print, using the Constant Custom Metadata records and field sets.
  </Card>
</CardGroup>

## Limitations and Common Pitfalls

The button silently fails or shows an error in several situations. Most come from guard checks in the underlying code.

### When the Order Document Will Not Open

* **No Order UUID.** If the Order's `FCORE_PAY__Order_UUID__c` is blank, you get "Order UUID cannot be blank." This UUID is set by Commerce automation, so a brand-new or unsynced Order has none yet.
* **No products.** If the Order has no line items (`OrderItem` records), you get "No products associated with this order. Financial documents are not available."
* **Unsupported Order type.** Only Orders with `FCORE_PAY__Type__c` of `Quote` or `Invoice` are supported. Any other type gives "Order Type must be Quote or Invoice."
* **Missing template.** If the matching template Constant (`FS_Quote_Document_VF_Template` or `FS_Invoice_Document_VF_Template`) has a blank value, you get "Quote/Invoice Document Template is not defined." Clearing the Constant breaks the button.

### When the Financial Event Document Will Not Open

* **No Financial Event UUID.** A blank `FCORE_PAY__Financial_Event_UUID__c` gives "Financial Event UUID cannot be blank."
* **Not approved.** Payment and Refund documents require a status of `Succeeded` (`FCORE_PAY__Status__c`). If the status is anything else, you get "Financial Event is not approved." Installment-type events skip this status check.
* **Unsupported type.** Only `Payment`, `Refund`, and `Installment` types produce a document. Other types (such as `Void` or `Adjustment`) give "Only Payment and Refund Financial Events are supported." That message text does not mention Installment, but Installment is in fact supported.

### Other Things to Watch For

* **Pop-up blockers.** Each document opens in a new browser tab. A pop-up blocker can suppress it.
* **Blank fields on the PDF.** A field you add to a field set must be readable by the user opening the document, or it renders blank.
* **Date formatting.** A field set member typed as Date is formatted as date-only. A Datetime field placed in a field set keeps its time portion.
* **Currency symbols.** Currency amounts use the document's currency symbol. When a symbol is unavailable for a currency, the document shows the ISO currency code instead of the symbol (for example, `INR`).

<Note>
  This package is built on top of Commerce (`FCORE_PAY`) and Platform (`FCORE_BASE`). It reads namespaced objects and metadata from those packages, so both must be installed for Financial Documents to work.
</Note>

## Related Features

<CardGroup cols={2}>
  <Card title="Orders" icon="cart-shopping" href="/end-user-guides/orders/orders/index" arrow="true">
    Quote, Invoice, and Summary documents open from the Order record.
  </Card>

  <Card title="Financial Events" icon="money-bill-transfer" href="/end-user-guides/orders/orders/financial-events" arrow="true">
    Receipt, Refund, and Installment documents open from a Financial Event.
  </Card>

  <Card title="Business Units" icon="building" href="/end-user-guides/accounting/business-units/index" arrow="true">
    A Business Unit's logo and billing address are the branding that prints on each document.
  </Card>

  <Card title="Installments" icon="calendar-days" href="/end-user-guides/orders/installments/index" arrow="true">
    Installment-type Financial Events produce the Installment document.
  </Card>
</CardGroup>
