update voided billing messes up materialized_billable_xact_summary

Bug #1644660 reported by Josh Stompro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

EG 2.8.10

The logic for the trigger that runs when a voided billing is updated seems to be off to me. I doubt this is something that normally happens, but I was just playing around and updated the amount on a voided billing (money.billing) and the money.materialized_billable_xact_summary for that bill was updated by subtracting the difference between the old and new amounts.

That seems like the wrong behavior to me, I think it should just be a null op. If a voided billing is being updated, and the amount changed, it shouldn't change the total amount owed, since the new voided amount was never added to the total owed in the first place.

I'm guessing that the though was that a voided billing amount would never be updated, so it doesn't matter.

http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/sql/Pg/080.schema.money.sql;hb=HEAD#l357

I wonder if changing the ELSE in the about line to explicitly only apply when the Old and New billing are not voided would do the trick.

ELSIF NOT NEW.voided AND NOT OLD.voided THEN

I also understand if the answer is "You should never do that in the first place." I'm looking into updating some billings when the copy price changes after an item is lost. It would be nice on my end if I could also update voided billing entries too for consistency. Usually those entries are voided because some manual adjustments were done to the bill.

Josh

Tags: circ-billing
Dan Wells (dbw2)
tags: added: billing
tags: added: circ-billing
removed: billing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.