Default interest document — engine, async job, finalisation
Creating and refreshing the interest document with the shared engine, the limit and scope of the background job, finalisation and the readiness check.
The interest document lives in the invoice table (doc_type = 'interest'), one per base document, with period rows. Admin and the background job call the same Dlbtinterest engine.
Create and refresh (generateinterest)
- Right: core
modify+interest; module readiness (interest::ready(), with a clear message if the migration is missing:error_interest_not_ready). - For the selected invoices, or without a selection for the filtered list:
finance/interest::ensureDoc()→Dlbtinterest::ensureDoc()creates or refreshes the document in state “under calculation”. - Above 3,000 rows an asynchronous job on the cron queue:
cron_queue,job_type = interest_doc, with the filter's client; without a client it is global. The feedback says that the work runs in the background. - Response: created, refreshed and skipped counts, reasons, failed rows (with details for the
debugright).
Finalisation (finaliseinterest)
Finalises the interest document of the selected invoices (finaliseDoc($inv, 'manual')). The background job and refreshes do not change a final document; if the HUF conversion rate is aligned to the settlement day, only that changes, not the interest in the claim currency. Right: core modify + interestfinal; error: error_apply_input.
Background job (cron::interest_doc)
generateinterest queues it above the limit; the runner is the catalog-side cron, which according to the code uses the same Dlbtinterest engine.
Data model
Table names carry the installation's own prefix in the database: invoice (doc_type = 'interest'), invoice_item, interest_period, invoice_correction, cron_queue.
Permissions
The interest and interestfinal keys exist only in the legacy permission table (permission_interest_doc_v1.sql). Dependencies: finance/settlement::rule (rate), masterdata/baserate.