# Invoices

> Create customer invoices, split them into payment plans, record payments, print branded PDFs, issue returns, and report to ZATCA.

Invoices track what a customer owes, what has been paid, and which commercial records produced the charge. They are customer records; [Billing](https://workstation.repzo.com/docs/commerce/billing) is the separate Configuration page for the organization's Workstation subscription.

Invoices are also created for you by [Appointment Checkout](https://workstation.repzo.com/docs/engagement/appointment-checkout), the [Point of Sale](https://workstation.repzo.com/docs/pos), and [Subscriptions](https://workstation.repzo.com/docs/commerce/subscriptions), and you can create one from an [Order](https://workstation.repzo.com/docs/commerce/orders) or a [Price Offer](https://workstation.repzo.com/docs/sales/price-offers).

## Create an invoice

1. Open **Commerce → Invoices** and click **New Invoice**.
2. Pick the customer in the Contact card. The contact's Account is linked automatically.
3. Click **Add product** or **Add custom item**, then set the unit price and quantity on each line.
4. Use **Add discount** for a percentage or fixed discount. Estimated tax is calculated from each product's tax rate, and tax-exempt customers are not charged tax.
5. Optionally turn on **Payment plan** to split the invoice into installments (see below).
6. In **Invoice settings**, set the currency, billing cycle, owner, issue date, and due date. Add notes and payment terms if needed.
7. Click **Create invoice** to issue it, or **Save draft** to finish it later.

The invoice number is assigned automatically from your numbering settings. The fields on the create form follow the layout your admins set in [Objects](https://workstation.repzo.com/docs/administration/objects).

## Status and amounts

The stored statuses are **Draft**, **Open**, **Paid**, and **Voided**. An open invoice is also shown as **Overdue** after its due date, or **Partially Paid** once some money has been received.

Invoice totals can include subtotal, discount, tax, tip, total, amount paid, and amount due.

## Payment plans

A payment plan splits one invoice into a down payment and a series of installments. The invoice stays a single document; only the schedule changes.

To add a plan, turn on **Payment plan** when creating the invoice, or open the invoice's **Payment** tab and click **Set up payment plan**. Then set:

- **Down payment**, as an amount or a percent of the total, and its due date (**Down payment due**);
- **Number of installments**;
- **Frequency**: Weekly, Every two weeks, Monthly, or Every three months;
- **First installment due**.

The **Payment schedule** table shows each installment with its due date, amount, amount paid, and status (Upcoming, Due soon, Overdue, Partially Paid, or Paid). Click **Record** on a row to pay that installment.

Payments are always applied to the earliest unpaid installment first. If you **Edit plan** after money has been received, the payments are re-applied to the new schedule, oldest first. **Remove plan** deletes the schedule but keeps the recorded payments, and the full balance becomes due on the invoice's due date.

Add the **Payment schedule** block to an invoice print template to print the plan on the PDF.

## Record a payment

Open the **Payment** tab and click **Record payment**. Enter the amount, payment date, payment method, an optional reference number, and notes. Workstation recalculates the amount due and marks the invoice paid when the balance reaches zero. Users with permission can delete an incorrect payment with **Delete Payment** and record it again.

The available payment methods come from **Settings → Finance → Payment Methods**. When your workspace has Client Loyalty, **Gift card** (enter the card code) and **Store credit** (for invoices with a customer) also appear. Credit notes can refund to store credit, but not onto a gift card. See [Gift Cards](https://workstation.repzo.com/docs/commerce/gift-cards).

Every payment also appears in [Payments](https://workstation.repzo.com/docs/commerce/payments).

When [Accounting](https://workstation.repzo.com/docs/commerce/accounting) is enabled, opening an invoice and recording or removing payments also create balanced journal entries. The invoice's **Accounting** card lists those entries and links to each one; it says **Not posted to the ledger** when nothing has posted. The same invoices appear in **Accounting → Invoices**. See [Accounting sales](https://workstation.repzo.com/docs/commerce/accounting/sales) and [Accounting payments](https://workstation.repzo.com/docs/commerce/accounting/payments).

## Invoice record and actions

The record has **Details**, **Payment**, **Comments**, and **Timeline** tabs. Depending on status, settings, and permissions, the header can show:

| Action | When it appears |
|---|---|
| **Preview** / **Download PDF** | Always. The PDF is generated in the background and appears in the downloads center. |
| **Edit** | Drafts, or open invoices with no payments when **Allow invoice editing** is on. |
| **Open invoice** | Drafts. Issues the invoice. |
| **Delete** | Drafts, or invoices with no payments when **Allow invoice deletion** is on. |
| **Record payment** | Open invoices with an amount due. Credit notes show **Record refund**. |
| **Create return** | Issued invoices with quantities left to return. |
| **Void Invoice** | Issued invoices. Voided invoices cannot be edited or receive payments. |
| **Submit to ZATCA** / **Retry ZATCA** | When ZATCA is connected and the invoice has not been accepted yet. |

### Returns

**Create return** opens a dialog listing each line with its original, returned, and remaining quantity. Enter the quantities to return and a **Return Reason**. Workstation creates a credit note linked to the original invoice. When ZATCA is connected, the credit note is queued for ZATCA automatically.

## Print templates and the invoice PDF

The invoice PDF uses a print template from **Settings → Templates & Automation → Print Templates**. The default template is used unless you pick another one in the **Print Template** card on the invoice.

### Edit one invoice's document

Sometimes one customer needs different wording on their invoice. Under the **Print Template** card, click **Customize for this invoice** to open the document editor. Changes there apply to this invoice only; the template stays the same. A **Customized** badge shows the invoice has its own wording, and you can reset it to the template at any time.

Blocks that are locked in the template cannot be changed. Changing the wording does not change the invoice's amounts or ZATCA data, so it stays available after the invoice is issued. This needs the **Edit document** permission (`invoices.edit_document`).

## ZATCA e-invoicing

Saudi businesses can report invoices to ZATCA (FATOORA) through the **ZATCA** app in [Marketplace](https://workstation.repzo.com/docs/configuration/marketplace). Connecting it asks for a FATOORA OTP, the environment (simulation or production), the invoice profile, and the organization's tax details such as Tax Number, CRN number, and address.

Once ZATCA is connected:

- New open invoices use SAR, and a customer Contact is required.
- With **Report invoices automatically** on (the default), every issued invoice, including appointment checkouts, is sent to ZATCA as soon as it is opened. When it is off, use **Submit to ZATCA** on each invoice.
- Simplified invoices are reported. Standard invoices are sent for clearance and need the buyer's Saudi VAT number and address.
- The **ZATCA** card on the invoice shows the environment, counter, submission status, and the ZATCA QR code. The QR code can also be printed on the PDF.
- Voiding is disabled. Use **Create return** to issue a credit note instead.
- Editing open invoices, deleting issued invoices, and changing invoice numbering are locked to protect the e-invoice chain.

Rejected submissions are listed in the ZATCA app's logs with ZATCA's response. Fix the problem, then use **Retry ZATCA** on the invoice.

## Invoice settings

Admins manage numbering and edit rules in **Settings → Finance → Invoice Settings**:

- **Next invoice number**, **Edit prefix**, and **Update starting point for invoice numbers**.
- **Allow invoice editing**: open invoices can be edited until a payment is recorded.
- **Allow invoice deletion**: invoices can be deleted unless a payment is recorded. Deletion cannot be undone.

## Find and manage invoices

Use the **All invoices**, **My invoices**, **Open**, and **Unpaid** tabs, or save a [table view](https://workstation.repzo.com/docs/administration/table-views) with your own filters and columns. Clicking a row opens the invoice in a side panel. With the required permissions, bulk actions can edit, assign, create tasks for, or delete invoices. Export is available for offline review.

### Reports

The **Reports** tab next to **Records** summarizes invoices without leaving the module. Start from a template such as **Invoice overview**, **By account**, **By owner**, or **Outstanding invoices**, then change filters, grouping, measures (total invoiced, collected, outstanding, and more), and the chart. Save the result as a report, or export it. **Create report from view** turns the list's current filters into a report. Reports need the `reports.view` permission.

## Permissions

| Permission | Allows |
|---|---|
| `invoices.view` | See invoices and payments |
| `invoices.create` | Create invoices |
| `invoices.update` | Edit invoices, record payments, and manage payment plans |
| `invoices.delete` | Delete invoices |
| `invoices.edit_document` | Customize one invoice's printed document |

## Related pages

- [Payments](https://workstation.repzo.com/docs/commerce/payments)
- [Orders](https://workstation.repzo.com/docs/commerce/orders)
- [Subscriptions](https://workstation.repzo.com/docs/commerce/subscriptions)
- [Gift Cards](https://workstation.repzo.com/docs/commerce/gift-cards)
- [Accounting](https://workstation.repzo.com/docs/commerce/accounting)
- [Accounting sales](https://workstation.repzo.com/docs/commerce/accounting/sales)
- [Appointment Checkout](https://workstation.repzo.com/docs/engagement/appointment-checkout)
- [Marketplace](https://workstation.repzo.com/docs/configuration/marketplace)
