@@ -, +, @@ --- Koha/Account.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -268,11 +268,13 @@ sub pay { letter_code => uc("ACCOUNT_$type"), message_transport_type => 'email', lang => Koha::Patrons->find( $self->{patron_id} )->lang, - objects => { - patron => scalar Koha::Patrons->find( $self->{patron_id} ), - library => scalar Koha::Libraries->find( $self->{library_id} ), - offsets => \@account_offsets, - credit => $payment, + tables => { + borrowers => $self->{patron_id}, + branches => $self->{library_id}, + }, + substitute => { + credit => $payment, + offsets => scalar Koha::Account::Offsets->search( { id => { -in => [ map { $_->id } @account_offsets ] } } ), }, ) ) --