From b2326693e0c65188c7d947fb1b429b0d44c3e774 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Fri, 31 May 2013 16:08:15 +0200 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. 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 30cbe2f..c126186 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1708,7 +1708,6 @@ sub AddReturn { $branch = C4::Context->userenv->{'branch'} unless $branch; # we trust userenv to be a safe fallback/default my $messages; my $borrower; - my $biblio; my $doreturn = 1; my $validTransfert = 0; my $stat_type = 'return'; @@ -1887,7 +1886,7 @@ sub AddReturn { UpdateStats( $branch, $stat_type, '0', '', $item->{'itemnumber'}, - $biblio->{'itemtype'}, + $item->{'itype'}, $borrowernumber, undef, $item->{'ccode'} ); -- 1.7.10.4