# Set receivable line GL accounts

Fill AR line revenue accounts with expressions, rules, or product GL.

Use **Set line GL accounts** on a receivables workflow to fill revenue accounts on line items from product master data, derived attributes, or fixed codes.

**Who this is for:** AR process owners who need consistent revenue GL before DATEV Duo / accounting export without editing every line by hand.

## 1. Add the node

1. Open the **Receivables** workflow.
2. Add **Set line GL accounts** after issue or after [External system import](https://help.cortena.ai/guides/workflows/external-system-import-receivables).
3. Choose an **Apply mode**:

| Mode | Behaviour |
| --- | --- |
| **Empty only** | Fill lines that have no account yet |
| **Overwrite all** | Replace every line account |
| **Rules** | Ordered matchers on article code / name / number, each with its own expression |
| **Per line** | Per-line expressions; optional only-if-empty |

4. Enter a **value expression**, for example:

`${ar.product.gl_account || derived.default_revenue || '8400'}`

5. Publish. Empty resolve leaves the line unchanged. Synced / archived / cancelled receivables are skipped.

## 2. Pair with derived attributes

On receivables, **Set derived attribute** is static (no LLM). Store a fallback code with static / expression values, then reference `${derived.your_key}` in the GL expression.

See [Set derived attributes](https://help.cortena.ai/guides/workflows/set-derived-attributes) and [Show and edit derived attributes on invoices](https://help.cortena.ai/guides/workflows/show-edit-derived-attributes).

## Tips & limitations

- Writes `accountingAllocation.accountNumber` on each line: the same field export and invoice detail use.
- Keep expressions short and test with one Easybill invoice before wide publish.
- Related: [External system import for receivables](https://help.cortena.ai/guides/workflows/external-system-import-receivables); [Receivables Synced and Archived](https://help.cortena.ai/guides/advanced/receivables-synced-archived).

## Quick reference

| Task | Where |
| --- | --- |
| Configure | Receivables workflow → **Set line GL accounts** |
| Product GL | `${ar.product.gl_account}` |
| Fallback | `${derived.*}` or literal `'8400'` |
