---
id: ATS-ACC-TRX-004
scope: CAP-ACC-TRX-004
product_area: accounting
module: transactions
revision: 1
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-ACC-TRX-004-01
    title: Write-off cannot exceed eligible debt
    level: api
    proves:
      - BR-CAP-ACC-TRX-004-01
    preconditions: A draft exists and an issued line owes 40.00.
    steps:
      - do: Write off the draft and request 40.01 on the line.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          writes nothing: no write-off, no ledger line, no fact, no event
    expected: Neither attempt writes an adjustment or changes debt.
    negative: true
    data_needs: Draft and issued invoice examples.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        is refused 409 invoice_not_draft
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        is refused 400 over_application
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        writes nothing: no write-off, no ledger line, no fact, no event
      - TST-ACC-TRX-131
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      writes nothing: no write-off, no ledger line, no fact, no event
    category: validation
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it is refused 409 invoice_not_draft
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          is refused 409 invoice_not_draft
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it is refused 400 over_application
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          is refused 400 over_application
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: 'it writes nothing: no write-off, no ledger line, no fact, no event'
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          writes nothing: no write-off, no ledger line, no fact, no event
    binding_review: []
  - id: ATS-ACC-TRX-004-02
    title: Partial abandonment retains remaining debt
    level: api
    proves:
      - BR-CAP-ACC-TRX-004-02
    preconditions: Two unpaid invoice lines exist.
    steps:
      - do: 'Abandon one line and part of the next, then its remaining amount.'
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          makes the whole line written_off and keeps the partly written-off line
          and the invoice open
    expected: >-
      Line standing changes first and invoice standing changes after all debt is
      abandoned.
    negative: false
    data_needs: A two-line real invoice.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        makes the whole line written_off and keeps the partly written-off line
        and the invoice open
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        makes the header written_off once the rest is written off
      - TST-ACC-TRX-131
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      makes the whole line written_off and keeps the partly written-off line and
      the invoice open
    category: transition
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: >-
          it makes the whole line written_off and keeps the partly written-off
          line and the invoice open
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          makes the whole line written_off and keeps the partly written-off line
          and the invoice open
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it makes the header written_off once the rest is written off
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          makes the header written_off once the rest is written off
    binding_review: []
  - id: ATS-ACC-TRX-004-03
    title: Write-off policy controls method and account
    level: api
    proves:
      - BR-CAP-ACC-TRX-004-03
      - BR-CAP-ACC-TRX-004-04
    preconditions: >-
      The unit defaults to direct treatment and another unit has an allowance
      account.
    steps:
      - do: >-
          Try default method, account-free allowance, foreign account and direct
          treatment with allowance account.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          takes the unit’s default_write_off_method (direct) when the request
          names none
    expected: >-
      Default is direct, account-free allowance succeeds and incompatible
      accounts fail.
    negative: false
    data_needs: Account choices from two units.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        takes the unit’s default_write_off_method (direct) when the request
        names none
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        accepts an allowance write-off naming no account: the unit’s allowance
        default serves when it posts (gl-at-posting)
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        refuses another unit’s account 400 business_unit_mismatch
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        refuses a direct write-off naming an allowance account 400
      - TST-ACC-TRX-131
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      takes the unit’s default_write_off_method (direct) when the request names
      none
    category: rule
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: >-
          it takes the unit’s default_write_off_method (direct) when the request
          names none
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          takes the unit’s default_write_off_method (direct) when the request
          names none
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: >-
          it accepts an allowance write-off naming no account: the unit’s
          allowance default serves when it posts (gl-at-posting)
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          accepts an allowance write-off naming no account: the unit’s allowance
          default serves when it posts (gl-at-posting)
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it refuses another unit’s account 400 business_unit_mismatch
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          refuses another unit’s account 400 business_unit_mismatch
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it refuses a direct write-off naming an allowance account 400
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          refuses a direct write-off naming an allowance account 400
    binding_review: []
  - id: ATS-ACC-TRX-004-04
    title: An opposing write-off restores debt once
    level: api
    proves:
      - BR-CAP-ACC-TRX-004-05
      - INV-DOM-ACC-TRX-001-15
    preconditions: A numbered write-off has issued.
    steps:
      - do: >-
          Reverse it, repeat that reversal and attempt reversal of the opposing
          document.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          answers the reversal: a second write-off, numbered next, its lines
          negating the first’s
    expected: The next numbered document restores balances; later reversals are denied.
    negative: false
    data_needs: A previously abandoned balance.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        answers the reversal: a second write-off, numbered next, its lines
        negating the first’s
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        restores the invoice exactly
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        refuses reversing the first again 409 stale
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        refuses reversing the reversal 409
      - >-
        services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
        reverses it through the reverse action, answering the reversal and
        restoring the invoice
      - TST-ACC-TRX-131
      - TST-ACC-TRX-020
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      answers the reversal: a second write-off, numbered next, its lines
      negating the first’s
    category: transition
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: >-
          it answers the reversal: a second write-off, numbered next, its lines
          negating the first’s
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          answers the reversal: a second write-off, numbered next, its lines
          negating the first’s
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it restores the invoice exactly
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          restores the invoice exactly
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it refuses reversing the first again 409 stale
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          refuses reversing the first again 409 stale
      - file: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js
        assertion: it refuses reversing the reversal 409
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          refuses reversing the reversal 409
      - file: >-
          services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js
        assertion: >-
          it reverses it through the reverse action, answering the reversal and
          restoring the invoice
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
          reverses it through the reverse action, answering the reversal and
          restoring the invoice
    binding_review: []
  - id: ATS-ACC-TRX-004-05
    title: Independent approval protects abandonment
    level: api
    proves:
      - BR-CAP-ACC-TRX-004-07
    preconditions: The unit’s intended approval thresholds are zero.
    steps:
      - do: >-
          Create a write-off, attempt self-approval and approve as another
          person.
        provenance: proposed
        source: >-
          services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-5
    expected: >-
      The proposed flow waits, rejects self-approval and issues after
      independent approval.
    negative: false
    data_needs: Requesting and approving identities.
    bound_to: []
    provenance: proposed
    source: 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-5'
    category: permission
    test_bindings: []
    binding_review: []
  - id: ATS-ACC-TRX-004-06
    title: Write-off inspection does not grant mutation
    level: api
    proves:
      - BR-CAP-ACC-TRX-004-08
    preconditions: The caller holds reader authority.
    steps:
      - do: Attempt creation and reversal and inspect available actions.
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
          is refused the create and the reverse 403 permission_missing
    expected: Mutations are denied and actions empty while the record remains readable.
    negative: true
    data_needs: A read-only staff identity.
    bound_to:
      - >-
        services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
        is refused the create and the reverse 403 permission_missing
      - >-
        services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
        reads the write-off and lists no action
      - TST-ACC-TRX-020
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
      is refused the create and the reverse 403 permission_missing
    category: permission
    test_bindings:
      - file: >-
          services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js
        assertion: it is refused the create and the reverse 403 permission_missing
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
          is refused the create and the reverse 403 permission_missing
      - file: >-
          services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js
        assertion: it reads the write-off and lists no action
        provenance: test
        source: >-
          services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
          reads the write-off and lists no action
    binding_review: []
  - id: ATS-ACC-TRX-004-07
    title: Restored debt can receive money in a new batch
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-TRX-004-01
      - BR-CAP-ACC-TRX-004-05
      - BR-CAP-ACC-TRX-008-01
      - BR-CAP-ACC-TRX-008-04
      - BR-CAP-ACC-TRX-015-01
      - BR-CAP-ACC-TRX-015-03
    exercises:
      - CAP-ACC-TRX-004
      - CAP-ACC-TRX-008
      - CAP-ACC-TRX-015
    preconditions: >-
      An isolated workspace has eligible customers, products, matching accounts,
      an open period and two open batches. Each branch owns separate financial
      records.
    steps:
      - do: >-
          Write off an unpaid 80.00 bill, reverse the write-off, move the
          opposing record to another eligible batch and allocate an 80.00
          receipt to the restored bill.
        provenance: proposed
        source: >-
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          writes nothing: no write-off, no ledger line, no fact, no event;
          services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
          answers the reversal: a second write-off, numbered next, its lines
          negating the first’s;
          rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-004-write-off-a-balance-and-restore-it.md#WF-ACC-TRX-004;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-01;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-05;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-01;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-01;
          rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-03
    expected: >-
      The restored 80.00 debt can be paid; retained abandonment and opposing
      records explain the change, while the batch move changes no debt.
    negative: false
    data_needs: >-
      Separate command keys, two customers, invoice lines, receipts and credit;
      controlled processor outcomes and a fixed calendar where the branch
      requires them.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      writes nothing: no write-off, no ledger line, no fact, no event;
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      answers the reversal: a second write-off, numbered next, its lines
      negating the first’s;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-004-write-off-a-balance-and-restore-it.md#WF-ACC-TRX-004;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-03
    test_bindings: []
    binding_review: []
