Automatic account coding — process and rights
Collecting the invoice’s coding input, building the coding proposal, recording the ledger entry and changing the posting type.
Account coding (finance/invoice.makeentry) builds a proposal according to the invoice's typeofcontir type with the contir library and records it as a ledger entry.
Process
- Collect the invoice's coding input (
getContirInput). - Proposal with the type's adapter (
contir->build); the general adapter uses thecontir_rulerule store, the type adapters thecontir_configparameters. - Recording:
finance/entry::saveEntryPayload()(entryheader +entry_itemlines). - For lease/subscription invoices the validity period is written back (
setPassValidity; missing period:error_lease_period). - Warnings are returned, temporary files are cleaned up.
Posting type (savetypeofcontir)
Sets the invoice's typeofcontir field to a value from the shared Company::CONTIR_TYPES list (saveTypeofcontir); an invalid value gives error_contirtype_input.
Data model
Table names carry the installation's own prefix in the database: entry, entry_item, invoice (typeofcontir), contir_rule.
Permissions
| Endpoint | Right |
|---|---|
makeentry | core modify + accounting (SUBSCRIPTION) + invoiceInScope; error: error_invoice_id |
savetypeofcontir | contirtype (legacy permission table only; edit does not replace it) + invoiceInScope |