diff --git a/Koha/Account.pm b/Koha/Account.pm index b6bd357b16..ad08a6df4b 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -39,7 +39,6 @@ use Koha::Account::DebitTypes; use Koha::Exceptions; use Koha::Exceptions::Account; use Koha::Plugins; -use Koha::Patron::Debarments; =head1 NAME @@ -118,8 +117,6 @@ sub pay { } ); - Koha::Patron::Debarments::del_restrictions_after_payment({ borrowernumber => $self->{patron_id} }); - # NOTE: Pay historically always applied as much credit as it could to all # existing outstanding debits, whether passed specific debits or otherwise. if ( $payment->amountoutstanding ) { diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index e6368dc9cd..0c35d497cb 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -28,6 +28,7 @@ use Koha::Database; use Koha::DateUtils qw( dt_from_string ); use Koha::Exceptions::Account; use Koha::Items; +use Koha::Patron::Debarments; use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); @@ -699,6 +700,8 @@ sub apply { } }); + Koha::Patron::Debarments::del_restrictions_after_payment({ borrowernumber => $self->borrowernumber }); + return $self; }