From 70d6fc3fa4b1affa7b936c1c27d00463c095f2e0 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 19 Aug 2016 09:57:13 +0200 Subject: [PATCH] Bug 14390: [QA Follow-up] UpdateFine should be passed a hash MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Renewing an overdue would not work. Log shows: renew: Can't use string ("2144746608") as a HASH ref while "strict refs" in use at C4/Overdues.pm line 508., referer: /cgi-bin/koha/circ/circulation.pl?borrowernumber=1 Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall (cherry picked from commit 4fa4b8a30649381523fec729b0ee5d40f896155b) Signed-off-by: Frédéric Demians --- C4/Circulation.pm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 920895bbe4..432a6bd91c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -4053,15 +4053,28 @@ sub _CalculateAndUpdateFine { if ( C4::Context->preference('finesMode') eq 'production' ) { if ( $amount > 0 ) { - C4::Overdues::UpdateFine( $issue->{itemnumber}, $issue->{borrowernumber}, - $amount, $type, output_pref($datedue) ); + C4::Overdues::UpdateFine({ + issue_id => $issue->{issue_id}, + itemnumber => $issue->{itemnumber}, + borrowernumber => $issue->{borrowernumber}, + amount => $amount, + type => $type, + due => output_pref($datedue), + }); } elsif ($return_date) { # Backdated returns may have fines that shouldn't exist, # so in this case, we need to drop those fines to 0 - C4::Overdues::UpdateFine( $issue->{itemnumber}, $issue->{borrowernumber}, 0, $type, output_pref($datedue) ); + C4::Overdues::UpdateFine({ + issue_id => $issue->{issue_id}, + itemnumber => $issue->{itemnumber}, + borrowernumber => $issue->{borrowernumber}, + amount => 0, + type => $type, + due => output_pref($datedue), + }); } } } -- 2.39.5