Currently, the holds report ratio found in the circulation module can be altered and run with a specific number to look for a ratio of holds to a record. Prior to 19.11, this report would report on 1 or more holds, if that was entered into the search box. If this report is run with a 1 in the search, Koha will only display records with 2 or more holds.

Andrew brought up an interesting point on this, if you run this for a ratio of 2 holds, Koha will only give records with 3+ holds. If you run this for a ratio of 3, you will get 4+ (holds on a record). Is it missing the = to portion of the statement?

Created attachment 105907 [details] [review] Bug 25760: (bug 15422 follow-up) Display record with hold ratio == 1 If the hold ratio is 1 (ie. number of holds == number of copies), we should display it if it's the value in the filter. Test plan: 1. Create bibliographic records with 1, 2 and 3 items 2. Place 1 hold on each of them 3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 4. Place another hold on each of the record 5. Repeat 3 6. Make sure there is no regression in the test plan of bug 15422

Kelly is right - we tested the same. This report is suddenly using "greater than" instead of "Greater than or equal" for any ratio value. It used to work correctly - that is, if you enter a ratio of 1 you get all titles with holds, ratio of 2 you get all titles with two or more holds per copy and so on. Hint from Equinox staff as a workaround for now - enter less than one (0.9) as the ratio to get all holds.

Hello Agnes, could you test the patch attached to this bug report?

Regret, just a librarian, not sysadmin. I will ask Equinox support if they can.

Created attachment 110053 [details] [review] Bug 25760: (follow-up) Restore use of ceil The ceiling function here ensures that partial copies are counted as full copies i.e. if we need half a book to reach the ratio, we should report 1 book, not 0

Created attachment 110062 [details] [review] Bug 25760: (follow-up) Restore use of ceil The ceiling function here ensures that partial copies are counted as full copies i.e. if we need half a book to reach the ratio, we should report 1 book, not 0 Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Created attachment 110063 [details] [review] Bug 25760: (bug 15422 follow-up) Display record with hold ratio == 1 If the hold ratio is 1 (ie. number of holds == number of copies), we should display it if it's the value in the filter. Test plan: 1. Create bibliographic records with 1, 2 and 3 items 2. Place 1 hold on each of them 3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 4. Place another hold on each of the record 5. Repeat 3 6. Make sure there is no regression in the test plan of bug 15422 Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Created attachment 110064 [details] [review] Bug 25760: (follow-up) Restore use of ceil The ceiling function here ensures that partial copies are counted as full copies i.e. if we need half a book to reach the ratio, we should report 1 book, not 0 Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

These patches are already signed off right?

This doesn't work - Titles with 1 item and any holds will show up for all ratios: ceil( 1/x - 1) = 1 True for positive integers x

Created attachment 114978 [details] [review] Bug 25760: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered On bug 15422 we made it so that only holds with copies to buy to acheive the holds ratio showed Users have reported that they want to see record where there are 0 copies to buy i.e. the holds ration matches the value entered This patch changes the criteria for returning holds to be if the ratio for a given title is equal to or greater then the ratio specified in the form I also renamed 'ratiocalc' to 'copies_to_buy' since that is what is contains Test plan: 1. Create bibliographic records with 1, 2 and 3 items 2. Place 1 hold on each of them 3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 4. You expect to see: the title with 1 item with ratio 1 nothing otherwise 5. Place another hold on each of the record 6. Repeat 3 you expect to see: titles with 1 or 2 items with ratio 1 title with 1 item for ratio 2 nothing with ratio 3 7. Place another hold on each of the record 8. Repeat 3 you expect to see: titles with 1 or 2 or 3 items with ratio 1 title with 1 item or 2 items for ratio 2 nothing with ratio 3 9. Make sure there is no regression in the test plan of bug 15422

CONFLICT (content): Merge conflict in circ/reserveratios.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 25760: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered The copy of the patch that failed is found in: .git/rebase-apply/patch

Created attachment 119324 [details] [review] Bug 25760: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered On bug 15422 we made it so that only holds with copies to buy to acheive the holds ratio showed Users have reported that they want to see record where there are 0 copies to buy i.e. the holds ration matches the value entered This patch changes the criteria for returning holds to be if the ratio for a given title is equal to or greater then the ratio specified in the form I also renamed 'ratiocalc' to 'copies_to_buy' since that is what is contains Test plan: 1. Create bibliographic records with 1, 2 and 3 items 2. Place 1 hold on each of them 3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 4. You expect to see: the title with 1 item with ratio 1 nothing otherwise 5. Place another hold on each of the record 6. Repeat 3 you expect to see: titles with 1 or 2 items with ratio 1 title with 1 item for ratio 2 nothing with ratio 3 7. Place another hold on each of the record 8. Repeat 3 you expect to see: titles with 1 or 2 or 3 items with ratio 1 title with 1 item or 2 items for ratio 2 nothing with ratio 3 9. Make sure there is no regression in the test plan of bug 15422 Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> I was able to apply the patch and test it. Some comments. When I adding the third hold on each record in step 7, It will result in the following result: titles with 1 or 2 or 3 items with ratio 1 title with 1 items with ratio 2 because the title with 2 items will get a ratio of 1.50 and not 2. title with 1 items with with ratio 3

