---
id: ATS-COM-ORD-006
scope: CAP-COM-ORD-006
product_area: commerce
module: orders
revision: 2
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-COM-ORD-006-01
    title: Billing chooses the sale’s invoice type
    level: api
    proves:
      - BR-CAP-COM-ORD-006-01
    preconditions: The fixtures provide pay-now and terms policies.
    steps:
      - do: Place purchases under each policy and inspect their invoices.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
          placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
          carrying its invoice line
    expected: The pay-now sale links its issued pro forma; terms billing links a real invoice and accepts on terms.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#creates the pro forma and
        issues it at placement, in that order, under the bill key and its issue key
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#bills a real invoice at
        placement and accepts the order on terms, the obligation waiting on the invoice
      - TST-COM-ORD-075
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at placement:
      billed, placed, one pro forma sale invoice linked under the first bill key, the line carrying its
      invoice line
    category: transition
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at placement:
      billed, placed, one pro forma sale invoice linked under the first bill key, the line carrying its
      invoice line
  - id: ATS-COM-ORD-006-02
    title: An unissued invoice blocks payment readiness
    level: unit
    proves:
      - BR-CAP-COM-ORD-006-02
    preconditions: Accounting’s issue response still describes a draft.
    steps:
      - do: Call the issue-before-payment helper.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
          Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
          tendered
    expected: The helper returns invoice_not_issued instead of a billable result.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
        Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
        tendered
      - TST-COM-ORD-128
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
      Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
      tendered
    category: validation
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
      Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
      tendered
  - id: ATS-COM-ORD-006-03
    title: Billing retries preserve pending work and escalation
    level: api
    proves:
      - BR-CAP-COM-ORD-006-03
    preconditions: Unanswered billing includes a fresh order and one older than an hour.
    steps:
      - do: Run financial billing sweeps against the configured transport.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/integration/services/orders/financial-sweeps.integration.spec.js#bills
          the pending orders of both tenants and the old one, leaves the fresh attempt alone, escalates
          nothing yet
    expected: Recoverable billing completes and the persistently old case raises placed_without_invoice.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/integration/services/orders/financial-sweeps.integration.spec.js#bills
        the pending orders of both tenants and the old one, leaves the fresh attempt alone, escalates nothing
        yet
      - >-
        services-commerce:modules/orders/tests/integration/services/orders/financial-sweeps.integration.spec.js#escalates
        an order placed over an hour ago whose billing gets no answer, placed_without_invoice, and counts the
        attempt
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves the order placed and
        pending with one attempt; the buyer’s tender bills it first and proceeds
      - TST-COM-ORD-095
      - TST-COM-ORD-075
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/orders/financial-sweeps.integration.spec.js#bills
      the pending orders of both tenants and the old one, leaves the fresh attempt alone, escalates nothing
      yet
    category: failure
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/integration/services/orders/financial-sweeps.integration.spec.js#bills
      the pending orders of both tenants and the old one, leaves the fresh attempt alone, escalates nothing
      yet
  - id: ATS-COM-ORD-006-04
    title: Unrepresented charges refuse invoice construction
    level: unit
    proves:
      - BR-CAP-COM-ORD-006-04
    preconditions: The order holds a discount or fee unsupported by its lines.
    steps:
      - do: Build the corresponding invoice requests.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#refuses an order
          discount its lines do not carry, 409 unallocated_order_discount, with both figures
    expected: The builder returns unallocated_order_discount or unbilled_order_charge with explanatory amounts.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#refuses an order discount
        its lines do not carry, 409 unallocated_order_discount, with both figures
      - >-
        services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#refuses a fee no fee line
        carries, 409 unbilled_order_charge, naming the kind
      - TST-COM-ORD-126
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#refuses an order discount
      its lines do not carry, 409 unallocated_order_discount, with both figures
    category: validation
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#refuses an order discount
      its lines do not carry, 409 unallocated_order_discount, with both figures
  - id: ATS-COM-ORD-006-05
    title: Invoice reasons retain customer promotion names
    level: unit
    proves:
      - BR-CAP-COM-ORD-006-05
    preconditions: A discounted line has two named promotions and an order allocation.
    steps:
      - do: 'Construct the discount description for normal, absent and long cases.'
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#joins the promotions'
          names in sequence order, then the order-discount share
    expected: >-
      Names appear in sequence with the order share, absent discounts have no reason and long text is marked
      as truncated.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#joins the promotions'
        names in sequence order, then the order-discount share
      - >-
        services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#names no discount reason
        for a line without an allocation
      - >-
        services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#cuts a reason longer than
        Accounting takes, marked, so the invoice is never refused for it
      - TST-COM-ORD-126
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#joins the promotions' names
      in sequence order, then the order-discount share
    category: boundary
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#joins the promotions' names
      in sequence order, then the order-discount share
  - id: ATS-COM-ORD-006-06
    title: Allocated order savings remain creditable by line
    level: api
    proves:
      - BR-CAP-COM-ORD-006-06
    preconditions: 'One hundred, fifty and twenty-five dollar items share thirty dollars off at eight-percent tax.'
    steps:
      - do: 'Place, bill and cancel the middle line.'
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the $30.00 over the
          lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
    expected: 'The shares are 17.14, 8.57 and 4.29; the middle credit uses 41.43 net and 3.31 tax.'
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the $30.00 over the
        lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
      - >-
        services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#taxes each placed line on
        its own net at 8 %: $6.63, $3.31 and $1.66
      - >-
        services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#credits the cancelled $50.00
        Book its net $41.43 and its tax $3.31: $44.74
      - >-
        services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#sends no negative line and
        expects the order’s 30000, 3000 and 27000
      - TST-COM-ORD-080
      - TST-COM-ORD-126
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the $30.00 over the
      lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
    category: rule
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the $30.00 over the
      lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
  - id: ATS-COM-ORD-006-07
    title: Unit adjustments preserve invoice arithmetic
    level: api
    proves:
      - BR-CAP-COM-ORD-006-07
    preconditions: The fixtures include a one-unit proration and a ten-dollar reduction across three hundred-dollar units.
    steps:
      - do: Place and bill the adjusted purchases.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#makes the unit price
          the prorated $50.00 and the line $50.00, the price row’s $100.00 and the proration beside it
    expected: >-
      The first unit prices at fifty dollars; the second prices at 96.67 with a 290.01 line and rounding
      explanation.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#makes the unit price
        the prorated $50.00 and the line $50.00, the price row’s $100.00 and the proration beside it
      - >-
        services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#rounds the unit price
        half away from zero to $96.67 and keeps the line at $290.01
      - >-
        services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#requests an invoice
        line whose unit price times its quantity is the line total
      - >-
        services-commerce:modules/orders/tests/e2e/extension-line-adjustments.e2e.spec.js#requests an invoice
        line whose unit price times its quantity less its discount is the line total
      - TST-COM-ORD-073
      - TST-COM-ORD-077
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#makes the unit price the
      prorated $50.00 and the line $50.00, the price row’s $100.00 and the proration beside it
    category: boundary
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#makes the unit price the
      prorated $50.00 and the line $50.00, the price row’s $100.00 and the proration beside it
  - id: ATS-COM-ORD-006-08
    title: Changed Accounting tax is acknowledged before charging
    level: api
    proves:
      - BR-CAP-COM-ORD-006-08
    preconditions: A shipped gift is quoted under one address but invoiced with a different tax amount.
    steps:
      - do: Attempt payment and then retry after reviewing the revised total.
        provenance: test
        source: >-
          services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#refuses the first tender 409
          invoice_tax_mismatch, naming both figures, the new total and the shipped line as the cause
    expected: The first attempt reports invoice_tax_mismatch and updates the order once; the reviewed retry succeeds.
    negative: true
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#refuses the first tender 409
        invoice_tax_mismatch, naming both figures, the new total and the shipped line as the cause
      - >-
        services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#re-priced the order to the
        invoice: the header, each line, the event, no tender recorded
      - >-
        services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#accepts the second tender, of
        the new total, first time: one refusal, no loop
      - TST-COM-ORD-019
    provenance: test
    source: >-
      services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#refuses the first tender 409
      invoice_tax_mismatch, naming both figures, the new total and the shipped line as the cause
    category: invariant
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#refuses the first tender 409
      invoice_tax_mismatch, naming both figures, the new total and the shipped line as the cause
  - id: ATS-COM-ORD-006-09
    title: Billing acceptance follows payment requirement
    level: unit
    proves:
      - BR-CAP-COM-ORD-006-09
    preconditions: 'Inputs cover terms, no-payment, free pay-now, positive pay-now and deposit requirements.'
    steps:
      - do: Evaluate acceptance at billing for the five cases.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/unit/tender/tender-rules.spec.js#accepts a terms order, a
          no-tender order and a zero-total pay-now order; a pay-now and a deposit order wait for their tender
    expected: Only the first three are ready for acceptance without a further payment.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/unit/tender/tender-rules.spec.js#accepts a terms order, a
        no-tender order and a zero-total pay-now order; a pay-now and a deposit order wait for their tender
      - TST-COM-ORD-145
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/unit/tender/tender-rules.spec.js#accepts a terms order, a
      no-tender order and a zero-total pay-now order; a pay-now and a deposit order wait for their tender
    category: transition
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/unit/tender/tender-rules.spec.js#accepts a terms order, a
      no-tender order and a zero-total pay-now order; a pay-now and a deposit order wait for their tender
  - id: ATS-COM-ORD-006-10
    title: Terms opens the appropriate console delivery gate
    level: api
    proves:
      - BR-CAP-COM-ORD-006-10
    preconditions: 'Fixtures include default terms delivery, an explicit pay-first policy and portal terms.'
    steps:
      - do: Bill the orders and inspect their delivery conditions.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#opens the gate of the
          console order when it is billed: the invoice is unpaid and the line is no longer waiting
    expected: The default console condition opens unpaid while explicit pay-first and portal cases wait.
    negative: false
    data_needs: Use the controlled records and transports established by the cited tests.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#opens the gate of the
        console order when it is billed: the invoice is unpaid and the line is no longer waiting
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves a console order
        waiting when the product’s own policy requires payment first
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves the portal order on
        terms waiting on its invoice, as before
      - TST-COM-ORD-075
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#opens the gate of the console
      order when it is billed: the invoice is unpaid and the line is no longer waiting
    category: interaction
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#opens the gate of the console
      order when it is billed: the invoice is unpaid and the line is no longer waiting
  - id: ATS-COM-ORD-006-11
    title: A billed line retains its Accounting line connection
    category: invariant
    level: api
    proves:
      - BR-CAP-COM-ORD-006-11
    preconditions: The fixture order has billed lines with frozen purchases.
    steps:
      - do: Read the line through persistence.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
          the line whole with its purchase, the invoice line id billing wrote, and the provenance of its price
    expected: Its invoice-line connection and original purchase are returned together.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
        the line whole with its purchase, the invoice line id billing wrote, and the provenance of its price
      - TST-COM-ORD-104
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
      the line whole with its purchase, the invoice line id billing wrote, and the provenance of its price
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
      the line whole with its purchase, the invoice line id billing wrote, and the provenance of its price
  - id: ATS-COM-ORD-006-12
    title: The order fee uses a separate undiscounted invoice line
    category: rule
    level: api
    proves:
      - BR-CAP-COM-ORD-006-12
    preconditions: A purchase has the fixture three-dollar fee and a configured fee product.
    steps:
      - do: Place the order and inspect the billing request.
        provenance: test
        source: >-
          services-commerce:modules/orders/tests/e2e/extension-line-adjustments.e2e.spec.js#requests the
          invoice with the fee as a line of the product, undiscounted
    expected: The fee is a line on that product with no discount.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to:
      - >-
        services-commerce:modules/orders/tests/e2e/extension-line-adjustments.e2e.spec.js#requests the invoice
        with the fee as a line of the product, undiscounted
      - TST-COM-ORD-077
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/extension-line-adjustments.e2e.spec.js#requests the invoice
      with the fee as a line of the product, undiscounted
    expected_provenance: test
    expected_source: >-
      services-commerce:modules/orders/tests/e2e/extension-line-adjustments.e2e.spec.js#requests the invoice
      with the fee as a line of the product, undiscounted
  - id: ATS-COM-ORD-006-13
    title: An unissued invoice prevents a processor request
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-006-02
      - BR-CAP-COM-ORD-007-11
    preconditions: Accounting returns an invoice that remains draft after issue.
    steps:
      - do: Attempt payment and inspect recorded payment calls.
        provenance: proposed
        source:
          - >-
            services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
            Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
            tendered
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refuses the tender 409
            order_not_billed when billing it now gets no answer either, charging nothing
    expected: Payment is refused before any charge request.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
        Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
        tendered
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refuses the tender 409
        order_not_billed when billing it now gets no answer either, charging nothing
    exercises:
      - CAP-COM-ORD-006
      - CAP-COM-ORD-007
    related_capabilities:
      - CAP-COM-ORD-007
    expected_provenance: proposed
    expected_source:
      - >-
        services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
        Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
        tendered
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refuses the tender 409
        order_not_billed when billing it now gets no answer either, charging nothing
  - id: ATS-COM-ORD-006-14
    title: Invoice line links support the displayed money position
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-006-11
      - BR-CAP-COM-ORD-010-06
    preconditions: A sale has billed lines and Accounting positions for their references.
    steps:
      - do: Refresh money and read the order and line records.
        provenance: proposed
        source:
          - >-
            services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
            the line whole with its purchase, the invoice line id billing wrote, and the provenance of its
            price
          - >-
            services-commerce:modules/orders/tests/integration/services/mirror/refresh-money-mirror.integration.spec.js#raises
            accepted_without_invoice_line on the billed line the view lacks, one open row counting both
            findings, and still writes the mirror it could derive
    expected: The displayed amounts derive from the linked positions and the links stay intact.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
        the line whole with its purchase, the invoice line id billing wrote, and the provenance of its price
      - >-
        services-commerce:modules/orders/tests/integration/services/mirror/refresh-money-mirror.integration.spec.js#raises
        accepted_without_invoice_line on the billed line the view lacks, one open row counting both findings,
        and still writes the mirror it could derive
    exercises:
      - CAP-COM-ORD-006
      - CAP-COM-ORD-010
    related_capabilities:
      - CAP-COM-ORD-010
    expected_provenance: proposed
    expected_source:
      - >-
        services-commerce:modules/orders/tests/integration/services/persistence/orders.queries.integration.spec.js#answers
        the line whole with its purchase, the invoice line id billing wrote, and the provenance of its price
      - >-
        services-commerce:modules/orders/tests/integration/services/mirror/refresh-money-mirror.integration.spec.js#raises
        accepted_without_invoice_line on the billed line the view lacks, one open row counting both findings,
        and still writes the mirror it could derive
  - id: ATS-COM-ORD-006-15
    title: Cancellation credits the discounted billed line
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-006-06
      - BR-CAP-COM-ORD-014-05
    preconditions: The fixture three-line order allocates a thirty-dollar order discount.
    steps:
      - do: Bill it and cancel the middle line.
        provenance: proposed
        source:
          - >-
            services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the $30.00 over
            the lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
          - >-
            services-commerce:modules/orders/tests/unit/cancellations/cancellation-plan.spec.js#credits 2 of 5
            units at the discounted amount with the tax share, estimates the refund from the funded part, and
            approves the document
    expected: 'Its credit uses the retained 41.43-dollar net and 3.31-dollar tax, preserving the other lines.'
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to: []
    provenance: proposed
    source:
      - >-
        services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the $30.00 over the
        lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
      - >-
        services-commerce:modules/orders/tests/unit/cancellations/cancellation-plan.spec.js#credits 2 of 5
        units at the discounted amount with the tax share, estimates the refund from the funded part, and
        approves the document
    exercises:
      - CAP-COM-ORD-006
      - CAP-COM-ORD-014
    related_capabilities:
      - CAP-COM-ORD-014
    expected_provenance: proposed
    expected_source:
      - >-
        services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the $30.00 over the
        lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
      - >-
        services-commerce:modules/orders/tests/unit/cancellations/cancellation-plan.spec.js#credits 2 of 5
        units at the discounted amount with the tax share, estimates the refund from the funded part, and
        approves the document
  - id: ATS-COM-ORD-006-16
    title: Issued billing determines whether the created sale can accept payment
    category: interaction
    level: api
    proves:
      - BR-CAP-COM-ORD-006-01
      - BR-CAP-COM-ORD-005-01
      - BR-CAP-COM-ORD-007-01
    preconditions: A placed pay-now sale is saved and Accounting initially leaves its invoice draft.
    steps:
      - do: 'Attempt payment, recover invoice issue and attempt payment again.'
        provenance: proposed
        source:
          - 'services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js'
          - 'services-commerce:modules/orders/services/billing/bill-order.ts:billOrder'
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
            placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
            carrying its invoice line
          - >-
            services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#bills a real invoice at
            placement and accepts the order on terms, the obligation waiting on the invoice
          - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepBilling'
    expected: No first charge occurs and the recovered invoice permits payment on the same sale.
    negative: false
    data_needs: Use an isolated workspace with the records and responses named in the preconditions.
    bound_to: []
    provenance: proposed
    source:
      - 'services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js'
      - 'services-commerce:modules/orders/services/billing/bill-order.ts:billOrder'
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#bills a real invoice at
        placement and accepts the order on terms, the obligation waiting on the invoice
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepBilling'
    exercises:
      - CAP-COM-ORD-006
      - CAP-COM-ORD-005
      - CAP-COM-ORD-007
    workflows:
      - WF-COM-ORD-003
    expected_provenance: proposed
    expected_source:
      - 'services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js'
      - 'services-commerce:modules/orders/services/billing/bill-order.ts:billOrder'
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#bills a real invoice at
        placement and accepts the order on terms, the obligation waiting on the invoice
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepBilling'
evidence:
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#accepts the
    second tender, of the new total, first time: one refusal, no loop
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#re-priced the
    order to the invoice: the header, each line, the event, no tender recorded
  - >-
    Examined reference: services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#refuses the
    first tender 409 invoice_tax_mismatch, naming both figures, the new total and the shipped line as the
    cause
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#makes
    the unit price the prorated $50.00 and the line $50.00, the price row’s $100.00 and the proration beside
    it
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#requests an invoice line
    whose unit price times its quantity is the line total
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/application-adjustments.e2e.spec.js#rounds
    the unit price half away from zero to $96.67 and keeps the line at $290.01
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the
    order at placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
    carrying its invoice line
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#bills a real
    invoice at placement and accepts the order on terms, the obligation waiting on the invoice
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#creates the
    pro forma and issues it at placement, in that order, under the bill key and its issue key
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves a
    console order waiting when the product’s own policy requires payment first
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves the
    order placed and pending with one attempt; the buyer’s tender bills it first and proceeds
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves the
    portal order on terms waiting on its invoice, as before
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#opens the
    gate of the console order when it is billed: the invoice is unpaid and the line is no longer waiting
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/e2e/extension-line-adjustments.e2e.spec.js#requests an invoice line
    whose unit price times its quantity less its discount is the line total
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#credits the
    cancelled $50.00 Book its net $41.43 and its tax $3.31: $44.74
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#shares the
    $30.00 over the lines as $17.14, $8.57 and $4.29, the nets $82.86, $41.43 and $20.71
  - >-
    Examined reference: services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js#taxes each
    placed line on its own net at 8 %: $6.63, $3.31 and $1.66
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/orders/financial-sweeps.integration.spec.js#bills
    the pending orders of both tenants and the old one, leaves the fresh attempt alone, escalates nothing yet
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/integration/services/orders/financial-sweeps.integration.spec.js#escalates
    an order placed over an hour ago whose billing gets no answer, placed_without_invoice, and counts the
    attempt
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#cuts a
    reason longer than Accounting takes, marked, so the invoice is never refused for it
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#joins the
    promotions' names in sequence order, then the order-discount share
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#names no
    discount reason for a line without an allocation
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#refuses a
    fee no fee line carries, 409 unbilled_order_charge, naming the kind
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#refuses an
    order discount its lines do not carry, 409 unallocated_order_discount, with both figures
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#sends no
    negative line and expects the order’s 30000, 3000 and 27000
  - >-
    Examined reference:
    services-commerce:modules/orders/tests/unit/billing/issue-before-tender.spec.js#answers an issue
    Accounting answers still a draft as a refusal, invoice_not_issued, so the order is blocked and not
    tendered
  - >-
    Examined reference: services-commerce:modules/orders/tests/unit/tender/tender-rules.spec.js#accepts a
    terms order, a no-tender order and a zero-total pay-now order; a pay-now and a deposit order wait for
    their tender
