From 3d459b3da0c7b6435d3105b12e864809fc87450d 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 5cd8ba3..9901420 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -747,7 +747,7 @@ sub CanBookBeIssued { branch => C4::Context->userenv->{'branch'}, type => 'localuse', itemnumber => $item->{'itemnumber'}, - itemtype => $item->{'itemtype'}, + itemtype => $item->{'itype'}, borrowernumber => $borrower->{'borrowernumber'}, ccode => $item->{'ccode'}} ); @@ -1988,7 +1988,7 @@ sub AddReturn { branch => $branch, type => $stat_type, itemnumber => $item->{'itemnumber'}, - itemtype => $biblio->{'itemtype'}, + itemtype => $biblio->{'itype'}, borrowernumber => $borrowernumber, ccode => $item->{'ccode'}} ); -- 1.9.1