# Sales

> Post invoices and credit notes, write off bad debts, and set per-customer credit limits, holds, and defaults.

Sales in Accounting are your customer invoices and credit notes, plus the customer records they belong to. Accounting uses the same invoices as **Commerce → Invoices**: an invoice created in either place is the same document, and it posts to the ledger when it is opened.

The Accounting screens add what a bookkeeper needs: the receivable and income accounts, the tax breakdown, a ledger preview, and stock posting.

## Invoices

Open **Accounting → Invoices**. The list has tabs for common views (such as drafts, open, overdue, and credit notes) plus filters for status, type, and dates. Click **New Invoice** to create one.

### Create and post an invoice

1. Choose **Customer type** (**Customer company** or **Individual customer**) and the **Customer**.
2. Set the **Invoice date** and choose **Payment terms**, or **Custom due date** and a **Due date**.
3. Choose the **Currency**. For a foreign currency, check the **Exchange rate** (see [Currency and exchange rate](#currency-and-exchange-rate)).
4. Add lines. Click the product cell to pick a catalog product or variant, or use **Add custom line** for a free-text line.
5. Click **Save draft**.
6. When the draft is complete, click **Post invoice**.

Posting writes the journal entry and makes the invoice payable. After that the invoice can only be corrected with a credit note or a void. If something required is missing, a **Complete the required fields** list tells you what.

Choosing a customer applies their accounting settings to a new invoice: their currency, receivable account, price list, tax exemption, and payment terms. See [Customer settings](#customer-accounting-settings).

### Accounting details

Expand **Accounting details** to see and change how the invoice posts:

- **Debit To (Accounts Receivable)** is the receivable account the customer balance goes to. It must be a receivable account. Later payments, credit notes, write-offs, aging, and statements all follow the same account.
- Each line has an **Income account** and, when discounts post separately, a **Line discount account**.
- **Tax breakdown** shows each tax rate's taxable amount, tax amount, and the account it posts to (from [Posting defaults](https://workstation.repzo.com/docs/commerce/accounting/chart-of-accounts#account-mappings)).
- **Draft ledger preview** shows the exact journal entry, and whether it balances, before you post.

A posted invoice shows the same information read-only.

### Currency and exchange rate

Each invoice has a currency and an exchange rate to the company's base currency. The rate defaults to the latest recorded rate **on or before the invoice date**, so an invoice dated last month uses last month's rate. The hint under the field shows which rate was used, for example `1 EUR = 4.05 SAR · rate of 2026-08-31`.

- Type a different rate if you need to. It is kept until you change the currency or date. Click **Use rate of …** to go back to the recorded rate.
- If no rate is recorded on or before the date, Workstation warns you and uses the current rate.

The invoice shows amounts in its own currency. The ledger always records them in the base currency.

### Update stock

Turn on **Update stock** when the invoice also delivers tracked products. Choose the **Inventory location** and check the **Stock impact** table (available quantity and estimated cost of goods sold).

When the invoice posts, stock is issued first, then the invoice and its Cost of Goods Sold and Inventory entries are written together. If stock is short or anything fails, nothing changes and the invoice stays a draft. A posted Update stock invoice cannot be edited or deleted; use a credit note or a void.

### Deferred revenue

For a service delivered over time, tick **Defer over service period** on a line and choose its start and end dates. The revenue then posts to a deferred revenue account and is recognized over the period. See [Deferred revenue](https://workstation.repzo.com/docs/commerce/accounting/ledger#deferred-revenue).

### After posting

A posted invoice offers:

- **Record payment** opens a new payment for this customer, allocated to this invoice. See [Payments](https://workstation.repzo.com/docs/commerce/accounting/payments).
- **Create credit** creates a credit note against it.
- **Void invoice** reverses it completely.
- **View ledger** (in the **⋯** menu) opens the General ledger filtered to its entries.

### Editing and voiding a posted invoice

Voiding reverses the invoice's payments recorded in the CRM, its stock movement, and its journal entry, dated today. Voiding is not possible while ZATCA is connected, while a posted payment in Accounting is allocated to the invoice, or while the invoice is written off.

Editing a posted invoice is only possible when your invoice settings allow it and the invoice has no payments, allocations, write-off, or stock posting. Workstation then reverses the old entry and posts a new one. It never changes the original lines.

## Credit notes

A credit note reduces what a customer owes, for example for returned goods or an overcharge.

**Against an invoice.** On a posted invoice, click **Create credit**. Enter a **Reason** and the quantity to credit on each line (you cannot credit more than was invoiced, including earlier credits), then click **Create and post credit**. The credit note posts immediately and copies the invoice's customer, currency, rate, accounts, and stock settings. If the invoice updated stock, the returned quantity goes back to the same location.

**Standalone.** In the invoice editor, tick **This is a customer credit (you owe the customer back)**, then save and post it like an invoice.

A credit note posts the mirror of an invoice: it credits Accounts Receivable and debits Sales Returns (or the line's account) and tax.

### Applying credit to invoices

A credit note created from an invoice (with **Create credit**, or a return, including POS returns) is applied to that invoice automatically when it posts. It reduces the invoice's balance and installments, and anything left over stays as customer credit.

To use unapplied credit on other invoices, click **Apply credit** on the credit note, or on the customer's **Accounting** tab next to **Unapplied credits**. Then:

1. Enter the **Credit to use** on each open invoice. You can split it across several invoices of the same customer and currency.
2. Check the **Application date**. It defaults to today and cannot be earlier than either document. Locked periods are refused.
3. Click **Apply credit**.

Each application posts a balanced ledger entry with the source **Credit application** (you can filter for it in **Journal entries**). If the two documents were posted at different exchange rates, the difference goes to **FX Gain/Loss**.

Both documents list their **Credit applications**. **Unapply** reverses one, dated today. Voiding either document reverses its applications, and an issued invoice with applied credit cannot be edited until the credit is unapplied.

An invoice fully covered by credit shows as **Paid**. Its **Paid** row counts cash payments only, so the amount covered by credit is shown under **Credit applications**.

Use **Record refund** on a credit note to pay the money back instead.

## Write-offs

When an invoice will not be paid, write it off as bad debt:

1. Open **Reports → Receivables aging** and click the customer.
2. In the list of open documents, click **Write off** on the invoice.
3. Confirm.

The outstanding amount moves from Accounts Receivable to Bad Debt, dated today. The invoice keeps its **Open** status but its amount due becomes zero, it stops counting as a receivable, and its totals show a **Written off** row.

While an invoice is written off, it cannot be edited or voided. If the customer pays after all, open the invoice in **Accounting → Invoices** and click **Reverse write-off** (this needs the Sales manage permission). The bad-debt entry is reversed on today's date and the amount is due from the customer again, so the invoice can be paid, edited, or voided as usual.

## Customers

**Accounting → Customers** lists every company (Account) and every standalone Contact. A contact who belongs to a company is represented by that company, so a customer is never counted twice. The list shows outstanding and overdue amounts, credit limit, open invoices, and last payment, and marks customers **On hold**.

Open a customer to see their **Accounting** tab: outstanding, overdue, credits, open documents, recent ledger activity, their default payment terms, and their accounting settings. Click **Open in CRM** to jump to the full CRM record if your role allows it.

Customers are created in the CRM, not in Accounting. See [Accounts](https://workstation.repzo.com/docs/sales/accounts) and [Contacts](https://workstation.repzo.com/docs/sales/contacts).

## Customer accounting settings

Some defaults can be changed for one customer. On the customer's **Accounting** tab, click **Edit** on **Accounting settings**. Anything you leave on **Company default** keeps following the company-wide value, so a later company change still reaches that customer. Settings are stored per company: the same customer can have different terms in two legal entities.

| Setting | What it does |
|---|---|
| Credit limit | Maximum open receivables. Leave empty for no limit. |
| When the limit is exceeded | **Warn**, **Block**, or **Don't check this customer**, instead of the company policy. |
| Put customer on credit hold | Stops posting new invoices and on-account POS sales. Drafts can still be saved and payments are still accepted. |
| Release on | The hold lifts automatically on this date. |
| Invoice currency | Pre-selected on new invoices. |
| Receivable account | The **Debit To** account for new invoices, for example a separate account for related-party receivables. |
| Price list | Pre-selected on new invoices; newly added products take the list price. |
| Tax exempt | Invoice lines for this customer use the zero-tax rate. |

### Credit limits and holds

The company-wide policy is under **Accounting settings → General → Customer credit limits**: **Do not check**, **Warn before posting** (default), or **Block · Managers can override**. A customer's own setting wins.

A customer's exposure is their open invoices in the base currency, less open credit notes. When posting would take them over their limit:

- **Warn** shows a warning in the invoice editor's post dialog. You can still post.
- **Block** stops posting. An owner, an admin, or a user with `accounting.manage` or `accounting.sales_manage` can post anyway by entering an **Override reason**, which is recorded in the audit log. The override is available in the Accounting invoice editor; other screens, including POS, simply block.

A credit hold is stricter: it blocks posting regardless of the limit, until it is released or its **Release on** date arrives.

## Related pages

- [Invoices](https://workstation.repzo.com/docs/commerce/invoices)
- [Payments](https://workstation.repzo.com/docs/commerce/accounting/payments)
- [Receivables aging and customer statement](https://workstation.repzo.com/docs/commerce/accounting/reports#receivables-and-payables-aging)
- [Chart of accounts and settings](https://workstation.repzo.com/docs/commerce/accounting/chart-of-accounts)