coverage:
  rule: covered
  transition: 'gap: FND-COM-ORD-063'
  validation: covered
  permission: 'gap: FND-COM-ORD-063'
  edge: 'gap: FND-COM-ORD-063'
  failure: covered
  boundary: covered
  concurrency: 'gap: FND-COM-ORD-063'
  invariant: 'gap: FND-COM-ORD-063'
  interaction: covered
coverage_definition: Covered means a design scenario exists; executable coverage and execution results are separate.
permission_coverage:
  - key: commerce.orders.create
    where_checked: api
    scenarios: []
    gap: FND-COM-ORD-063
    note: >-
      The listed examples do not establish a complete allow-and-deny matrix for this key; unused catalogue
      keys need no invented route.
    provenance: unknown
    source: FND-COM-ORD-063
  - key: commerce.orders.tender
    where_checked: api
    scenarios: []
    gap: FND-COM-ORD-063
    note: >-
      The listed examples do not establish a complete allow-and-deny matrix for this key; unused catalogue
      keys need no invented route.
    provenance: unknown
    source: FND-COM-ORD-063
transition_coverage:
  - state_model: STATE-COM-ORD-005
    from: pending
    to: billed
    trigger: 'Placement follow-up, recovery or tender obtains the invoice answer.'
    scenarios:
      - ATS-COM-ORD-006-01
    provenance: test
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at placement:
      billed, placed, one pro forma sale invoice linked under the first bill key, the line carrying its
      invoice line
    note: The cited test exercises this transition; other transitions retain separate gaps.
  - state_model: STATE-COM-ORD-005
    from: pending
    to: blocked
    trigger: 'Invoice construction, configuration or total checks prevent billing.'
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/services/billing/bill-order.ts:billOrder'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-005
    from: blocked
    to: billed
    trigger: Recovery obtains billing after configuration is corrected.
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepBilling'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
  - state_model: STATE-COM-ORD-005
    from: pending
    to: pending
    trigger: The financial call has no answer or usable transport.
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepBilling'
    note: 'Individual examples do not exhaustively prove this transition, its guard and side effects.'
