Average rate chain recalculation — behaviour

The preview and apply modes of the average rate endpoint, the closed-period protection, the tables involved and the rights.

After a bank account or cash register, a currency and a period are chosen, the finance/transaction.avgrate endpoint calls recalcAvgRateChain(); the same call gives a preview or performs the change (preview switch).

Process

  1. The chain starts from the latest year-end revaluation; the period only narrows the rows shown.
  2. In preview nothing is written; the response gives the number of checked and changing items and the ledger differences.
  3. On apply the carrying values and the HUF value of the marked outgoing bank items are rewritten; the HUF amount of settlement rows belonging to an invoice in another currency is not changed.
  4. A closed accounting period (period_lock) is not modified; such differences are counted separately.

Data model

Table names carry the installation's own prefix in the database: transaction, transaction_item, period_lock.

Permissions

  • core modify + avgrate (legacy permission table only, permission_avgrate_v1.sql).
  • Content scope: the account's client must be in the user's scope.
  • Errors: error_avgrate_account, error_avgrate_currency, error_avgrate_failed.
Related topics: exchange rate permissions