From fbc7f6f615a6387d7922d62cb7827339f77d1810 Mon Sep 17 00:00:00 2001 From: lmstrand Date: Thu, 16 Oct 2025 13:21:48 +0300 Subject: [PATCH] Bug 41371: Record biblio title to RESERVE_EXPIRED accountline description To test: 1. Find an expired reserve or create one by manipulating the reserves.expirationdate value in the database. Make a note of the borrowernumber. 2. Check that the circulation and fine rules has an expired hold charge configured for the tested reserve's itemtype 3. Run cancel_expired_holds.pl -cronscript 4. Note that the created accountline's description is empty either by checking transactions from patron's accounting tab or from database (select * from accountlines where debit_type_code = 'RESERVE_EXPIRED' and borrowernumber = x) 5. Apply patch 6. Repeat steps 1 and 2 7. Note that the created accountline's description now includes the expired reserve's item's bibliographic record's title either by checking transactions from patron's accounting tab or from database (select * from accountlines where debit_type_code = 'RESERVE_EXPIRED' and borrowernumber = x) Sponsored-by: Koha-Suomi Oy --- Koha/Hold.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index d886f7d8b5..36acf38b61 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -941,15 +941,17 @@ sub cancel { } ); + my $description = $self->biblio ? $self->biblio->title : ''; my $account = Koha::Account->new( { patron_id => $self->borrowernumber } ); $account->add_debit( { - amount => $charge, - user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, - interface => C4::Context->interface, - library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, - type => 'RESERVE_EXPIRED', - item_id => $self->itemnumber + amount => $charge, + user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, + interface => C4::Context->interface, + library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, + type => 'RESERVE_EXPIRED', + item_id => $self->itemnumber, + description => $description } ) if $charge; } -- 2.34.1