# Configure duplicate detection

Settings → Invoice Import options for duplicate grouping: require matching total, and optional match on purchase order, delivery, or quote numbers when an invoice number is missing.

Choose how Cortena **groups related documents** when the same supplier invoice (or invoice + receipt) arrives more than once. These toggles live under **Settings → Invoice Import** and work together with [Duplicates](https://help.cortena.ai/guides/invoices/duplicates).

**Who this is for:** Finance admins who decide how strict duplicate grouping should be for their tenant (invoice number only vs number + total, and optional PO / delivery / quote fallbacks).

## 1. Where to configure

1. Open **Settings → Invoice Import**.
2. Find the **Duplicate detection** section.
3. Toggle options. Each change saves immediately.

This section appears when **invoice reference numbers** are enabled for your workspace. If you do not see it, ask your Cortena contact to enable the feature for your tenant.

![Settings → Invoice Import: Duplicate detection](https://help.cortena.ai/assets/img/help/configure-duplicate-detection/01-settings-invoice-import-duplicate-detection.png)

## 2. How matching always works

Regardless of the checkboxes:

- Cortena always uses the **linked master supplier** when the creditor is matched; otherwise it uses the **extracted supplier name**.
- **Invoice number** is the **primary** match.
- **Purchase order**, **delivery**, and **quote** numbers apply **only when an invoice number is missing** on at least one of the documents.
- Matching is **same-type only** (PO to PO, delivery to delivery, quote to quote, never across types).
- If both documents have invoice numbers that **differ**, they are **not** linked via PO / delivery / quote.
- Invoice **date is not used** for duplicate matching.

For how masters, list display, receipts, and promote/clear actions work, see [Duplicates](https://help.cortena.ai/guides/invoices/duplicates).

## 3. The four options

| Option | Default | What it does |
| --- | --- | --- |
| **Require matching total amount** | On | When on, documents with the **same invoice number** must also share the **same total**. Turn off to link by invoice number alone. |
| **Match on purchase order number** | Off | When an invoice number is missing, group documents that share the same purchase order / Bestellnummer. |
| **Match on delivery number** | Off | When an invoice number is missing, group documents that share the same delivery / Lieferschein number. |
| **Match on quote number** | Off | When an invoice number is missing, group documents that share the same quote / Angebotsnummer. |

Secondary options (PO / delivery / quote) do **not** require matching totals. Only the invoice-number path uses **Require matching total amount**.

## 4. Reference numbers on the invoice

When the feature is enabled, invoice detail can show **customer**, **quote**, **purchase order**, and **delivery** numbers (under the supplier VAT ID) when extraction found them. Those fields feed the optional secondary matchers above.

Changing the **invoice number** on a document can re-run duplicate detection for that invoice. Confirm carefully if Cortena warns you.

## 5. Recommended setups

| Situation | Suggested settings |
| --- | --- |
| Default / most AP teams | **Require matching total amount** on; secondary matchers off |
| Same invoice number reused for different amounts (credit notes, instalments) | Turn **Require matching total amount** **off** only if you accept looser grouping |
| Suppliers often send delivery notes or PO confirmations without an invoice number | Enable the matching secondary number(s) you actually receive |

## Tips and limitations

- Settings apply to **new** detection runs (new imports, invoice-number edits, and tenant re-runs). Existing groups are not automatically rebuilt when you flip a checkbox.
- Duplicates still **cannot export**. Only the **master** is exportable. See [Duplicates](https://help.cortena.ai/guides/invoices/duplicates).
- You need permission to edit accounting / invoice-import settings to change these toggles.

## Quick reference

| Topic | Where / behaviour |
| --- | --- |
| Open settings | **Settings → Invoice Import → Duplicate detection** |
| Primary match | Same supplier + same invoice number (+ total if required) |
| Secondary match | Same PO / delivery / quote when enabled and invoice # missing |
| Master / list / export | [Duplicates](https://help.cortena.ai/guides/invoices/duplicates) |
| List filter | **Duplicates → Master only** |
