Skip to content

ATS-COM-ORD-006Invoice a sale through Accounting: Acceptance Test Set

Markdown

ATS-COM-ORD-006

Invoice a sale through Accounting: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-ORD-006

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

10 scenarios proving CAP-COM-ORD-006; 10 bound to an existing test.

01 Billing chooses the sale’s invoice typeapitest
Proves
BR-CAP-COM-ORD-006-01
Preconditions
The fixtures provide pay-now and terms policies.
Steps
Place purchases under each policy and inspect their invoices.
Expected
The pay-now sale links its issued pro forma; terms billing links a real invoice and accepts on terms.
Data
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
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
02 An unissued invoice blocks payment readinessunitnegativetest
Proves
BR-CAP-COM-ORD-006-02
Preconditions
Accounting’s issue response still describes a draft.
Steps
Call the issue-before-payment helper.
Expected
The helper returns invoice_not_issued instead of a billable result.
Data
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
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
03 Billing retries preserve pending work and escalationapitest
Proves
BR-CAP-COM-ORD-006-03
Preconditions
Unanswered billing includes a fresh order and one older than an hour.
Steps
Run financial billing sweeps against the configured transport.
Expected
Recoverable billing completes and the persistently old case raises placed_without_invoice.
Data
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
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
04 Unrepresented charges refuse invoice constructionunitnegativetest
Proves
BR-CAP-COM-ORD-006-04
Preconditions
The order holds a discount or fee unsupported by its lines.
Steps
Build the corresponding invoice requests.
Expected
The builder returns unallocated_order_discount or unbilled_order_charge with explanatory amounts.
Data
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
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
05 Invoice reasons retain customer promotion namesunittest
Proves
BR-CAP-COM-ORD-006-05
Preconditions
A discounted line has two named promotions and an order allocation.
Steps
Construct the discount description for normal, absent and long cases.
Expected
Names appear in sequence with the order share, absent discounts have no reason and long text is marked as truncated.
Data
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
Source
services-commerce:modules/orders/tests/unit/billing/invoice-request.spec.js#joins the promotions' names in sequence order, then the order-discount share
06 Allocated order savings remain creditable by lineapitest
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
Place, bill and cancel the middle line.
Expected
The shares are 17.14, 8.57 and 4.29; the middle credit uses 41.43 net and 3.31 tax.
Data
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
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
07 Unit adjustments preserve invoice arithmeticapitest
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
Place and bill the adjusted purchases.
Expected
The first unit prices at fifty dollars; the second prices at 96.67 with a 290.01 line and rounding explanation.
Data
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
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
08 Changed Accounting tax is acknowledged before chargingapinegativetest
Proves
BR-CAP-COM-ORD-006-08
Preconditions
A shipped gift is quoted under one address but invoiced with a different tax amount.
Steps
Attempt payment and then retry after reviewing the revised total.
Expected
The first attempt reports invoice_tax_mismatch and updates the order once; the reviewed retry succeeds.
Data
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
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
09 Billing acceptance follows payment requirementunittest
Proves
BR-CAP-COM-ORD-006-09
Preconditions
Inputs cover terms, no-payment, free pay-now, positive pay-now and deposit requirements.
Steps
Evaluate acceptance at billing for the five cases.
Expected
Only the first three are ready for acceptance without a further payment.
Data
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
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
10 Terms opens the appropriate console delivery gateapitest
Proves
BR-CAP-COM-ORD-006-10
Preconditions
Fixtures include default terms delivery, an explicit pay-first policy and portal terms.
Steps
Bill the orders and inspect their delivery conditions.
Expected
The default console condition opens unpaid while explicit pay-first and portal cases wait.
Data
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
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

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.