From faa1bc070fd464a87e6c27df1023c75e1aba6976 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 16 Nov 2018 07:01:39 -0500 Subject: [PATCH] Bug 21849: Two useless Koha::Account::Offset->new calls need attention Came across those calls in bug 20598 in _FixOverduesOnReturn Koha::Account::Offset->new( { debit_id => $accountline->id, type => 'Forgiven', amount => $amountoutstanding * -1, } ); This does nothing if you don't store data. Test Plan: 1) Apply this patch 2) Set up 2 items with overdue fines 3) Return one with dropbox mode 4) Note the dropbox account offset is created 5) Return one with full fine forgiveness 6) Note the forgiven account offset is created Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 3ccabd5d20..6091192294 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2340,7 +2340,7 @@ sub _FixOverduesOnReturn { type => 'Forgiven', amount => $amountoutstanding * -1, } - ); + )->store(); if (C4::Context->preference("FinesLog")) { &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item"); @@ -2355,7 +2355,7 @@ sub _FixOverduesOnReturn { type => 'Dropbox', amount => $accountline->lastincrement * -1, } - ); + )->store(); if ( C4::Context->preference("FinesLog") ) { &logaction( "FINES", 'MODIFY', $borrowernumber, -- 2.19.2