---
id: TST-ACC-TRX-059
title: Payable invoices 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/invoices/payable-invoices.integration.spec.js
implements:
  - ATS-ACC-TRX-017-03
  - ATS-ACC-TRX-017-04
  - ATS-ACC-TRX-017-05
implements_parts:
  - scenario: ATS-ACC-TRX-017-03
    assertion: >-
      it describes the primary affiliate’s own open invoices, oldest first, then
      its organization’s, the totals summed
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/payable-invoices.integration.spec.js#it
      describes the primary affiliate’s own open invoices, oldest first, then
      its organization’s, the totals summed
  - scenario: ATS-ACC-TRX-017-03
    assertion: >-
      it describes only a secondary affiliate’s own invoices: only the primary
      affiliation is the contact’s organization
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/payable-invoices.integration.spec.js#it
      describes only a secondary affiliate’s own invoices: only the primary
      affiliation is the contact’s organization
  - scenario: ATS-ACC-TRX-017-04
    assertion: it leaves out the contact’s draft and its void invoice
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/payable-invoices.integration.spec.js#it
      leaves out the contact’s draft and its void invoice
  - scenario: ATS-ACC-TRX-017-04
    assertion: >-
      it allows cards and e-checks for an invoice with no order, with no
      Commerce settings and no fee under a policy of none (the unit’s rule
      shown), the invoice as the API answers it
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/payable-invoices.integration.spec.js#it
      allows cards and e-checks for an invoice with no order, with no Commerce
      settings and no fee under a policy of none (the unit’s rule shown), the
      invoice as the API answers it
  - scenario: ATS-ACC-TRX-017-05
    assertion: >-
      it quotes the card fee of a required invoice by its unit’s rule, on the
      balance or on the amount tendered, and none for a check
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/payable-invoices.integration.spec.js#it
      quotes the card fee of a required invoice by its unit’s rule, on the
      balance or on the amount tendered, and none for a check
  - scenario: ATS-ACC-TRX-017-05
    assertion: >-
      it quotes the totals’ card fee for a customer whose invoices bear the fee:
      the rule once over the card amount
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/payable-invoices.integration.spec.js#it
      quotes the totals’ card fee for a customer whose invoices bear the fee:
      the rule once over the card amount
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/invoices/payable-invoices.integration.spec.js
evidence:
  - provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/invoices/payable-invoices.integration.spec.js
    assertion_titles:
      - a customer’s payable invoices (integration)
      - describePayableInvoice
      - >-
        allows cards and e-checks for an invoice with no order, with no Commerce
        settings and no fee under a policy of none (the unit’s rule shown), the
        invoice as the API answers it
      - >-
        quotes the card fee of a required invoice by its unit’s rule, on the
        balance or on the amount tendered, and none for a check
      - 'refuses an invoice the tenant does not have: not_found'
      - refuses another tenant’s invoice exactly as one that does not exist
      - describePayableInvoices
      - >-
        describes the primary affiliate’s own open invoices, oldest first, then
        its organization’s, the totals summed
      - leaves out the contact’s draft and its void invoice
      - >-
        describes only a secondary affiliate’s own invoices: only the primary
        affiliation is the contact’s organization
      - describes only the own invoices of a contact CRM does not have
      - describes the organization’s own invoices alone for the organization
      - >-
        describes nothing, both tenders allowed, for a customer with nothing
        open, and for another tenant’s customer
      - >-
        quotes the totals’ card fee for a customer whose invoices bear the fee:
        the rule once over the card amount
      - takes at most the limit of each list
    imports:
      - const chai = require('chai');
      - chai.use(require('chai-as-promised'));
      - 'const { stage } = require(''@rhythmsoftware/macroservice-testing/stage'');'
      - >-
        const { createDraft } =
        require('../../../../services/invoices/invoice-drafts');
      - >-
        const { voidInvoice } =
        require('../../../../services/invoices/invoice-changes');
      - >-
        const { describePayableInvoice, describePayableInvoices } =
        require('../../../../services/invoices/invoice-payability');
      - >-
        const { issueInvoice } =
        require('../../../../services/invoices/invoice-issue');
      - >-
        const { getInvoice } =
        require('../../../../services/invoices/invoice-reads');
      - >-
        const { getBusinessUnit, updateBusinessUnit } =
        require('../../../../../books/services/persistence/business-units');
      - >-
        const { createProduct } =
        require('../../../../../products/services/persistence/products');
      - '} = require(''../../payments-fixtures'');'
      - 'const { putContact } = require(''../../parties-fixtures'');'
      - "\t\t\tconst { own } = seeded.require();"
      - "\t\t\tconst { required } = seeded.require();"
      - "\t\t\tseeded.require();"
      - "\t\t\tconst { own } = seeded.require();"
      - "\t\t\tconst { own, later, org } = seeded.require();"
      - "\t\t\tconst { draft, voided } = seeded.require();"
      - "\t\t\tconst { secondary } = seeded.require();"
      - "\t\t\tconst { unknown } = seeded.require();"
      - "\t\t\tconst { org } = seeded.require();"
      - "\t\t\tseeded.require();"
      - "\t\t\tconst { required } = seeded.require();"
      - "\t\t\tconst { own, org } = seeded.require();"
    test_double_declarations:
      - ' * Real: PostgreSQL under the application role, the invoice commands, CRM''s table shapes as the stand-in declares them. Doubled:'
---

# Payable invoices 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 primary-organization payables differ from own summary; payable description excludes inactive billing; fee quote uses eligible tender value once. 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.
