[Koha-bugs] [Bug 9351] item type not recorded correctly in statistics for returns and some local use

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Dec 17 03:28:49 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9351

--- Comment #32 from David Cook <dcook at prosentient.com.au> ---
I just tried out the following:

UPDATE statistics
SET itemtype =
(select u.itype from
  (select itype,itemnumber from items
   UNION ALL
   select itype,itemnumber from deleteditems
   ) u
where statistics.itemnumber = u.itemnumber
)
WHERE type IN ('localuse', 'return')

This will re-write the "itemtype" for all 'localuse' and 'return' existing
statistical entries. 

I checked its accuracy with the following:

SELECT statistics.*, u.itype
from statistics
JOIN (
select * from items
UNION ALL
select * from deleteditems
) u ON u.itemnumber = statistics.itemnumber
WHERE type IN ('localuse', 'return')
order by datetime
;

Looks all right to me.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list