money.materialized_summary_billing_del() ADDS to balance_owed
Bug #1319998 reported by
Blake GH
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Undecided
|
Unassigned | ||
2.8 |
Fix Released
|
Undecided
|
Unassigned | ||
2.9 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This function is called when rows are deleted from money.billing. This has the unfortunate side affect of INCREASING the balance_owed. The total_owed however is correct. The code:
IF NOT OLD.voided THEN
UPDATE money.materiali
SET total_owed = total_owed - OLD.amount,
balance_owed = balance_owed + OLD.amount
WHERE id = OLD.xact;
END IF;
I suggest this as a fix:
IF NOT OLD.voided THEN
UPDATE money.materiali
SET total_owed = total_owed - OLD.amount,
balance_owed = balance_owed - OLD.amount
WHERE id = OLD.xact;
END IF;
tags: | added: pullrequest |
Changed in evergreen: | |
assignee: | Blake GH (blake-j) → Kathy Lussier (klussier) |
Changed in evergreen: | |
milestone: | 2.next → 2.10-beta |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Looks like a bug to me as well; confirming.
The proposed fix looks right, too.