Skip to content

CAP-ACC-TRX-001Issue customer bills and numbered quotes

Markdown

CAP-ACC-TRX-001

Issue customer bills and numbered quotes

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaAccountingModuleTransactionsRevision1

Read atservices-accounting f47cb263react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Staff and Commerce turn proposed charges into documents customers can settle.A quote follows the pro forma path until conversion recognizes its receivable. Tax ownership for staff-created charges remains a Product decision.
Surfaces
consoleapi
Preconditions
Books and Products provide the business unit, supported currencies, products and fiscal calendar.
Postconditions
Issue recognizes invoice debt in a batch awaiting posting.
Constraints
An invoice contains no more than five hundred lines.
Intent sources
services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D3services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D12services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D14services-accounting:docs/architecture/accounting-2.0/02-decisions.md#M1-1services-accounting:docs/architecture/accounting-2.0/02-decisions.md#A-1services-accounting:docs/architecture/accounting-2.0/02-decisions.md#A-17services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01

Controls

26 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-006 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-TEN-004 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-003 TC-PI-005 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
accounting.invoices.createapitenant
accounting.invoices.adjustapitenant
accounting.invoices.deleteapitenant
accounting.invoices.readapitenant
accounting.tax.calculateapitenant

Business Rules

16 rules, 16 to be proved before approval. A rule's product intent is derived from its origin: 3 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
A draft replacement requires the version last read and replaces the document as a whole; a stale version leaves it unchanged.
validationapi, servicetest
02must prove
Proposed
Changing a draft’s business unit or currency requires creating another draft.
invariantservicetest
services-accounting:modules/transactions/tests/integration/services/invoices/update-draft.integration.spec.js#it refuses a change of business unit: a draft keeps its unit (business_unit_mismatch)
03must prove
Proposed
Invoice lines require active sellable products from the invoice’s unit, prices in its currency, and a currency supported by that unit; invalid input creates no draft.
✓ USD dues using the unit’s active product can be billed in USD.✗ A product belonging to a different unit fails the unit check.
validationservice, databasetest
04must prove
Confirmed
Amounts use whole currency minor units, line extensions round once half away from zero, totals sum those rounded lines, and discounts cannot exceed extensions.
✓ An extension of 832.5 yen becomes 833 yen.✗ Discounting beyond the extended charge rejects the draft.
calculationapi, service, databasetest
services-accounting:modules/transactions/tests/integration/services/invoices/rounding.integration.spec.js#it totals the rounded lines (3422), not a rounding of the unrounded sum (3421)
05must prove
Proposed
An explicit due date takes precedence over requested or customer-default terms, otherwise the invoice date applies; the due date cannot precede the invoice date.
calculationapi, service, databasetest
services-accounting:modules/transactions/tests/integration/services/invoices/customer-terms-precedence.integration.spec.js#it takes the bill-to’s default terms when the request names none, the due date 45 days after the invoice date
06must prove
Proposed
A supplied service period includes both dates, with its end on or after its start.
validationservicetest
services-accounting:modules/transactions/tests/integration/services/invoices/service-period-order.integration.spec.js#it refuses a period ending before it starts with a 400 naming the service period
07must prove
Proposed
Issue requires at least one line, an open fiscal period and an eligible batch selected explicitly or by assignment rules; refusal leaves the draft unnumbered.
validationservice, databasetest
services-accounting:modules/transactions/tests/integration/services/invoices/issue.integration.spec.js#it refuses the issue when the unit has no assignment rules (batch_required), the draft unchanged
08must prove
Proposed
Invoice numbering begins at one million within the workspace and permits gaps while preventing duplicates.
policyservice, databasetest
09must prove
Proposed
General ledger accounts are selected and frozen at posting, so missing account setup does not prevent issue.
policyservicetest
services-accounting:modules/transactions/tests/integration/services/invoices/issue.integration.spec.js#it resolves no account on a line of a product with no setup either (the unit’s defaults are the posting’s to read)
10must prove
Confirmed
Ordinary writes cannot change issued commercial content or delete an issued real invoice; the supported amendment path remains available for eligible unposted lines.
invariantdatabasetest
11must prove
Proposed
Invoice status follows its monetary position, with an outstanding amount keeping it open and a zero-total invoice becoming paid immediately.
calculationdatabasetest
12must prove
Confirmed
A pro forma receives an invoice number without a batch or receivable, converts once while retaining that number, and can be deleted only before conversion; drafts can also be deleted.
lifecycleservice, databasetest
services-accounting:modules/transactions/tests/integration/services/invoices/issue.integration.spec.js#it gives it no batch, no accounting date and no recognition (FC-06)
13must prove
Proposed
Issue freezes tax calculated from the line’s class and applicable billing or shipping address, exempts eligible organizations, and refuses taxable staff invoices lacking an address.
calculationservice, databasetest
services-accounting:modules/transactions/tests/integration/services/invoices/issue-tax.integration.spec.js#it writes one tax line per rate on the dues line, naming the zone and the rate and no account
14must prove
Proposed
Creation selects the requested card-fee policy or the unit default, and issue freezes the choice of none, required or optional.
policyapi, service, databasetest
services-accounting:modules/transactions/tests/e2e/card-fees.e2e.spec.js#it stamps the body’s policy on the invoice, and the unit’s default (optional) when the body names none
15must prove
Proposed
With mandatory service periods enabled, an automatically deferred line lacking its period prevents issue before a number is allocated.
validationserviceobserved
16must prove
Proposed
Issue preserves a stored exchange rate, otherwise selects the inverse dated unit rate, and keeps no rate when neither is available.
calculationserviceobserved

Scenarios

IdGivenWhenThenProvenance
01The member has a New York billing address and the unit has an eligible batch.Prepare dues and gala charges, save and revise the draft, then issue it.The open numbered invoice joins the batch with charge-level receivables and applicable New York tax.test
02An event quote has already been issued as pro forma.Update its terms, attempt a memo, then convert the quote.Memo creation fails; conversion recognizes the same numbered document as debt.test
03No assignment rule exists for the business unit.Issue a draft without selecting a batch.Refusal preserves the draft and leaves numbering untouched.test
services-accounting:modules/transactions/tests/integration/services/invoices/issue.integration.spec.js#it refuses the issue when the unit has no assignment rules (batch_required), the draft unchanged

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.