Can we do away with items.onloan?
One of my first trouble-shooting experiences with Koha involved a report of search results where an item was showing as 'available', but the detail showed it checked out to a patron. Some helpful bywaterian pointed me to items.onloan, and issues.date_due, and showed me that they didn't match. A database update and a zebra re-index later, and the problem was solved. We've never figured out the circumstances under which these get out of sync... we always find out about it after the fact. I'm sure that we could find everywhere that they're written, and put the writes to the items table and the issues table into a single transaction... but wouldn't it be better to simply add the due date to the marcxml record from the issues table at the time of indexing and remove the possibility of error entirely? It's a paper-cut of a problem, but it's always bothered me. --Barton
Surely, an item's checkout date and/or date due do not belong to the bibliographic marcxml field. What if we have more than one copies of a certain book for example? MP Στις Παρ, 18 Μαΐ 2018 στις 9:26 μμ ο χρήστης Barton Chittenden < barton@bywatersolutions.com> έγραψε:
One of my first trouble-shooting experiences with Koha involved a report of search results where an item was showing as 'available', but the detail showed it checked out to a patron. Some helpful bywaterian pointed me to items.onloan, and issues.date_due, and showed me that they didn't match. A database update and a zebra re-index later, and the problem was solved.
We've never figured out the circumstances under which these get out of sync... we always find out about it after the fact. I'm sure that we could find everywhere that they're written, and put the writes to the items table and the issues table into a single transaction... but wouldn't it be better to simply add the due date to the marcxml record from the issues table at the time of indexing and remove the possibility of error entirely?
It's a paper-cut of a problem, but it's always bothered me.
--Barton _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Hi Manos, it's an item field, so it's added for every item in 952/955. As the complete items information is added on time of indexing, I think what Barton suggests is already the case? Katrin On 20.05.2018 00:06, Manos PETRIDIS wrote:
Surely, an item's checkout date and/or date due do not belong to the bibliographic marcxml field. What if we have more than one copies of a certain book for example?
MP
Στις Παρ, 18 Μαΐ 2018 στις 9:26 μμ ο χρήστης Barton Chittenden <barton@bywatersolutions.com <mailto:barton@bywatersolutions.com>> έγραψε:
One of my first trouble-shooting experiences with Koha involved a report of search results where an item was showing as 'available', but the detail showed it checked out to a patron. Some helpful bywaterian pointed me to items.onloan, and issues.date_due, and showed me that they didn't match. A database update and a zebra re-index later, and the problem was solved.
We've never figured out the circumstances under which these get out of sync... we always find out about it after the fact. I'm sure that we could find everywhere that they're written, and put the writes to the items table and the issues table into a single transaction... but wouldn't it be better to simply add the due date to the marcxml record from the issues table at the time of indexing and remove the possibility of error entirely?
It's a paper-cut of a problem, but it's always bothered me.
--Barton _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org <mailto:Koha-devel@lists.koha-community.org> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
On Sat, May 19, 2018 at 6:20 PM, Katrin Fischer <katrin.fischer.83@web.de> wrote:
Hi Manos,
it's an item field, so it's added for every item in 952/955.
As the complete items information is added on time of indexing, I think what Barton suggests is already the case?
That's my understanding. For background: Data in the biblio and/or biblioitems table is copied to biblio_metadata.metadata (this was once biblioitems.marcxml). Item data is *not* stored in the metadata field -- each item is appended to the marcxml record at the time of indexing. This includes items.onloan, and this is how the 'available' status is displayed item by item in the list view of the opac and staff catalog search. This works well most of the time -- but not all... my contention is that removing items.onloan, and reading from issues.date_due instead gives a single point of truth for the on-loan status of an item. Try running this as a report to see if any of your items are affected: select count(*) from issues inner join items using (itemnumber) where date(issues.date_due) != items.onloan
So this is interesting - with as muddy as some of our data can get, I only got one result. It’s an item that was checked out to a “problems” account back in October 2017 with a due date of April 2nd, 2018. I thought maybe it was due to an extension of the due date from the checkout screen (but then clearly we would have way more instances of this). I edited the query a bit and pulled this. So it’s off, but only by a little bit. Has anyone else seen it be off by a bunch? Or is it due to the difference in the datetime vs date formats of the fields? select i.itemnumber, i.date_due, c.onloan from issues i inner join items c using (itemnumber) where date(i.date_due) != c.onloan itemnumber date_due onloan 611020 2018-04-02 23:59:00 2018-04-01 Marti Fuerst Systems Librarian Huntsville-Madison County Public Library 915 Monroe St, Huntsville, AL 35801 http://hmcpl.org/ — mfuerst@hmcpl.org
On May 19, 2018, at 11:50 PM, Barton Chittenden <barton@bywatersolutions.com> wrote:
select count(*) from issues inner join items using (itemnumber) where date(issues.date_due) != items.onloan
participants (4)
-
Barton Chittenden -
Katrin Fischer -
Manos PETRIDIS -
Martha Fuerst