invariant_coverage:
  - invariant: INV-DOM-COM-ORD-002-01
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/db/orders.table.ts:orders_total_check, orders_amounts_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-02
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: >-
      services-commerce:modules/checkout/tests/e2e/idempotency.e2e.spec.js#answers the stored status and body,
      marked Idempotent-Replayed, and runs the placement once: one order row;
      services-commerce:modules/orders/db/orders.table.ts:orders_checkout_uq
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-03
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/db/orders.table.ts:orders_number_uq, orders_number_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-04
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/services/persistence/orders.ts:ORDER_TRANSITIONS'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-05
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-lines.table.ts:order_lines_quantity_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-06
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: >-
      services-commerce:modules/orders/db/order-line-purchases.table.ts:order_line_purchases_write_once_trigger
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-07
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#resumes the same attempt on a
      retry, whatever card the retry names, and moves nothing while the intent is processing
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-08
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-invoices.table.ts:order_invoices_idempotency_key_uq'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-09
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-events.table.ts'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-10
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/db/order-lines.table.ts:order_lines_order_fk'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-11
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: 'services-commerce:modules/orders/db/orders.table.ts:orders_installment_schedule_check'
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-12
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: >-
      services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#never stores the card: the
      attempt keeps a reference of the merchant account and the token’s last four only
    note: Broader invariant coverage remains open beyond the concrete examples.
  - invariant: INV-DOM-COM-ORD-002-13
    scenarios: []
    gap: FND-COM-ORD-063
    provenance: unknown
    source: >-
      services-commerce:modules/orders/db/reservations.table.ts:reservations_subject_check;
      modules/orders/services/persistence/reservations.ts:RESERVATION_TRANSITIONS
    note: Broader invariant coverage remains open beyond the concrete examples.
