From a3437fd9303dd57b1d5e0b2cad947b3523ec6b3f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 2 Mar 2022 14:33:06 +0000 Subject: [PATCH] Bug 19532: (QA follow-up) Fix fine calculation by inserting biblionumber The fines cron job uses Getoverdues to pass issue info to CalcFine. It took me a while to realize that the overdue hash does not contain a biblionumber. When testing CalcFine, we pass an item hash that does include one. So what happened? $item->{biblionumber} is undefined when it comes from Getoverdues and no recall overdue fine is calculated, only a regular one. Simple fix (without any impact): Add a biblionumber to Getoverdues. Signed-off-by: Marcel de Rooy Tested with fines.pl: recall fine applied now. Ran some Circulation and Overdues unit tests. Signed-off-by: Fridolin Somers --- C4/Overdues.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 9f73166813..05a6cf08e3 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -90,14 +90,14 @@ sub Getoverdues { my $statement; if ( C4::Context->preference('item-level_itypes') ) { $statement = " - SELECT issues.*, items.itype as itemtype, items.homebranch, items.barcode, items.itemlost, items.replacementprice + SELECT issues.*, items.itype as itemtype, items.homebranch, items.barcode, items.itemlost, items.replacementprice, items.biblionumber FROM issues LEFT JOIN items USING (itemnumber) WHERE date_due < NOW() "; } else { $statement = " - SELECT issues.*, biblioitems.itemtype, items.itype, items.homebranch, items.barcode, items.itemlost, replacementprice + SELECT issues.*, biblioitems.itemtype, items.itype, items.homebranch, items.barcode, items.itemlost, replacementprice, items.biblionumber FROM issues LEFT JOIN items USING (itemnumber) LEFT JOIN biblioitems USING (biblioitemnumber) -- 2.39.5