Skip to content

CAP-ACC-BAT-020Post and reverse fiscal-close system batches

Markdown

CAP-ACC-BAT-020

Post and reverse fiscal-close system batches

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaAccountingModuleBatch ManagementRevision1

Read atservices-accounting f47cb263react-console baf6dae3

Post and reverse fiscal-close system batches ​

Purpose ​

Fiscal close uses this module’s functions to post recognition and reverse it when a period reopens.

How It Works ​

The close process calls the system-posting and recognition functions within its transaction. Those functions collect due entries and produce the period’s system batch. Event identity prevents a repeated close from writing another result. System batches remain outside the ordinary batch actions. Reopening writes mirrors of their entries and resets the affected recognition. The close module owns the surrounding job, screens and fiscal-period lifecycle.

Relationships ​

  • Prerequisite: Plan deferred revenue and adjust its remaining releases, which addresses the connected batch work.
  • Related outcome: Use the batch’s permitted lifecycle actions, which addresses the connected batch work.
  • Related outcome: Unpost a batch for correction and replacement posting, which addresses the connected batch work.

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Fiscal recognition and reopening connect schedule state with the period’s system accounting work.
Surfaces
job
Constraints
Month-end Close owns close and reopen orchestration, screens and period states.
Intent sources
services-accounting:docs/accounting/batches.md#Unposting deletes the entries (Andrew, Reporting D7, 2026-10-21)

Controls

18 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-005 TC-IAM-006 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-DAT-001 TC-DAT-004 TC-LOG-002 TC-LOG-003 TC-LOG-005 TC-PI-002 TC-PI-003 TC-PI-005

Business Rules

11 rules, 11 to be proved before approval. A rule's product intent is derived from its origin: 0 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
Fiscal close posts one system batch per type, unit and period using its supplied name and date, and a later re-close reuses that batch with a new posting.
lifecycleservicetest
services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#writes the batch already posted, in the period, named and dated as given
02must prove
Proposed
Repeated close event keys return the original batch and posting without writing, while reusing a key for different entries or a different period is refused.
invariantservice, databasetest
03must prove
Proposed
System posting requires entries balanced on the unit’s accounts in base and transaction amounts, within two-decimal validation, dated in the period and without duplicate entry references.
validationservicetest
04must prove
Proposed
System posting and recognition admit Open and Closing periods, while system reversal and unrecognition admit Closed and Reopening periods.
lifecycleservice, databasetest
services-accounting:modules/batches/tests/unit/close/close-rules.spec.js#refuses system_reversal in a period that is open (period_not_closed)
05must prove
Proposed
Recognition takes current open schedules booked by the period end, releases all unrecognised entries due by then including earlier stragglers, and closes schedules fully recognised.
calculationserviceobserved
06must prove
Proposed
Recognition runs in the caller’s close transaction with system posting and period state, and refuses execution outside a transaction.
invariantservicetest
07must prove
Proposed
Fiscal reopening retains original system entries, adds debit-credit mirrors, reverses the posting and returns its batch to Open.
origin: services-accounting:docs/accounting/batches.md#Unposting deletes the entries (Andrew, Reporting D7, 2026-10-21)
lifecycleservicetest
services-accounting:modules/batches/tests/integration/services/close/reverse-system-batch.integration.spec.js#writes a reversing entry for each entry, debits and credits swapped, and keeps the originals
08must prove
Proposed
Reopening resets recognised entries dated from the period start or recognised by that period and reopens affected schedules while preserving unaffected earlier recognition.
lifecycleservicetest
services-accounting:modules/batches/tests/integration/services/close/revenue-recognition.integration.spec.js#un-recognizes A's and B's September entries and opens both schedules again
09must prove
Proposed
System reversal rejects an ordinary posting and returns a no-change result for a posting already reversed.
validationservicetest
10must prove
Proposed
A system batch with a current posting rejects a new close key, and system-batch creation cannot take another batch’s name within the unit.
validationservicetest
11must prove
Proposed
A closed period prevents ordinary unposting, and its system batch refuses all ordinary actions.
policyservicetest

Scenarios

IdGivenWhenThenProvenance
01Membership schedules include entries due in July and August, with some booked late.The close recognises the relevant due entries.August’s system batch can include earlier July-dated stragglers on their original dates.test
02September’s system batch is Posted.The period reopens and closes again.Reopening resets recognition and adds system reversals, and re-close creates the next posting on the same batch.test

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.