Comment 29 for bug 1170794

Revision history for this message
Rogan Hamby (rogan-hamby) wrote :

cleaned up and minimalistic branch that only deals with the charging on renewals: user/rogan/lp1170794_deposits_and_renewals_oh_my

So, what is happening has to do with the function that on checkin checks to see if a deposit was required for the circulation. It only checks the _existing_ circ. I think it could be argued this is a separate bug and not introduced by the bug though I doubt it matters to end users. This is relevant for explaining it because of this is what historically has happened:

Checkout without renewal -
I check a book out with a deposit. The system has to make a deposit billing for that transaction. I check the book in, that deposit billing exists so I get the ITEM_DEPOSIT_PAID event.

Checkout with renewal -
I check a book out with a deposit, charged deposit, I renew it and when I check it in I get the ITEM_DEPOSIT_PAID message not because the original circ had a deposit but because the renewal did.

Post fix:

Since ITEM_DEPOSIT_PAID is generated on checkin and we're checking the renewal not the original circ .... well, that's why we get this. This is easy to test because if you take the patch and check an item out and check it directly in without a renewal you will still get the ITEM_DEPOSIT_PAID message.

I have some concerns about pulling in circ chains during the check in process and potential speed impact but will investigate it.