From 49a0ed8d16a9481ee0ea466adc6db0ad52cbfcbf Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 21 Feb 2018 07:03:17 -0500 Subject: [PATCH] Bug 18790: Add logging for voided payments Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- Koha/Account/Line.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 83b635996c..e2cb749f67 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -18,6 +18,9 @@ package Koha::Account::Line; use Modern::Perl; use Carp; +use Data::Dumper; + +use C4::Log qw(logaction); use Koha::Database; use Koha::Items; @@ -82,6 +85,22 @@ sub void { )->store(); } + if ( C4::Context->preference("FinesLog") ) { + logaction("FINES", 'VOID', $self->borrowernumber, Dumper({ + action => 'void_payment', + borrowernumber => $self->borrowernumber,, + amount => $self->amount, + amountoutstanding => $self->amountoutstanding, + description => $self->description, + accounttype => $self->accounttype, + payment_type => $self->payment_type, + note => $self->note, + itemnumber => $self->itemnumber, + manager_id => $self->manager_id, + offsets => [ map { $_->unblessed } @account_offsets ], + })); + } + $self->set( { accounttype => 'VOID', -- 2.39.5