---
id: CAP-ACC-BKS-015
title: Select templates for business documents
feature: FEAT-ACC-BKS-05
product_area: accounting
module: books
revision: 1
status: draft
product_intent: confirmed
implementation_evidence: partially-observed
supersedes: []
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - >-
    services-accounting:docs/milestones/plans/ACCT-M1-plan.md#3. How it works
    for the user
  - 'services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D2'
purpose: >-
  Controllers connect prepared templates to document production and preserve
  choices in use.
outcomes:
  - >-
    Resolution selects explicit, configured or built-in content while excluding
    inactive templates.
  - Assignments protect the templates that document production still uses.
concepts:
  - CON-ACC-BKS-004
  - CON-ACC-BKS-001
actors:
  - ACT-ACC-001
  - ACT-ACC-004
surfaces:
  - console
  - api
preconditions: []
postconditions: []
permissions:
  - key: accounting.business-units.update
    where_checked: api
    scope: tenant
  - key: accounting.settings.update
    where_checked: api
    scope: tenant
  - key: accounting.document-templates.read
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-ACC-BKS-015-01
    proved_by: [ATS-ACC-BKS-015-01, ATS-ACC-BKS-015-09, TST-ACC-BKS-165]
    statement: >-
      Resolution prefers an explicit template, then the unit’s kind-specific
      choice or workspace statement default, then the built-in, with batch
      downloads using the unit’s software-package format.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/books/tests/unit/document-templates/resolution.spec.js#uses
      the unit’s invoice template
    origin: none
  - id: BR-CAP-ACC-BKS-015-02
    proved_by: [ATS-ACC-BKS-015-02, TST-ACC-BKS-165]
    statement: >-
      A missing, wrong-kind or inactive explicit template is refused rather than
      silently substituted.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/books/tests/unit/document-templates/resolution.spec.js#refuses
      an inactive template named explicitly, in Rhythm 1.0’s words
    origin: none
  - id: BR-CAP-ACC-BKS-015-03
    proved_by: [ATS-ACC-BKS-015-03, TST-ACC-BKS-165]
    statement: >-
      A unit using QuickBooks Online or Other without its own download template
      receives the legacy no-format refusal.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/books/tests/unit/document-templates/resolution.spec.js#refuses
      a download for a QuickBooks Online unit, whose entries Rhythm 1.0 pushed
      through its API
    origin: none
  - id: BR-CAP-ACC-BKS-015-04
    proved_by: [ATS-ACC-BKS-001-18, ATS-ACC-BKS-002-15, ATS-ACC-BKS-003-12, ATS-ACC-BKS-015-04, ATS-ACC-BKS-016-15, TST-ACC-BKS-051, TST-ACC-BKS-052]
    statement: >-
      Unit document choices and the statement default accept only active
      same-workspace templates of the matching kind; empty choices mean built-in
      and explicit built-in identifiers are refused.
    kind: validation
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/books/tests/e2e/document-templates.e2e.spec.js#answers
      400 to a business unit naming an inactive template
    origin: none
  - id: BR-CAP-ACC-BKS-015-05
    proved_by: [ATS-ACC-BKS-014-09, ATS-ACC-BKS-014-12, ATS-ACC-BKS-015-05, ATS-ACC-BKS-015-11, ATS-ACC-BKS-017-08, TST-ACC-BKS-020, TST-ACC-BKS-021, TST-ACC-BKS-052, TST-ACC-BKS-082]
    statement: >-
      Templates referenced by units or the statement default cannot be deleted
      or deactivated, and reads identify their users.
    kind: invariant
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/books/tests/e2e/document-templates.e2e.spec.js#answers
      409 to deleting the business unit’s template, naming the unit
    origin: none
  - id: BR-CAP-ACC-BKS-015-06
    proved_by: [ATS-ACC-BKS-015-02, TST-ACC-BKS-165]
    statement: >-
      The shared resolver never renders an inactive template for any document
      kind.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/books/tests/unit/document-templates/resolution.spec.js#refuses
      an inactive statement template named explicitly, which Rhythm 1.0 rendered
    origin: none
  - id: BR-CAP-ACC-BKS-015-07
    proved_by: [ATS-ACC-BKS-015-06, TST-ACC-BKS-082]
    statement: >-
      Omitting a unit template choice on replacement restores that kind’s
      built-in choice.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/books/tests/integration/services/persistence/document-templates.integration.spec.js#returns
      a unit to the built-in when a replacement leaves its reference out
    origin: none
  - id: BR-CAP-ACC-BKS-015-08
    proved_by: []
    statement: >-
      Which document producers adopt the shared resolution order remains
      unestablished within this module’s permitted source scope.
    kind: policy
    enforced_at: []
    must_prove: false
    provenance: unknown
    source: FND-ACC-BKS-031
    origin: none
