Skip to main content

Invoice Type

The Invoice Type tab configures BT-3 — the UBL InvoiceTypeCode — using a default plus an ordered list of conditional rules. The first rule whose conditions all match wins; if no rule matches, the default is used.

The override mechanism is described in the Overview.


Default invoice type​

FieldDescription
DefaultThe invoice type code used when no rule matches. Picked from the invoice-types reference list (see Configuration → Reference Lists). The most common B2B default is 380 (commercial invoice).

UNTDID 1001 codes used by the French e-invoicing reform​

CodeMeaning
380Commercial invoice.
381Credit note.
384Corrected invoice.
386Prepayment invoice (deposit / acompte).
389Self-billed invoice (auto-facture).
261Self-billed credit note.
262Consolidated credit note (remise globale).
393Factored invoice.
396Factored credit note.
471Self-billed corrected invoice.
472Factored corrected invoice.
473Self-billed factored corrected invoice.
500Self-billed prepayment invoice.
501Self-billed factored invoice.
502Self-billed factored credit note.
503Credit note for prepayment invoice.

Rule-based selection​

Below the default, a rule editor lets the type code switch dynamically based on conditions evaluated against the source data — typically the TAG_* variables already mapped in the XSL Editor.

Each rule has:

  • A logic combinator — AND (all conditions must match) or OR (any condition matches).
  • A result — the invoice type code to emit when the rule fires (picked from the same invoice-types list).
  • One or more conditions, each composed of:
    • A field — a TAG_* variable name (e.g. TAG_TOTAL_HT).
    • An operator — see the table below.
    • A value — required for eq / ne / contains / not-contains; ignored otherwise.

Operators​

OperatorMeaningValue used?
> 0 (gt0)Numeric: greater than zerono
< 0 (lt0)Numeric: less than zerono
≥ 0 (ge0)Numeric: greater than or equal to zerono
≤ 0 (le0)Numeric: less than or equal to zerono
= valeur (eq)String / numeric equalityyes
≠ valeur (ne)String / numeric inequalityyes
non vide (not-empty)Field is present and non-emptyno
vide (empty)Field is missing or emptyno
contient (contains)Field contains the valueyes
ne contient pas (not-contains)Field does not contain the valueyes

Evaluation order​

Rules are evaluated top to bottom. The first rule whose combinator-evaluated conditions match wins. The default is used only when no rule matches. Order therefore matters — put the most specific cases first. Drag a rule by its handle to reorder the list; the new order is saved with the rest of the tab.


Tips & best practices​

  • Common pattern: split invoices and credit notes by total sign. A single rule TAG_TOTAL_HT < 0 → 381 paired with default 380 is enough for most B2B billing — negative totals become credit notes.
  • Use eq against the source-system document type when available. If the source XML carries TAG_DOCUMENT_TYPE = RI for invoices and RM for credit notes, two eq-based rules give an unambiguous mapping that does not rely on numeric heuristics.
  • Rules read source values, not UBL output. The TAG_* variables refer to the variables defined in the active XSLT (see XSL Editor). Use names that exist there; names that do not are silently treated as empty.
  • Add codes to the reference list, not here. If 380 / 381 / 384 / 389 are not enough (e.g. a customised type code), add the code to the invoice-types reference list — both the default selector and the rule result selector pick it up automatically.