update voided billing messes up materialized_billable_xact_summary
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.materiali
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.
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