Adjust to zero does not work properly with negative balance on multiple billings

Bug #1689656 reported by Jeff Davis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned
2.11
Fix Released
Undecided
Unassigned
2.12
Fix Released
Undecided
Unassigned

Bug Description

We're seeing this behavior on Evergreen 2.10 and 2.12.

1. Generate multiple overdue billings on an overdue circ.

2. Apply a payment (cash or forgive) to resolve the overdue billings.

3. Checkin the item using backdated checkin or amnesty mode, such that the overdue billings are automatically voided, resulting in a negative balance.

3. Adjust to zero.

Expected behavior: The balance owing is adjusted to zero.

Actual behavior: A single new manual adjustment billing is created, reinstating one overdue billing. Then the adjust-to-zero process exits. The negative balance has been reduced by the amount of one overdue billing, rather than being fully adjusted to zero.

The issue appears to be a thinko when comparing the (negative) balance owed to the (positive) amount rebilled during adjustment-to-zero. I'll post a fix momentarily.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :
Revision history for this message
Dan Wells (dbw2) wrote :

Jeff, you are right, this looks like an inversion thinko and the right fix. Any chance of getting an automated test for this as well? It would be the icing on the cake.

If you don't have time, I will try to find some for myself to do so.

Changed in evergreen:
assignee: nobody → Dan Wells (dbw2)
tags: added: needstest pullrequest
Galen Charlton (gmc)
Changed in evergreen:
milestone: none → 3.0-alpha
no longer affects: evergreen/3.0
Revision history for this message
tji@sitka.bclibraries.ca (tji) wrote :

Tested on https://mlnc4.noblenet.org. Works as expected. The negative amount is offset by multiple newly added billings. Balance is zero.

Tina Ji
BC Libraries Coop

tags: added: signedoff
removed: needstest
Revision history for this message
Kathy Lussier (klussier) wrote :

I re-added the needstest tag because this tag is used to identify code that needs an automated test before it can be merged into the code. I don't think such a test has been added yet.

tags: added: needstes
tags: added: needstest
removed: needstes
Revision history for this message
Terran McCanna (tmccanna) wrote :

Thanks, Kathy! Sorry 'bout that.

Revision history for this message
Dan Wells (dbw2) wrote :

Bug squashing week seems like a good time to add a test, so I will do so tomorrow. Thanks for bringing this back to the surface, all.

P.S. I just discovered that bugs don't show up on my main "assigned" list unless they "In Progress". Probably should have known that! (There is another, more buried list which does show all assigned bugs.)

Changed in evergreen:
status: New → In Progress
Revision history for this message
Dan Wells (dbw2) wrote :

Added test and pushed to master through 2.11. Thanks to all who chipped in!

Changed in evergreen:
status: In Progress → Fix Committed
assignee: Dan Wells (dbw2) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
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.