Loading

Document Types

A document type declares that a pair of datastores, a header and its lines, behaves as a transactional document: it has a number, a lifecycle of permitted moves, conversions into other documents and postings to the ledger and stock. Nine document types now ship ready to use, covering buying and selling end to end.

Where to find it

Admin Panel → ERP - Setup:

  • ERP Documents — the Documents console: Types & health, Documents and Output & letterhead
  • Record Numbering — how each document type is numbered, per company

Architect Panel → ERP - Setup:

  • Documents — the same console for architects
  • Document Types — the types themselves, with the row actions Transitions and Posting
  • ERP Bindings — which datastores each type's header and lines live in

The shipped types

  • Buying: Purchase Requisition, Purchase Order, Goods Receipt and Supplier Invoice.
  • Selling: Sales Quote, Sales Order, Delivery Note, Sales Invoice and Sales Credit Note.

Each comes with its datastores, numbering, status transitions, conversion map and postings, and the Purchasing, Sales and Receivables consoles are built on them. The engine still reaches every table through a binding, so an installation can point a type at its own datastores instead; see Getting Started with ERP for bindings.

What a type holds

  • Key and Name: the short code (po, sinv) and the name people see.
  • Binding Key: the binding whose header and line roles name the datastores.
  • Direction: sale, purchase or internal. It decides the sign of stock movements and postings, and which price lists apply.
  • Numbering Scheme: the scheme key used to number new documents.
  • Default Status: where a new document starts, usually Draft.
  • Lock On Status: lines become read-only at this status. It is also the point from which the document can be e-mailed.
  • Posts To Ledger and Enabled.

Numbering

Each shipped type has a scheme with the format {PREFIX}-{ENTITY}-{PERIOD}-{SEQ}: the prefix (REQ, PO, GRN, PI, QT, SO, DN, INV, CRN), the company's code, the financial year and a five-digit sequence that starts again each financial year. Change it on Record Numbering, which shows a live example of the next number. A scheme for every company gives the group one sequence (each company still prints its own code); a company with its own scheme gets its own sequence. A type with no scheme creates documents with a blank number. See Record Numbering.

The Types & health tab

Every layer between a type and a posted journal is resolved by name at run time, so a mistake shows only when somebody posts a real invoice. The Types & health tab runs that check now, for each type:

  • Lifecycle: each transition with From, To, Label, Needs permission, Fires posting and Terminal.
  • Posting: each posting action with On, Engine, Verb, Resolves to and Available. An engine marked unavailable will fail the first posting.
  • Converts into: the types it can become, from the conversion map.

Documents keyed outside the consoles

A document created in the generic datastore editor or on its record screen is held to the engine's rules: it starts at the type's opening status with the next number from its scheme, a changed status or number is refused (use the document's own actions), totals are recalculated from the lines, the company and counterparty freeze once the lines lock, and a document cannot be deleted once it has moved on or anything was made from it.

What goes wrong

  • "No document types are enabled" on the console: define a type, or tick Enabled.
  • A posting engine shows as not available: the engine named is not installed; correct the posting row.
  • New documents have no number: the type's scheme key has no number scheme. Create it on Record Numbering, which lists missing engine schemes.

Worked example

A wholesaler using the shipped types wants its own invoice numbers to restart each calendar year with the prefix "S". On Record Numbering the ERP administrator opens the SINV scheme, changes the prefix to S and the reset to each year, and checks the live example. On Types & health they confirm every posting row for Sales Invoice resolves before the first invoice of the year is posted.

Recommendations

  • Use the shipped types unless you have a real reason not to; the consoles depend on them.
  • Run Types & health after any configuration change.
  • Decide numbering before go-live; changing format mid-year confuses auditors.
  • Never type statuses; move documents with their actions.