evidence:
  - >-
    services-accounting at f47cb263875bbc0c5640fba7dae6785ec32695f8: the test
    files named in bound_to.
  - >-
    rhythm-v2-docs:specs/accounting/transactions/design: related workflows,
    domain invariants and state transitions examined for the back-fill.
coverage:
  rule: covered
  transition: 'gap: FND-ACC-TRX-069'
  validation: covered
  permission: covered
  edge: 'gap: FND-ACC-TRX-069'
  failure: 'gap: FND-ACC-TRX-069'
  boundary: 'gap: FND-ACC-TRX-069'
  concurrency: 'gap: FND-ACC-TRX-069'
  invariant: 'gap: FND-ACC-TRX-069'
  interaction: covered
coverage_notes:
  edge: >-
    No dedicated edge scenario covers the applicable conditions; the finding
    identifies the remaining specification work.
  failure: >-
    No dedicated failure scenario covers the applicable conditions; the finding
    identifies the remaining specification work.
  boundary: >-
    No dedicated boundary scenario covers the applicable conditions; the finding
    identifies the remaining specification work.
  concurrency: >-
    No dedicated concurrency scenario covers the applicable conditions; the
    finding identifies the remaining specification work.
  invariant: >-
    No dedicated invariant scenario covers the applicable conditions; the
    finding identifies the remaining specification work.
  transition: >-
    Selected transition scenarios exist, but the listed state paths still need
    explicit guard, effect and actor mappings.
