Saving a transaction document — validation, settlement, import match
The save steps: amount normalisation, import row match, settlement limit, journal number, shared insert path, read-back, plus cash instalments and opening balances.
Saving a document (finance/transaction.save) calculates the total from the items and records through the shared addTransaction() path. Success is reported only for a document that could be read back.
Save process
- Total from the items (thousands separators normalised), also on the currency side.
- If started from a bank import row: the row exists and is not booked yet (
error_import_row_missing,error_import_row_booked), and the items match the statement line to the fillér (rowAmountParts,importRowBalance; on a mismatchCONFLICT, no save:error_import_row_balance,error_items_sum). - The open balance of settled invoices (HUF and currency) cannot be exceeded (
getInvoiceSettleRoom; only invoices in scope):error_settle_over_open,error_settle_over_open_dev,error_settle_over_total. - Journal number (
generateJournalNo),addTransaction(), read-back (error_save_not_created). - Link to the import row (
attachManualTransaction), settlements (applySettlements). - For a cash HUF register a 5-forint rounding item (
LABEL_CASH_ROUNDING).
On edit: editTransaction() + applySettlements().
Related endpoints
| Endpoint | Behaviour | Right |
|---|---|---|
cashinstallment | cash instalment on one invoice via addTransaction() (amount at most the open balance), then outstanding recalculation | core modify + edit + scope (invoice client and register company) |
settlerate, fxrate | rate on the payment date from the client's rate source and a preview of the settlement exchange difference (fxSettlementPreview) | add or edit + scope |
addlabel, removelabel | label on the document | edit |
openingbalance, openingrate | opening balance document for a bank account with a rate (addTransaction); MNB rate of the closing day | core right; scope on the client |
| form helpers | invoiceautocomplete, cashregisters, companyaccounts, clientaccounts, journalpreview, companygroup, getDueDate, getTaxData | core access or super admin; company scope where present |
Data model
Table names carry the installation's own prefix in the database: transaction, transaction_item, transaction_settlement, invoice (outstanding), transaction_import_row (through bank/bankimport), label_link, cashregister.
Known limitations
save checks only core modify, neither add nor edit. The add and edit keys are not in the seeds, so for non-super-admin users canAction(add) is false and the new document button is not shown.