Skip to content

005 — should subtract credit note from invoice total (branch 2025010)

Description

Validates that credit notes (DP) reduce costs and propagate into difference calculations.

Preconditions

  • Clean database (TestControl.cleanDb())
  • User logged in with ADMIN role
  • Contract created via API with branch-specific mock data loaded from receipts-branch-*.json
  • Contract price 200 000 Kč, branch 2025010
  • Mock receipts-branch-2025010_creditnote.json (1 FP + 1 DP)

Steps

  1. Navigate to contract detail — Expected: 2 rows: FP2025106001, DP2025200001 (negative)
  2. Assert net costs — Expected: FP total minus DP amount
  3. Assert differences — Expected: Reflect reduced costs
  • Spec: tests/e2e/tests/contracts.spec.ts

Media

screenshot