From fe1dc278a7914396d5d70bf4c363535a8fa05941 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 28 Jan 2015 14:12:11 +0100 Subject: [PATCH] Bug 9351 - item type not recorded correctly in statistics for returns and some local use - followup This patch corrects previous for AddReturn() : - $item->{'itype'} instead of $biblio->{'itype'} - and my $biblio is not set so it is useless - removes FIXME comment Also adds a TODO comment in CanBookBeIssued() : - $item->{'itemtype'}=$item->{'itype'}, this line may be useless now Signed-off-by: Nick --- C4/Circulation.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 5bc81f2..0deea3d 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -703,7 +703,7 @@ sub CanBookBeIssued { my $item = GetItem(GetItemnumberFromBarcode( $barcode )); my $issue = GetItemIssue($item->{itemnumber}); my $biblioitem = GetBiblioItemData($item->{biblioitemnumber}); - $item->{'itemtype'}=$item->{'itype'}; + $item->{'itemtype'}=$item->{'itype'}; #TODO maybe useless my $dbh = C4::Context->dbh; # MANDATORY CHECKS - unless item exists, nothing else matters @@ -1745,7 +1745,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'; @@ -1983,12 +1982,11 @@ sub AddReturn { } # Record the fact that this book was returned. - # FIXME itemtype should record item level type, not bibliolevel type UpdateStats({ branch => $branch, type => $stat_type, itemnumber => $item->{'itemnumber'}, - itemtype => $biblio->{'itype'}, + itemtype => $item->{'itype'}, borrowernumber => $borrowernumber, ccode => $item->{'ccode'}} ); -- 1.9.1