@@ -, +, @@ --- C4/Circulation.pm | 2 +- Koha/Recalls.pm | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2353,7 +2353,7 @@ sub AddReturn { location => $item->location, borrowernumber => $borrowernumber, ccode => $item->ccode, - categorycode => $patron->categorycode, + ( $patron_unblessed ? ( categorycode => $patron_unblessed->{categorycode} ) : () ), }); # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. --- a/Koha/Recalls.pm +++ a/Koha/Recalls.pm @@ -164,14 +164,17 @@ sub add_recall { $item = Koha::Items->find( $itemnumber ); # add to statistics table - C4::Stats::UpdateStats({ - branch => C4::Context->userenv->{'branch'}, - type => 'recall', - itemnumber => $itemnumber, - borrowernumber => $recall->patron_id, - itemtype => $item->effective_itemtype, - ccode => $item->ccode, - }); + C4::Stats::UpdateStats( + { + branch => C4::Context->userenv->{'branch'}, + type => 'recall', + itemnumber => $itemnumber, + borrowernumber => $recall->patron_id, + itemtype => $item->effective_itemtype, + ccode => $item->ccode, + categorycode => $checkout->patron->categorycode + } + ); # add action log C4::Log::logaction( 'RECALLS', 'CREATE', $recall->id, "Recall requested by borrower #" . $recall->patron_id, $interface ) if ( C4::Context->preference('RecallsLog') ); --