From 69a8c95da1ab87ca0b72311a25381841a31e81ac Mon Sep 17 00:00:00 2001 From: Fridolin SOMERS Date: Thu, 19 Dec 2013 17:52:25 +0100 Subject: [PATCH] Bug 9351 - item type not recorded correctly in statistics for returns and some local use When returning a loan, or when returning an item for local use, the corresponding entry in the statistics table takes the item type from the bib level. This is incorrect when item-level item types is enabled. This patch corrects this problem by getting itemtype from $item->{'itype'} which comes from item or biblio level in GetItem(). Test plan : - On a catalogue with itemtype on item level, perform a return an look at statistics table - Idem for a catalogue with itemtype on biblio level --- C4/Circulation.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0a22b76..be5a70c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -739,7 +739,7 @@ sub CanBookBeIssued { # if ( $borrower->{'category_type'} eq 'X' && ( $item->{barcode} )) { # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . - &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itemtype'},$borrower->{'borrowernumber'}, undef, $item->{'ccode'}); + &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itype'},$borrower->{'borrowernumber'}, undef, $item->{'ccode'}); ModDateLastSeen( $item->{'itemnumber'} ); return( { STATS => 1 }, {}); } @@ -1897,7 +1897,7 @@ sub AddReturn { UpdateStats( $branch, $stat_type, '0', '', $item->{'itemnumber'}, - $biblio->{'itemtype'}, + $item->{'itype'}, $borrowernumber, undef, $item->{'ccode'} ); -- 1.8.3.2