Bug 18266: Fix internal error when paying fine for lost item without.. item
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 21 Mar 2017 15:24:28 +0000 (12:24 -0300)
committerMason James <mtj@kohaaloha.com>
Sun, 30 Apr 2017 11:19:53 +0000 (23:19 +1200)
commitcf4ef31201dabc3524258bc08a1c11a8cbe15a11
tree2b55a23476e42dc0185eb9eaca99fcedc7778981
parent593c2bd896867cbd3e9bde4f10949ddb90cec368
Bug 18266: Fix internal error when paying fine for lost item without.. item

If a fine is created for a lost item but the itemnumber is not supplied,
the system will return it.
The item should not be mark as returned if there is no item linked to
the fine.

Test plan:
1. Turn StoreLastBorrower on
2. Create a manual invoice for a lost item, do not supply a barcode
3. Pay the fines 'Pay fines > Pay'

=> Without this patch applied you get
Can't call method "last_returned_by" on an undefined value at
/home/marc/koha/C4/Circulation.pm line 2188.

=> With this patch applied, you must not get the error.
C4/Accounts.pm