How Recurring Journals Are Processed
AccuArk automatically generates journal entries from your recurring templates. This guide explains the processing logic, timing, and how to monitor what has been generated.
When Processing Occurs
Recurring journal templates are processed automatically when AccuArk starts up. Each time the application launches, the RecurringJournalService checks all active templates to see if any entries need to be generated.
Processing Logic
For each active template, the service checks:
- Is the template active? — Inactive templates are skipped
- Has the next run date passed? — If the next run date is in the future, the template is skipped
- Has the end date passed? — If the template has an end date and it has passed, no more entries are generated
- Generate the entry — Creates a journal entry using the template's line items, with the transaction date set to the next run date
- Advance the next run date — Calculates the next occurrence based on the frequency (for example, adds one month for Monthly)
- Log the generation — Records the event in the recurring_journal_log table
Catch-Up Processing
If AccuArk was not running for an extended period (for example, over a weekend or holiday), multiple entries may need to be generated. The service handles this by processing in a loop:
- It generates the entry for the next run date
- Advances the next run date
- Checks again if the new next run date has also passed
- Continues until the next run date is in the future
This ensures no entries are missed even if AccuArk was offline for days or weeks.
Atomicity and Safety
Each generated entry is processed within a database transaction:
- The journal entry is created
- Account balances are updated
- The template's next run date is advanced
- All three operations commit together
If anything fails, the entire operation rolls back and the template remains at its current next run date. This prevents partial entries or duplicate entries from being created.
An idempotency key prevents the same template from generating duplicate entries for the same date even if processing runs twice.
Viewing the Recurring Journal Log
The recurring_journal_log table records every entry that was generated:
- Template ID — Which template generated the entry
- Transaction ID — The transaction that was created
- Generated At — When the entry was generated
This log provides a complete history of all automatically generated entries.
How Frequency Affects Scheduling
| Frequency | Next Run Date Calculation |
|---|---|
| Daily | Adds 1 day |
| Weekly | Adds 7 days |
| Bi-Weekly | Adds 14 days |
| Monthly | Adds 1 calendar month |
| Quarterly | Adds 3 calendar months |
| Annually | Adds 1 year |
Tips
- Start AccuArk regularly — Since processing occurs at startup, make sure AccuArk is launched at least once per day to keep recurring entries on schedule
- Monitor the log — Periodically review the recurring journal log to verify entries are being generated as expected
- Deactivate before editing — If you need to change a template's line items or frequency, consider deactivating it first, making changes, then reactivating it to avoid unexpected entries during the edit