---
id: TST-ACC-TRX-036
title: Memo tax suite
kind: integration
product_area: accounting
module: transactions
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - >-
    modules/transactions/tests/integration/services/change-memos/memo-tax.integration.spec.js
implements:
  - ATS-ACC-TRX-003-07
implements_parts:
  - scenario: ATS-ACC-TRX-003-07
    assertion: >-
      it apportions the dues line’s credit between the net and each tax line as
      the line was taxed, each row naming the invoice tax line it reverses
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/change-memos/memo-tax.integration.spec.js#it
      apportions the dues line’s credit between the net and each tax line as the
      line was taxed, each row naming the invoice tax line it reverses
  - scenario: ATS-ACC-TRX-003-07
    assertion: >-
      it taxes the added line at the invoice’s address and adds the tax to the
      amount requested: the memo line is the gross
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/change-memos/memo-tax.integration.spec.js#it
      taxes the added line at the invoice’s address and adds the tax to the
      amount requested: the memo line is the gross
  - scenario: ATS-ACC-TRX-003-07
    assertion: it adds no tax on an exempt invoice
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/change-memos/memo-tax.integration.spec.js#it
      adds no tax on an exempt invoice
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: >-
  Suite-marked records in the prepared local test database; fixture teardown
  removes owned records.
provenance: test
source: >-
  services-accounting:modules/transactions/tests/integration/services/change-memos/memo-tax.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/change-memos/memo-tax.integration.spec.js
    assertion_titles:
      - tax on memos (integration)
      - >-
        a credit memo of 20.00 on the taxed dues line, and of 5.00 on the
        untaxed gala line
      - >-
        apportions the dues line’s credit between the net and each tax line as
        the line was taxed, each row naming the invoice tax line it reverses
      - >-
        carries no tax on the untaxed line, and the header’s tax total is the
        taxed line’s
      - 'reduces the invoice lines by the gross, as before'
      - answers the memo’s tax in the Financial Transactions dataset
      - >-
        writes no tax rows for a void memo’s negating lines, and keeps the
        originals’
      - a debit memo adding a late fee of 10.00 under the standard class
      - >-
        taxes the added line at the invoice’s address and adds the tax to the
        amount requested: the memo line is the gross
      - >-
        debits the added invoice line by the gross, the line priced zero and
        carrying no invoice tax line of its own
      - >-
        gives back the tax of a credit on the added line in proportion, reading
        the debit memo’s own tax rows (D2 (d))
      - adds no tax on an exempt invoice
      - >-
        issues a debit memo whose rate has no account anywhere, the account
        being the posting’s to resolve (Andrew, 2026-10-18)
    imports:
      - 'const { sql } = require(''drizzle-orm'');'
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { assignDefaultGlAccount, clearDefaultGlAccount } =
        require('../../../../../books/services/persistence/default-gl-accounts');
      - >-
        const { createCreditMemo, createDebitMemo, voidCreditMemo } =
        require('../../../../services/change-memos/memo-commands');
      - >-
        const { createDraft } =
        require('../../../../services/invoices/invoice-drafts');
      - >-
        const { issueInvoice } =
        require('../../../../services/invoices/invoice-issue');
      - >-
        const { getInvoice } =
        require('../../../../services/invoices/invoice-reads');
      - '} = require(''../../invoices-fixtures'');'
      - >-
        const { EXEMPT_FOUNDATION, NEW_YORK_SOCIETY, TAX_ACCOUNTS,
        WESTCHESTER_CLUB, createTaxWorld } = require('../../tax-fixtures');
      - "\t\t\tconst invoice = world.require();"
      - "\t\t\tconst memo = credited.require();"
      - "\t\t\tconst invoice = world.require();"
      - "\t\t\tconst memo = credited.require();"
      - "\t\t\tconst invoice = await getInvoice(ctx(), world.require().id);"
      - "\t\t\tconst memo = credited.require();"
      - "\t\t\tconst memo = credited.require();"
      - "\t\t\tconst invoice = world.require();"
      - "\t\t\tconst memo = debited.require();"
      - "\t\t\tconst invoice = await getInvoice(ctx(), world.require().id);"
      - "\t\t\tconst invoice = await getInvoice(ctx(), world.require().id);"
    test_double_declarations:
      - ' * Real: the commands through their one transaction, the tax configuration, the CRM stand-in, the triggers, PostgreSQL. Doubled: nothing.'
---

# Memo tax suite

## Verification Boundary

The suite exercises transaction commands and database protections in the local prepared test environment. Registration records the existing executable file; it does not report a run or establish product approval.

## What This Suite Proves

Its cited assertions contribute evidence for memo tax respects source and exemption. The structured assertion bindings identify which parts of combined scenarios it executes.

## What It Does Not Prove

Local commands and route invocations do not establish deployed routing, live processor guarantees or the complete staff browser experience. An unbound feature chain remains proposed, and this registration carries no execution result.

## Real Dependencies and Test Doubles

The suite uses the imported commands, route handlers or persistence code against the local test database. Fixture helpers supply accounting context; any stepped clock, dummy processor or substituted external client is retained in the evidence declarations.

## Must Not Be Doubled

The command or persistence behavior under assertion and its relevant database protections must remain real. Substituting the final financial result removes evidence of transactional effects.