scenarios:
  - id: SC-CAP-ACC-BKS-015-01
    given: A chapter has selected a customer invoice template.
    when: The controller requests deletion and then deactivation of that template.
    then: Both requests identify the chapter and refuse the change.
    provenance: test
    source: >-
      react-console:acceptance/accounting/playwright/journeys/configuration/ACT-ACC-0026.spec.ts#ACT-ACC-0026
  - id: SC-CAP-ACC-BKS-015-02
    given: The unit selects QuickBooks Online as its software.
    when: A download is resolved with no customer template selected.
    then: Resolution refuses because no built-in file format applies.
    provenance: test
    source: >-
      services-accounting:modules/books/tests/unit/document-templates/resolution.spec.js#refuses
      a download for a QuickBooks Online unit, whose entries Rhythm 1.0 pushed
      through its API
edge_cases: []
constraints: []
depends_on:
  - CAP-ACC-BKS-014
  - CAP-ACC-BKS-001
related:
  - CAP-ACC-BKS-017
journeys:
  - JNY-ACC-BKS-004
open_questions: []
evidence:
  - >-
    Verified source file:
    react-console:acceptance/accounting/playwright/journeys/configuration/ACT-ACC-0026.spec.ts
  - 'Verified source file: services-accounting:aws/accounting.service.ts'
  - >-
    Verified source file:
    services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md
  - >-
    Verified source file:
    services-accounting:docs/milestones/plans/ACCT-M1-plan.md
  - >-
    Verified source file:
    services-accounting:modules/books/db/business-units.table.ts
  - >-
    Verified source file:
    services-accounting:modules/books/db/document-templates.table.ts
  - >-
    Verified source file:
    services-accounting:modules/books/tests/e2e/document-templates-security.e2e.spec.js
  - >-
    Verified source file:
    services-accounting:modules/books/tests/e2e/document-templates.e2e.spec.js
  - >-
    Verified source file:
    services-accounting:modules/books/tests/integration/services/persistence/document-templates.integration.spec.js
  - >-
    Verified source file:
    services-accounting:modules/books/tests/unit/document-templates/resolution.spec.js
controls: [TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-DAT-001, TC-DAT-004, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-PI-001, TC-PI-003, TC-PI-005]
exercised_by: [FAS-ACC-BKS-05-01, FAS-ACC-BKS-05-02, FAS-ACC-BKS-05-03, FAS-ACC-BKS-05-04, FAS-ACC-BKS-05-05, FAS-ACC-BKS-06-02]
suites: [TST-ACC-BKS-020, TST-ACC-BKS-021, TST-ACC-BKS-051, TST-ACC-BKS-052, TST-ACC-BKS-082, TST-ACC-BKS-165]
---

# Select templates for business documents

## Purpose

Controllers connect prepared templates to document production and preserve choices in use.

## How It Works

The controller chooses a saved template in the business unit’s document settings. Statement selection instead belongs to the workspace settings. The resolver supplies the content appropriate to a requested document kind. An explicit unusable choice produces a refusal for the caller to address. Staff can inspect which units or settings still depend on a template. Removing those choices frees an obsolete template for deletion. The product should verify adoption of the resolver in each owning document workflow before promising consistent production everywhere.

## Relationships

Document producers consume resolution; content editing and workspace settings supply its choices.