interaction_coverage:
  - to: CAP-ACC-TRX-008
    scenarios:
      - ATS-ACC-TRX-004-07
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      writes nothing: no write-off, no ledger line, no fact, no event;
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      answers the reversal: a second write-off, numbered next, its lines
      negating the first’s;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-004-write-off-a-balance-and-restore-it.md#WF-ACC-TRX-004;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-03
  - to: CAP-ACC-TRX-015
    scenarios:
      - ATS-ACC-TRX-004-07
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      writes nothing: no write-off, no ledger line, no fact, no event;
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      answers the reversal: a second write-off, numbered next, its lines
      negating the first’s;
      rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-004-write-off-a-balance-and-restore-it.md#WF-ACC-TRX-004;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#BR-CAP-ACC-TRX-004-05;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-01;
      rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-015-move-a-transaction-to-another-batch-and-correct-its-details.md#BR-CAP-ACC-TRX-015-03
transition_coverage:
  - state_model: STATE-ACC-TRX-003
    transition: 1
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/write-offs/write-off-commands.ts;
        services-accounting:modules/transactions/db/write-offs.table.ts;
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        writes nothing: no write-off, no ledger line, no fact, no event
  - state_model: STATE-ACC-TRX-003
    transition: 2
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/write-offs/write-off-commands.ts;
        services-accounting:modules/transactions/db/write-offs.table.ts;
        services-accounting:modules/transactions/tests/integration/services/document-edits/reassign-and-edit.integration.spec.js#it
        negates the facts on the old accounting date and restates them on the
        new one, the originals untouched
  - state_model: STATE-ACC-TRX-003
    transition: 3
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    note: >-
      Existing scenarios establish selected paths; this exact guard, side-effect
      and actor combination still needs an explicit scenario mapping.
    evidence:
      - >-
        services-accounting:modules/transactions/services/write-offs/write-off-commands.ts;
        services-accounting:modules/transactions/db/write-offs.table.ts;
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        answers the reversal: a second write-off, numbered next, its lines
        negating the first’s
permission_coverage:
  - key: accounting.write-offs.create
    where_checked: api
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#CAP-ACC-TRX-004
  - key: accounting.write-offs.read
    where_checked: api
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#CAP-ACC-TRX-004
  - key: accounting.write-offs.update
    where_checked: api
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    note: >-
      Existing permission scenarios are retained; assertion-level coverage of
      this grant at every declared surface remains unverified.
    evidence:
      - >-
        rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-004-write-off-an-uncollectable-balance-and-restore-it.md#CAP-ACC-TRX-004