workflow_coverage:
  - workflow: WF-COM-ORD-002
    scenarios:
      - ATS-COM-ORD-005-19
    gap: FND-COM-ORD-063
    provenance: proposed
    source:
      - 'services-commerce:modules/checkout/tests/e2e/placement.e2e.spec.js'
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#refuses a placement made
        after the T-shirt was gone with the same 409 claim_conflict, never a preparation refusal
      - 'services-commerce:modules/checkout/tests/e2e/engine-pricing.e2e.spec.js'
      - >-
        services-commerce:modules/checkout/tests/e2e/accounting-tax.e2e.spec.js#is a tax_quote_refused problem
        on the preview and refuses the placement, placing nothing
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#rolled the first seat claim
        back with the transaction, and left the booth held for the buyer to retry with
      - >-
        services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#confirms it on the sweep:
        the ledger committed, the participant’s claim committed, claim_confirmed on the order
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#leaves the order placed and
        pending with one attempt; the buyer’s tender bills it first and proceeds
  - workflow: WF-COM-ORD-003
    scenarios:
      - ATS-COM-ORD-006-16
    gap: FND-COM-ORD-063
    provenance: proposed
    source:
      - 'services-commerce:modules/orders/tests/e2e/order-discount-tax.e2e.spec.js'
      - 'services-commerce:modules/orders/services/billing/bill-order.ts:billOrder'
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#billed the order at
        placement: billed, placed, one pro forma sale invoice linked under the first bill key, the line
        carrying its invoice line
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#bills a real invoice at
        placement and accepts the order on terms, the obligation waiting on the invoice
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepBilling'
  - workflow: WF-COM-ORD-004
    scenarios:
      - ATS-COM-ORD-007-19
    gap: FND-COM-ORD-063
    provenance: proposed
    source:
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refuses a second tender of
        the accepted order, 409 order_not_tenderable
      - 'services-commerce:modules/orders/services/tender/tender-refusals.ts'
      - 'services-commerce:modules/orders/services/persistence/orders.ts:recordTender'
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#answers uncertain, the order
        tender_uncertain, the attempt uncertain naming Accounting’s intent
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#tells the story on the
        history: placed, billed, the tender recorded, submitted and resolved, the transition to accepted
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepFinancials'
  - workflow: WF-COM-ORD-006
    scenarios:
      - ATS-COM-ORD-001-20
    gap: FND-COM-ORD-063
    provenance: proposed
    source:
      - 'services-commerce:modules/checkout/aws/lambda/SWEEPER.ts:handler'
      - 'services-commerce:modules/orders/services/reservations/reservation-sweeper.ts:sweepReservations'
      - 'services-commerce:modules/orders/services/orders/tender-window-sweeper.ts:sweepTenderWindows'
      - 'services-commerce:modules/checkout/aws/lambda/SWEEPER.ts:handler'
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepFinancials'
      - 'services-commerce:modules/entitlements/services/register/entitlement-sweeper.ts:sweepEntitlements'
      - 'services-commerce:modules/checkout/aws/lambda/SWEEPER.ts:handler'
  - workflow: WF-COM-ORD-008
    scenarios:
      - ATS-COM-ORD-010-12
    gap: FND-COM-ORD-063
    provenance: proposed
    source:
      - 'services-commerce:modules/orders/services/mirror/refresh-money-mirror.ts:refreshMoneyMirrorOf'
      - >-
        services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#mirrors Accounting’s
        position: invoiced and paid in full, nothing due
      - 'services-commerce:modules/orders/services/mirror/refresh-money-mirror.ts'
      - 'services-commerce:modules/fulfillment/services/facts/financial-facts-handler.ts'
      - 'services-commerce:modules/orders/services/orders/financial-sweeps.ts:sweepFinancials'
  - workflow: WF-COM-ORD-011
    scenarios:
      - ATS-COM-ORD-015-15
    gap: FND-COM-ORD-063
    provenance: proposed
    source:
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refuses a change order itself (409
        order_not_amendable), an unknown product (409 product_not_found), another member, a reader and another
        tenant
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#marked the original line amended
        with its successor (nothing to fence: the type claims nothing), and wrote a modify obligation
        superseding the delivered fulfilment
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#credited the unused value from the
        original payment and applied it to the change invoice; the document awaits the buyer’s tender
      - 'services-commerce:modules/orders/services/amendments/amendment-settlement.ts:onChangeOrderVoided'
      - 'services-commerce:modules/orders/services/orders/accept-order.ts:acceptOrder'
      - >-
        services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#completes once the buyer’s card
        accepts the change order and the worker delivers the modify: the original fulfilment superseded
