Description
Nick Clemens (kidclamp)
2021-05-28 12:01:53 UTC
Created attachment 121476 [details] [review] Bug 28482: Unit test Created attachment 121477 [details] [review] Bug 28482: Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Created attachment 121479 [details] [review] Bug 28482: Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 121480 [details] [review] Bug 28482: Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> We could have used the compare technique as used in bug 27079 here too, but I think we're OK doing a fetch from the DB for now. I'd really like to treat floating point more widely with the Koha::Money or whatever class I hoped to introduce in bug 17138 at some point but I've not managed to find the time to work on that bug again of late :( In short.. signing off. > 16 - Item returned!
Still marked as lost, is that expected?
Created attachment 121586 [details] [review] Bug 28482: Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 121587 [details] [review] Bug 28482: Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> *** Bug 24855 has been marked as a duplicate of this bug. *** Pushed to master for 21.05, thanks to everybody involved! Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.01 Pushed to 20.11.x for 20.11.07 Backported: Pushed to 20.05.x branch for 20.05.13 Should this be backported to 19.11.x? For 19.11.19? Should this be backported to 19.11.x? For 19.11.20? Backported to 19.11.x for 19.11.20 Sorry this, hasn't actually been backported to 19.11.x yet I made an error I was meant to be updating Bug 28487 There are conflicts when trying to backport this to 19.11.x. Is this needed for 19.11.x? Created attachment 122646 [details] [review] Bug 28482: [19.11.x] Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Fix test rebase Created attachment 122647 [details] [review] Bug 28482: [19.11.x] Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 122659 [details] [review] Bug 28482: [19.11.x] Unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Fix test rebase Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> Created attachment 122660 [details] [review] Bug 28482: [19.11.x] Refresh line from DB to get stored value Before checking if the amount is 0 we get the stored value from the DB. This ensures any amounts beyond the 6 digit precision we store will be removed. To test: 1 - Add a processing fee of 15 to an itemtype 2 - Add an item of that type, set the replacement fee to 12.63 3 - Set MarkLostItemsAsReturned to 'On payment' only 4 - Set WhenLostChargeReplacementFee to 'Charge' 5 - Checkout the item to a patron 6 - Mark the item lost 7 - Reload patron and confirm they are charged 27.63 8 - Go to accounting, pay amount, pay 27.63 9 - Item is still lost and not returned 10 - Apply patch 11 - Checkin the item 12 - Checkout to another patron 13 - Mark lost 14 - Patron charged 27.63 15 - Pay amount, 27.63 16 - Item returned! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> Backported to 19.11.x for 19.11.20 |