Bug 20285: Lost item refund won't always pay down lost item fee first
authorKyle M Hall <kyle@bywatetsolutions.com>
Fri, 23 Feb 2018 13:44:45 +0000 (08:44 -0500)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 15 Jun 2018 10:38:12 +0000 (10:38 +0000)
commitc967e010c0110e562c4cc71bc5d18837a2a956a0
tree9e9b35fbce49732ac3589bafbaf2143025f208ac
parent2acf4bf510292281db013acb3bda0c1e9a779931
Bug 20285: Lost item refund won't always pay down lost item fee first

Due to a simple typo, the accountline passed to Koha::Account::pay from _FixAccountForLostAndReturned is not used. That means that the credit for the lost item fee may be applied to other fees before it is used on the lost fee itself.

Test Plan:
1) Find a patron with existing fines
2) Ensure your settings will charge patrons for lost items
3) Check out an item to a patron with existing fees that need paid
4) Mark the item lost, charging the lost item fee
5) Return the item
6) Note the fee was refunded, but it paid down earlier fines first,
   and not the lost item fee first
7) Apply this patch set
8) Repeat steps 1 - 5
9) Note the lost item fee is the first fee to be paid off by the lost
   item fee refund

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works as expected.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Circulation.pm