interaction_coverage:
  - with: CAP-COM-ORD-007
    scenarios:
      - ATS-COM-ORD-006-13
  - with: CAP-COM-ORD-010
    scenarios:
      - ATS-COM-ORD-006-14
  - with: CAP-COM-ORD-014
    scenarios:
      - ATS-COM-ORD-006-15
unproved_rules: []
---

# Invoice a sale through Accounting: Capability Test Specification

## Coverage

| Rule | Scenario or finding |
|---|---|
| `BR-CAP-COM-ORD-006-01` | `ATS-COM-ORD-006-01`, `ATS-COM-ORD-006-16` |
| `BR-CAP-COM-ORD-006-02` | `ATS-COM-ORD-006-02`, `ATS-COM-ORD-006-13` |
| `BR-CAP-COM-ORD-006-03` | `ATS-COM-ORD-006-03` |
| `BR-CAP-COM-ORD-006-04` | `ATS-COM-ORD-006-04` |
| `BR-CAP-COM-ORD-006-05` | `ATS-COM-ORD-006-05` |
| `BR-CAP-COM-ORD-006-06` | `ATS-COM-ORD-006-06`, `ATS-COM-ORD-006-15` |
| `BR-CAP-COM-ORD-006-07` | `ATS-COM-ORD-006-07` |
| `BR-CAP-COM-ORD-006-08` | `ATS-COM-ORD-006-08` |
| `BR-CAP-COM-ORD-006-09` | `ATS-COM-ORD-006-09` |
| `BR-CAP-COM-ORD-006-10` | `ATS-COM-ORD-006-10` |
| `BR-CAP-COM-ORD-006-11` | `ATS-COM-ORD-006-11`, `ATS-COM-ORD-006-14` |
| `BR-CAP-COM-ORD-006-12` | `ATS-COM-ORD-006-12` |

## Interactions With Related Capabilities

An unissued invoice prevents a processor request. Accounting returns an invoice that remains draft after issue. Attempt payment and inspect recorded payment calls.

Invoice line links support the displayed money position. A sale has billed lines and Accounting positions for their references. Refresh money and read the order and line records.

Cancellation credits the discounted billed line. The fixture three-line order allocates a thirty-dollar order discount. Bill it and cancel the middle line.

Crossing workflow examples also cover preparation, commitment and recovery at their service handoffs. Their structured bindings distinguish specified outcomes from executable evidence.
