A credit should not increase the balance because its sign was applied twice
An account summary can display a convincing number while applying the wrong operation to valid source records. Before correcting those records, inspect the contract that defines what their amounts mean.
This example is fictional and limited to a derived customer-account display. It does not prescribe an accounting policy, calculate tax, issue a credit or move money. The business has already approved the source records and the summary rule used in the fixture.
Read the amount contract before calculating
The demonstration account opens at €240.00. Two eligible adjustment records belong to the displayed period: C-31 has a signed amount of −€30.00 and C-32 has a signed amount of −€20.00. Their negative signs already express their effect under the approved display contract.
The rule for this summary is to add each eligible signed line once to the opening amount. The expected result is therefore €190.00: €240.00 plus −€30.00 plus −€20.00.
The implementation instead identifies each record as a credit and subtracts its stored amount. Subtracting a negative value increases the total. It displays €290.00, even though the source entries, their account association and their approval state are all correct.
| Fixture component | Stored amount | Effect required by the approved summary |
|---|---|---|
| Opening amount | €240.00 | Start at €240.00 |
| C-31 | −€30.00 | Add −€30.00 |
| C-32 | −€20.00 | Add −€20.00 |
| Derived result | — | €190.00 |
Locate the fault in the display calculation
The investigation compares the source records, the values delivered to the summary and the displayed result. Both negative amounts arrive unchanged. The error occurs in the credit-specific subtraction branch, not in a currency conversion, an allocation or a provider settlement.
The source contract is explicit about signed amounts. It is not a feed containing unsigned magnitudes whose meaning must be derived from an event type. That distinction determines the correction. Applying a second sign rule to data that already carries its effect creates the defect.
No transaction is replayed to investigate the number. The fixture can be evaluated using a read-only copy and an isolated calculation. The original records remain evidence of what the summary should consume.
Correct one rule without accepting arbitrary lines
The correction accumulates eligible signed lines according to the approved contract. It retains checks for account, period, recognised type and approval. Adding signed values does not mean that every number in a response is eligible for the account view.
An unknown record type is held for review. A positive amount labelled as a credit is also outside the fixture's approved type/sign contract and is not silently converted to a negative value. The responsible owner must determine whether the source is valid and what it means.
The application uses a representation suitable for exact currency amounts in this calculation. Display formatting follows the calculated result; it is not used as the source of the arithmetic. The repair does not change how the financial system creates or approves its records.
Read back the corrected result and controls
In the fictional acceptance run, the summary reads the unchanged opening amount, C-31 and C-32 and displays €190.00. A subsequent read of the source confirms the same identifiers, amounts and approval states. The only changed output is the derived display calculation.
A separate fixture adds an approved positive charge of €25.00 to the same inputs and produces €215.00. A permitted zero adjustment leaves the €190.00 result unchanged. An ineligible record from another account is excluded under the existing selection rule rather than incorporated and corrected afterwards.
An exceptional fixture would produce a result below zero after a larger approved credit. The agreed interface policy for that situation is to hold the ordinary amount-due display for review and show that an account decision is needed. It does not create a refund instruction or turn a negative result into an automatic collection action.
The owner accepts the bounded correction after these checks. The acceptance concerns the account-summary rule and its controls. It does not certify the underlying accounting system or establish that any real customer balance is correct.
Leave the next maintainer a precise contract
The handover names the signed amount field, the eligible record conditions and the exceptional-result policy. It includes the €190.00 example and the positive, zero, invalid and overcredit controls. That record prevents a later maintainer from reintroducing a credit-specific sign operation because it appears intuitive.
The system-integration service can examine how records retain their meaning between tools. The webshop and payment service addresses the wider purchase journey. For either project, bring the source contract and an expected result to project planning before changing approved records to match a faulty screen.