Created attachment 119385 [details] [review] Bug 25760: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered On bug 15422 we made it so that only holds with copies to buy to acheive the holds ratio showed Users have reported that they want to see record where there are 0 copies to buy i.e. the holds ration matches the value entered This patch changes the criteria for returning holds to be if the ratio for a given title is equal to or greater then the ratio specified in the form I also renamed 'ratiocalc' to 'copies_to_buy' since that is what is contains Test plan: 1. Create bibliographic records with 1, 2 and 3 items 2. Place 1 hold on each of them 3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 4. You expect to see: the title with 1 item with ratio 1 nothing otherwise 5. Place another hold on each of the record 6. Repeat 3 you expect to see: titles with 1 or 2 items with ratio 1 title with 1 item for ratio 2 nothing with ratio 3 7. Place another hold on each of the record 8. Repeat 3 you expect to see: titles with 1 or 2 or 3 items with ratio 1 title with 1 item or 2 items for ratio 2 nothing with ratio 3 9. Make sure there is no regression in the test plan of bug 15422 Comments from Frank Hansen: Some comments. When I adding the third hold on each record in step 7, It will result in the following result: titles with 1 or 2 or 3 items with ratio 1 title with 1 items with ratio 2 because the title with 2 items will get a ratio of 1.50 and not 2. title with 1 items with with ratio 3 Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Noting that entering a ratio less than 1 yields mathematically correct but perhaps unexpected results. It might be a good idea to restrict the ratio input to accept 1 as a minimum value, but I don't think that need hold up this patch.

Created attachment 120750 [details] [review] Bug 25760: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered On bug 15422 we made it so that only holds with copies to buy to acheive the holds ratio showed Users have reported that they want to see record where there are 0 copies to buy i.e. the holds ration matches the value entered This patch changes the criteria for returning holds to be if the ratio for a given title is equal to or greater then the ratio specified in the form I also renamed 'ratiocalc' to 'copies_to_buy' since that is what is contains Test plan: 1. Create bibliographic records with 1, 2 and 3 items 2. Place 1 hold on each of them 3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 4. You expect to see: the title with 1 item with ratio 1 nothing otherwise 5. Place another hold on each of the record 6. Repeat 3 you expect to see: titles with 1 or 2 items with ratio 1 title with 1 item for ratio 2 nothing with ratio 3 7. Place another hold on each of the record 8. Repeat 3 you expect to see: titles with 1 or 2 or 3 items with ratio 1 title with 1 item or 2 items for ratio 2 nothing with ratio 3 9. Make sure there is no regression in the test plan of bug 15422 Comments from Frank Hansen: Some comments. When I adding the third hold on each record in step 7, It will result in the following result: titles with 1 or 2 or 3 items with ratio 1 title with 1 items with ratio 2 because the title with 2 items will get a ratio of 1.50 and not 2. title with 1 items with with ratio 3 Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Created attachment 120774 [details] [review] Bug 25760: [Alternate] (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered On bug 15422 we made it so that only holds with copies to buy to acheive the holds ratio showed Users have reported that they want to see record where there are 0 copies to buy i.e. the holds ration matches the value entered This patch changes the criteria for returning holds to be if the ratio for a given title is equal to or greater then the ratio specified in the form I also renamed 'ratiocalc' to 'copies_to_buy' since that is what is contains Test plan: 1. Create bibliographic records with 1, 2 and 3 items 2. Place 1 hold on each of them 3. Go to the Hold ratios report and search with ratio = 1, 2 then 3 4. You expect to see: the title with 1 item with ratio 1 nothing otherwise 5. Place another hold on each of the record 6. Repeat 3 you expect to see: titles with 1 or 2 items with ratio 1 title with 1 item for ratio 2 nothing with ratio 3 7. Place another hold on each of the record 8. Repeat 3 you expect to see: titles with 1 or 2 or 3 items with ratio 1 title with 1 item or 2 items for ratio 2 nothing with ratio 3 9. Make sure there is no regression in the test plan of bug 15422 Comments from Frank Hansen: Some comments. When I adding the third hold on each record in step 7, It will result in the following result: titles with 1 or 2 or 3 items with ratio 1 title with 1 items with ratio 2 because the title with 2 items will get a ratio of 1.50 and not 2. title with 1 items with with ratio 3 Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Pushed to master for 21.05, thanks to everybody involved!

Pushed to 20.11.x for 20.11.06

Pushed to 20.05.x for 20.05.12

Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.