Document list — filters, states, deletion and rights

The transaction list query and scope, the status endpoints, import-group deletion, the exports and the endpoints that only check core rights.

The finance/transaction module handles bank, cash and miscellaneous documents (header + items), invoice settlements, opening balances, the average rate chain and the balance blocks. Every insert goes through the shared addTransaction() method.

Data model

Table names carry the installation's own prefix in the database.

TableRole
transaction, transaction_itemdocument header and items; status values per endpoint: 0 (reset to draft), 1 (finalised), 2 (restore, re-include), 5 (excluded), 9 (trash)
transaction_settlementinvoice settlement link
bankaccount, cashregisterbank account and cash register
entryledger entries (read, export)

List

Filters: company/companies, bank account, partner, direction, type, payment type, status, date type and range, statement, import row, item name, label, source, foreign currency/HUF, overdue, with/without items. The list is narrowed to the intersection of the requested companies and the scope; an empty scope gives no rows. The list right is needed for the list, the form, the monthly turnover (monthly), the export (export, getLedgerRows, CSV/PDF; without a company group or client error_export_filter) and the downloads (download, download_www, documentInScope). The balances block is super admin or core access only.

Endpoints that only check core rights

The following only check core modify (or access), no function right and — unless noted — no content scope:

  • delete: deletes per import group; if the group has a finalised (status 1) or posted document, no member is deleted; otherwise deleteTransactionWithRollback() (settlements removed, outstanding recalculated, the import row becomes “New” when the last member is deleted).
  • finalizeselected: bulk finalisation (status 1), then invoice and bank account balance recalculation.
  • statusnull (0), statusdisable (9), statusenable (2), statusexclude (5), statusinclude (2), statuscontirnull (2 + item coding status 0), togglestatus.
  • cashpay: finalises a draft document as a cash payment (markCashPayment), scope on the cash register's company.
  • unlinksettle: detaches an invoice (unlinkSettlement).
  • updateinvoicedata: sets the header total to the sum of the items.
  • csv: RLB import file (Dlbtrlb::header/row), Windows-1252 encoded.
  • deleteitems, deletecontirs: delete items and codings — core access only.
  • truncateTableTransaction: empties transaction, transaction_item, transaction_document, transaction_import_row, transaction_import_staged; truncateTableTransactionContirs: empties entry, entry_item and resets the coding status of every invoice — both core modify only.

Permission keys

  • list (UNMAPPED), debug (SQL and EXPLAIN; not in the seeds).
  • statusdelete (BASE) exists only in the seed; trashing (statusdisable) checks only core modify.
  • The import row link depends on canSee and canAction for bank/bankimport::list.

Known limitations

The status, delete and truncate endpoints ask for no function right, only the base modify right; the truncating endpoints remove every row from the tables concerned.