rule_coverage:
  - rule: BR-CAP-ACC-TRX-004-01
    scenarios:
      - ATS-ACC-TRX-004-01
      - ATS-ACC-TRX-004-07
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      writes nothing: no write-off, no ledger line, no fact, no event
  - rule: BR-CAP-ACC-TRX-004-02
    scenarios:
      - ATS-ACC-TRX-004-02
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      makes the whole line written_off and keeps the partly written-off line and
      the invoice open
  - rule: BR-CAP-ACC-TRX-004-03
    scenarios:
      - ATS-ACC-TRX-004-03
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      takes the unit’s default_write_off_method (direct) when the request names
      none
  - rule: BR-CAP-ACC-TRX-004-04
    scenarios:
      - ATS-ACC-TRX-004-03
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      accepts an allowance write-off naming no account: the unit’s allowance
      default serves when it posts (gl-at-posting)
  - rule: BR-CAP-ACC-TRX-004-05
    scenarios:
      - ATS-ACC-TRX-004-04
      - ATS-ACC-TRX-004-07
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      answers the reversal: a second write-off, numbered next, its lines
      negating the first’s
  - rule: BR-CAP-ACC-TRX-004-07
    scenarios:
      - ATS-ACC-TRX-004-05
    provenance: proposed
    source: FND-ACC-TRX-008
  - rule: BR-CAP-ACC-TRX-004-08
    scenarios:
      - ATS-ACC-TRX-004-06
    provenance: proposed
    source: >-
      services-accounting:modules/transactions/tests/e2e/write-offs.e2e.spec.js#it
      is refused the create and the reverse 403 permission_missing
executable_gaps:
  - scenario: ATS-ACC-TRX-004-05
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    evidence:
      - 'services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-5'
  - scenario: ATS-ACC-TRX-004-07
    gap: FND-ACC-TRX-069
    provenance: unknown
    source: FND-ACC-TRX-069
    evidence:
      - >-
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        writes nothing: no write-off, no ledger line, no fact, no event;
        services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
        answers the reversal: a second write-off, numbered next, its lines
        negating the first’s;
        rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-004-write-off-a-balance-and-restore-it.md#WF-ACC-TRX-004
invariant_coverage:
  - invariant: INV-DOM-ACC-TRX-001-15
    scenarios:
      - ATS-ACC-TRX-004-04
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/write-offs/write-offs.integration.spec.js#it
      answers the reversal: a second write-off, numbered next, its lines
      negating the first’s
    note: >-
      The cited scenario and its constituent test assertions are the proof
      boundary.
---

# Abandon and restore uncollectable debt: Capability Test Specification

## Coverage

The category map separates specified examples from recorded gaps. The table lists a scenario or finding for each rule requiring proof; a listed scenario may still be proposed. Executable bindings cover their cited assertions, while the transition, permission and invariant registers identify combinations that need further proof.

| Required rule | Scenario or finding |
|---|---|
| `BR-CAP-ACC-TRX-004-01` | `ATS-ACC-TRX-004-01`, `ATS-ACC-TRX-004-07` |
| `BR-CAP-ACC-TRX-004-02` | `ATS-ACC-TRX-004-02` |
| `BR-CAP-ACC-TRX-004-03` | `ATS-ACC-TRX-004-03` |
| `BR-CAP-ACC-TRX-004-04` | `ATS-ACC-TRX-004-03` |
| `BR-CAP-ACC-TRX-004-05` | `ATS-ACC-TRX-004-04`, `ATS-ACC-TRX-004-07` |
| `BR-CAP-ACC-TRX-004-07` | `ATS-ACC-TRX-004-05` |
| `BR-CAP-ACC-TRX-004-08` | `ATS-ACC-TRX-004-06` |

## Interactions With Related Capabilities

Write off an unpaid 80.00 bill, reverse the write-off, move the opposing record to another eligible batch and allocate an 80.00 receipt to the restored bill.

The restored 80.00 debt can be paid; retained abandonment and opposing records explain the change, while the batch move changes no debt. The complete chain remains proposed until one executable run proves its combined outcomes.
