Ledger card and bulk reposting — behaviour

The card query and opening balance, back-link protection, and the transaction, log, target check and rights of bulk reposting.

ledger/card returns the postings of a single ledger account in date order, paged, with a running balance. It has no own read model and uses the ledger/trialbalance model; reposting is written by the ledger/card model.

Card (list)

  • Filters: company group, client, supplier, customer, ledger account, date; the account picker is the ledger/card.accounts endpoint (list right).
  • Opening balance before the current page (getCardOpeningAtOffset), running balance per row.
  • The Back button goes to the back parameter's location, but only to an internal URL of the system.

Bulk reposting (repost)

  1. Replaces the ledger account of the selected legs (entry_item_id:net|gross) with the target; amount and debit/credit direction stay unchanged.
  2. The target must exist and be active (validateTarget: error_target_not_found, error_target_inactive); a selection and a target are required (error_no_selection, error_target_required).
  3. The two UPDATEs (entry_item.ledger_net, entry_item.ledger_gross) run in one database transaction, only on legs of the user's allowed clients (scope in the WHERE).
  4. The log (dlbtlog) also records the previous state (before).
  5. With 0 changes a warning, not success.

Data model

Table names carry the installation's own prefix in the database: entry_item (ledger_net, ledger_gross), account, gl_account_ext.

Permissions

  • list (UNMAPPED, gl_card_v1.sql): card, account picker, shared company picker (companiesByGroup).
  • repost (legacy permission table only): for reposting — list is not enough.
  • debug; content scope on the clients.