---
id: CAP-ACC-BAT-020
title: Post and reverse fiscal-close system batches
feature: FEAT-ACC-BAT-05
product_area: accounting
module: batches
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
- inventory CAP-ACC-BAT-015
- inventory RUL-ACC-BAT-058
- inventory RUL-ACC-BAT-059
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
- services-accounting:docs/accounting/batches.md#Unposting deletes the entries (Andrew, Reporting D7, 2026-10-21)
purpose: Fiscal close uses this module’s functions to post recognition and reverse it when a period reopens.
outcomes:
- Fiscal recognition and reopening connect schedule state with the period’s system accounting work.
concepts:
- CON-ACC-BAT-005
- CON-ACC-BAT-001
actors:
- ACT-ACC-013
- ACT-ACC-006
surfaces:
- job
permissions: []
rules:
- id: BR-CAP-ACC-BAT-020-01
  proved_by: [ATS-ACC-BAT-020-01, TST-ACC-BAT-069]
  statement: 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.
  kind: lifecycle
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: 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
  origin: none
- id: BR-CAP-ACC-BAT-020-02
  proved_by: [ATS-ACC-BAT-020-01, TST-ACC-BAT-069]
  statement: 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.
  kind: invariant
  enforced_at:
  - service
  - database
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#is
    refused with other entries (`event_key_reused`)
  origin: none
- id: BR-CAP-ACC-BAT-020-03
  proved_by: [ATS-ACC-BAT-020-02, TST-ACC-BAT-069, TST-ACC-BAT-121]
  statement: 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.
  kind: validation
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#refuses
    unbalanced entries (`entry_unbalanced`)
  origin: none
- id: BR-CAP-ACC-BAT-020-04
  proved_by: [ATS-ACC-BAT-020-03, TST-ACC-BAT-071, TST-ACC-BAT-121]
  statement: System posting and recognition admit Open and Closing periods, while system reversal and unrecognition
    admit Closed and Reopening periods.
  kind: lifecycle
  enforced_at:
  - service
  - database
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/unit/close/close-rules.spec.js#refuses system_reversal in a
    period that is open (period_not_closed)
  origin: none
- id: BR-CAP-ACC-BAT-020-05
  proved_by: [ATS-ACC-BAT-020-04, TST-ACC-BAT-072, TST-ACC-BAT-073]
  statement: 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.
  kind: calculation
  enforced_at:
  - service
  must_prove: true
  provenance: observed
  source: services-accounting:modules/batches/services/close/close-rules.ts:recogniseSchedule; services-accounting:modules/batches/services/close/revenue-recognition.ts:recognise_due_entries
  origin: none
- id: BR-CAP-ACC-BAT-020-06
  proved_by: [ATS-ACC-BAT-020-04, ATS-ACC-BAT-020-11, TST-ACC-BAT-072, TST-ACC-BAT-073]
  statement: Recognition runs in the caller’s close transaction with system posting and period state, and refuses
    execution outside a transaction.
  kind: invariant
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/close/revenue-recognition.integration.spec.js#refuses
    recognition outside a transaction (`transaction-required`)
  origin: none
- id: BR-CAP-ACC-BAT-020-07
  proved_by: [ATS-ACC-BAT-020-05, ATS-ACC-BAT-020-11, TST-ACC-BAT-018, TST-ACC-BAT-072, TST-ACC-BAT-073]
  statement: Fiscal reopening retains original system entries, adds debit-credit mirrors, reverses the posting and
    returns its batch to Open.
  kind: lifecycle
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: 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
  origin: services-accounting:docs/accounting/batches.md#Unposting deletes the entries (Andrew, Reporting D7, 2026-10-21)
- id: BR-CAP-ACC-BAT-020-08
  proved_by: [ATS-ACC-BAT-019-14, ATS-ACC-BAT-020-05, ATS-ACC-BAT-020-10, TST-ACC-BAT-018, TST-ACC-BAT-072, TST-ACC-BAT-073]
  statement: Reopening resets recognised entries dated from the period start or recognised by that period and reopens
    affected schedules while preserving unaffected earlier recognition.
  kind: lifecycle
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: 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
  origin: none
- id: BR-CAP-ACC-BAT-020-09
  proved_by: [ATS-ACC-BAT-020-06, TST-ACC-BAT-069, TST-ACC-BAT-073]
  statement: System reversal rejects an ordinary posting and returns a no-change result for a posting already reversed.
  kind: validation
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/close/reverse-system-batch.integration.spec.js#refuses
    a transaction batch's posting (`not_a_system_batch`)
  origin: none
- id: BR-CAP-ACC-BAT-020-10
  proved_by: [ATS-ACC-BAT-020-06, TST-ACC-BAT-069, TST-ACC-BAT-073]
  statement: 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.
  kind: validation
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/close/post-system-batch.integration.spec.js#refuses
    a new key while the batch is posted (`system_batch_posted`)
  origin: none
- id: BR-CAP-ACC-BAT-020-11
  proved_by: [ATS-ACC-BAT-004-14, ATS-ACC-BAT-016-14, ATS-ACC-BAT-020-07, ATS-ACC-BAT-020-08, ATS-ACC-BAT-020-09, TST-ACC-BAT-018, TST-ACC-BAT-074]
  statement: A closed period prevents ordinary unposting, and its system batch refuses all ordinary actions.
  kind: policy
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0528.spec.ts#ACT-ACC-0528
  origin: none
scenarios:
- id: SC-CAP-ACC-BAT-020-01
  given: Membership schedules include entries due in July and August, with some booked late.
  when: The close recognises the relevant due entries.
  then: August’s system batch can include earlier July-dated stragglers on their original dates.
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/close/revenue-recognition.integration.spec.js#dates
    the swept-in entries in July, in August's batch
- id: SC-CAP-ACC-BAT-020-02
  given: September’s system batch is Posted.
  when: The period reopens and closes again.
  then: Reopening resets recognition and adds system reversals, and re-close creates the next posting on the same
    batch.
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/close/revenue-recognition.integration.spec.js#posts
    September's same batch again, as its second posting
edge_cases: []
constraints:
- Month-end Close owns close and reopen orchestration, screens and period states.
depends_on:
- CAP-ACC-BAT-019
related:
- CAP-ACC-BAT-004
- CAP-ACC-BAT-016
journeys:
- JNY-ACC-BAT-005
open_questions: []
evidence:
- 'Pinned services-accounting (f47cb263), examined sources: services/close/system-batches.ts, revenue-recognition.ts,
  close-rules.ts, index.ts, services/posting-period-guard.ts, services/persistence/system-batches.ts, posting-periods.ts;
  tests integration/services/close/*.integration.spec.js, unit/close/close-rules.spec.js, unit/rules/system-batch-rules.spec.js,
  e2e/system-batches.e2e.spec.js.'
- 'Pinned react-console (baf6dae3), examined sources: journey ACT-ACC-0528 (the fiscal close''s effect on batches).'
controls: [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]
exercised_by: [FAS-ACC-BAT-04-03, FAS-ACC-BAT-05-01, FAS-ACC-BAT-05-02, FAS-ACC-BAT-05-03, FAS-ACC-BAT-05-04, FAS-ACC-BAT-05-05]
suites: [TST-ACC-BAT-018, TST-ACC-BAT-069, TST-ACC-BAT-071, TST-ACC-BAT-072, TST-ACC-BAT-073, TST-ACC-BAT-074, TST-ACC-BAT-121]
---

# 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.
