[Bug 42500] New: Update hold ratios (reserveratios.pl) to fetch data via API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Bug ID: 42500 Summary: Update hold ratios (reserveratios.pl) to fetch data via API Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Hold requests Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, lisette@bywatersolutions.com, tomascohen@gmail.com The Hold Ratios page is a pain point for larger systems with many holds. We should update how it fetches, displays, and interacts with data. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42643 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201437 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201437&action=edit Bug 42500: Add filter_by_pending to Koha::Acquisition::Orders The hold ratios report needs to know how many copies are still on order for a biblio. This adds a filter_by_pending method to Koha::Acquisition::Orders returning the orders that have not been cancelled and still have copies left to receive ( quantityreceived less than quantity ), matching the criteria the old CountPendingOrdersByBiblionumber used. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201438 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201438&action=edit Bug 42500: Add unit tests for filter_by_pending Patch from commit 7fa3e6e -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201439 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201439&action=edit Bug 42500: Add Koha::Holds->hold_ratios method This moves the hold ratios aggregation out of the REST controller into a Koha::Holds->hold_ratios class method so it can be unit tested directly. The ratio is computed in SQL and filtered with a HAVING clause, so the database returns only the qualifying biblios and the report can be paginated. The method returns the holds and items counts, the ratio, the number of copies to buy and the library, item type and authorised value codes of the biblio's items, along with the total number of qualifying biblios. Resolving the codes to names is left to the caller. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201440 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201440&action=edit Bug 42500: Add unit tests for hold_ratios Patch from commit 68d8d80 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201441 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201441&action=edit Bug 42500: Add REST API for hold ratios The hold ratios page ( reserveratios.pl ) builds its entire result set in Perl and renders every matching row, which is a pain point for larger systems with many holds. This patch adds a /holds/ratios REST endpoint so the page can fetch the data and paginate it. The hold ratio is computed in SQL and the ratio threshold is applied as a HAVING clause, so the database returns only the biblios that meet the ratio and the endpoint returns one page at a time instead of the whole set. Each row carries the computed holds_count, items_count, hold_ratio, copies_to_buy and the count of copies still on order, along with the home and holding libraries, locations, item types, collections and call numbers of the biblio's items. The old page adjusted the item count when it was reached from an acquisitions basket that creates items on receiving. That adjustment is dropped here; the pending order count is still returned separately. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Place several holds on a biblio that has fewer items than holds 4) curl the endpoint as a librarian with circulate permission: curl -s -u koha:koha "http://localhost:8081/api/v1/holds/ratios?ratio=1" | json_pp 5) Note the biblio is returned with its hold ratio, items needed and item details! 6) Try ratio=99, note the biblio is filtered out! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #6 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201442 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201442&action=edit Bug 42500: Update hold ratios page to fetch data via the API The page used to run the hold ratios query and render every matching row, then hand the full table to DataTables to page through in the browser. On larger systems with many holds that means loading the whole result set on every visit. This patch turns the table into a server side DataTable that fetches from the /holds/ratios API, so only one page of rows is loaded at a time. The sidebar form still drives the ratio and date filters; it reloads the page and seeds the table's API request. The libraries, item types, locations and collections come back ready to display, and the title link, item lists and "to order" button are rendered in the browser. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Place several holds on a biblio with fewer items than holds 4) Go to Circulation -> Hold ratios 5) Note the biblio is listed with its hold ratio, libraries, item types and items needed! 6) Change the hold ratio filter and the dates, click Go 7) Note the list updates to match! 8) Sort by Holds, Items, Hold ratio and Items needed 9) Note the sorting works across pages! 10) Reach the page from an acquisitions basket ( with a vendor and basket in the URL ) 11) Note the "N to order" button links into a new order! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #7 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 201443 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201443&action=edit Bug 42500: Add unit tests REST API endpoint list_ratios Patch from commit 17836ad -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43017 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43017 [Bug 43017] [OMNIBUS] Interface optimization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|42643 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #8 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- In current main, the start date and end date on this page default to today's date in the previous year and today's date, respectively. With this code, they default to a start date of Jan 1 of last year and an end date of Jan 1 of this year. On main, after a search is submitted the date range pickers retain what was used in the search. With this code, after a search the date pickers both show Jan 1 of whatever years were used in the search. On main, the results table includes a search bar with which one can filter based on values in any column except Holds, Items, or Items Needed. With this code, there is no search bar. On main, one can sort the table by any column. This code only allows sorting by Holds, Items, Hold Ratio, and Items Needed. The data all looks correct and the Include ordered and Include suspended checkboxes work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|kyle@bywatersolutions.com |Laura.escamilla@bywatersolu | |tions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #9 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205380 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205380&action=edit Bug 42500: Restore hold ratios report behavior -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201437|0 |1 is obsolete| | Attachment #201438|0 |1 is obsolete| | Attachment #201439|0 |1 is obsolete| | Attachment #201440|0 |1 is obsolete| | Attachment #201441|0 |1 is obsolete| | Attachment #201442|0 |1 is obsolete| | Attachment #201443|0 |1 is obsolete| | Attachment #205380|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #10 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205653 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205653&action=edit Bug 42500: Add filter_by_pending to Koha::Acquisition::Orders The hold ratios report needs to know how many copies are still on order for a biblio. This adds a filter_by_pending method to Koha::Acquisition::Orders returning the orders that have not been cancelled and still have copies left to receive ( quantityreceived less than quantity ), matching the criteria the old CountPendingOrdersByBiblionumber used. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #11 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205654 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205654&action=edit Bug 42500: Add unit tests for filter_by_pending -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #12 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205655&action=edit Bug 42500: Add Koha::Holds->hold_ratios method This moves the hold ratios aggregation out of the REST controller into a Koha::Holds->hold_ratios class method so it can be unit tested directly. The ratio is computed in SQL and filtered with a HAVING clause, so the database returns only the qualifying biblios and the report can be paginated. The method returns the holds and items counts, the ratio, the number of copies to buy and the library, item type and authorised value codes of the biblio's items, along with the total number of qualifying biblios. Resolving the codes to names is left to the caller. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #13 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205656 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205656&action=edit Bug 42500: Add unit tests for hold_ratios -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #14 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205657 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205657&action=edit Bug 42500: Add REST API for hold ratios The hold ratios page ( reserveratios.pl ) builds its entire result set in Perl and renders every matching row, which is a pain point for larger systems with many holds. This patch adds a /holds/ratios REST endpoint so the page can fetch the data and paginate it. The hold ratio is computed in SQL and the ratio threshold is applied as a HAVING clause, so the database returns only the biblios that meet the ratio and the endpoint returns one page at a time instead of the whole set. Each row carries the computed holds_count, items_count, hold_ratio, copies_to_buy and the count of copies still on order, along with the home and holding libraries, locations, item types, collections and call numbers of the biblio's items. The old page adjusted the item count when it was reached from an acquisitions basket that creates items on receiving. That adjustment is dropped here; the pending order count is still returned separately. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Place several holds on a biblio that has fewer items than holds 4) curl the endpoint as a librarian with circulate permission: curl -s -u koha:koha "http://localhost:8081/api/v1/holds/ratios?ratio=1" | json_pp 5) Note the biblio is returned with its hold ratio, items needed and item details! 6) Try ratio=99, note the biblio is filtered out! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #15 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205658 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205658&action=edit Bug 42500: Update hold ratios page to fetch data via the API The page used to run the hold ratios query and render every matching row, then hand the full table to DataTables to page through in the browser. On larger systems with many holds that means loading the whole result set on every visit. This patch turns the table into a server side DataTable that fetches from the /holds/ratios API, so only one page of rows is loaded at a time. The sidebar form still drives the ratio and date filters; it reloads the page and seeds the table's API request. The libraries, item types, locations and collections come back ready to display, and the title link, item lists and "to order" button are rendered in the browser. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Place several holds on a biblio with fewer items than holds 4) Go to Circulation -> Hold ratios 5) Note the biblio is listed with its hold ratio, libraries, item types and items needed! 6) Change the hold ratio filter and the dates, click Go 7) Note the list updates to match! 8) Sort by Holds, Items, Hold ratio and Items needed 9) Note the sorting works across pages! 10) Reach the page from an acquisitions basket ( with a vendor and basket in the URL ) 11) Note the "N to order" button links into a new order! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #16 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205659 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205659&action=edit Bug 42500: Add unit tests REST API endpoint list_ratios -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #17 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205660 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205660&action=edit Bug 42500: Restore hold ratios report behavior -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #18 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Rebased the full Bug 42500 patch series onto current main and regenerated all patches. The previous series could conflict when applying against current main, particularly in t/db_dependent/Koha/Holds.t and reserveratios.tt. The refreshed 8-patch series applies cleanly from current main and includes the Failed QA follow-up fixes for date persistence, global search, and sorting. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43541 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #19 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- In order to test these patches, I've worked to confirm the current functionality, which led me to file Bug 43541, highlighting inconsistencies in how this report counts unreceived orders without attached items. With these patches, the hold ratios report *never* includes unreceived orders without attached items (rather than counting them sometimes, as the current code does), introducing a new and different issue. I don't think it makes sense to replicate the current faulty behavior in these patches, or to patch Bug 43541 on the current code before updating these patches to match the updated behavior. I suggest we simply update these patches to match the ideal behavior I've suggested on Bug 43541: - Allow un-received orders without attached items to be included in the hold ratio items count when one is accessing the hold ratios via circulation - Allow un-received orders without attached items to be included in the hold ratio items count when one is accessing the hold ratios via acquistions regardless of the create_items value of the basket to which one is adding orders - In either circulation or acquisitions, only include un-received orders without attached items if the "Include ordered" checkbox has been selected - Never count un-received orders with attached items (count the item instead) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #20 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Follow-up patches addressing QA feedback from Bug 43541. Itemless pending orders are now counted when "Include ordered" is selected, while orders with attached items are not double-counted. Also fixes the acquisition orders test plan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #21 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 206822 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206822&action=edit Bug 42500: Count itemless pending orders in hold ratios -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #22 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 206823 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206823&action=edit Bug 42500: Fix acquisition orders test plan -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zoho.roboto@bywatersolution | |s.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #23 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- *** Bug 43541 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #24 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Updated test plan: Test Plan: 1) Apply this patch 2) Restart all the things! 3) Place several holds on a biblio with fewer items than holds 4) Go to Circulation -> Hold ratios 5) Note the biblio is listed with its hold ratio, libraries, item types and items needed! 6) Change the hold ratio filter and the dates, click Go 7) Note the list updates to match! 8) Sort by Holds, Items, Hold ratio and Items needed 9) Note the sorting works across pages! 10) Suspend some holds. Confirm suspended holds are not counted unless "Include suspended" is checked 11) Edit an item to set the not for loan value to a negative number. Confirm the item is not counted unless "Include ordered" is checked 12) Create a basket set to create items when placing an order. Place an order, make sure the item that is created has its not for loan value set to a negative value. Confirm the order and item are not counted unless "Include ordered" is checked. Confirm the item and order and never both counted. 13) Create a basket set to create items when receiving an order. Place an order. Confirm the order is not counted unless "Include ordered" is checked. 14) Create a basket set to create items when cataloging. Place an order. Confirm the order is not counted unless "Include ordered" is checked. 15) Reach the page by adding to an acquisitions basket with the "From titles with highest hold ratios" option 16) Confirm items/orders are counted consistently regardless of the "Create items when" value of your basket 17) Note the "N to order" button links into a new order! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement changes release notes| |how data is retrieved for | |the hold ratios report. | |There are no changes in | |interface or functionality | |aside from the correction | |of some inconsistencies in | |the current implementation | |that were found during | |testing. | |- The "include ordered" | |checkbox now toggles the | |inclusion of both items | |with negative integer not | |for loan values and | |unreceived orders without | |associated item records. | |- The "include ordered" | |checkbox now works | |consistently regardless of | |whether one has accessed | |the report via circulation | |or via acquisitions. | |- The "include ordered" | |checkbox now works | |consistently regardless of | |the "Create items when" | |value of the basket to | |which one is adding orders. | |- The "include ordered" | |checkbox no longer | |double-counts on-order | |items where an item with a | |negative integer not for | |loan value is associated | |with an unreceived order. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #205653|0 |1 is obsolete| | Attachment #205654|0 |1 is obsolete| | Attachment #205655|0 |1 is obsolete| | Attachment #205656|0 |1 is obsolete| | Attachment #205657|0 |1 is obsolete| | Attachment #205658|0 |1 is obsolete| | Attachment #205659|0 |1 is obsolete| | Attachment #205660|0 |1 is obsolete| | Attachment #206822|0 |1 is obsolete| | Attachment #206823|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #25 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206933 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206933&action=edit Bug 42500: Add filter_by_pending to Koha::Acquisition::Orders The hold ratios report needs to know how many copies are still on order for a biblio. This adds a filter_by_pending method to Koha::Acquisition::Orders returning the orders that have not been cancelled and still have copies left to receive ( quantityreceived less than quantity ), matching the criteria the old CountPendingOrdersByBiblionumber used. Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #26 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206934&action=edit Bug 42500: Add unit tests for filter_by_pending Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #27 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206935 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206935&action=edit Bug 42500: Add Koha::Holds->hold_ratios method This moves the hold ratios aggregation out of the REST controller into a Koha::Holds->hold_ratios class method so it can be unit tested directly. The ratio is computed in SQL and filtered with a HAVING clause, so the database returns only the qualifying biblios and the report can be paginated. The method returns the holds and items counts, the ratio, the number of copies to buy and the library, item type and authorised value codes of the biblio's items, along with the total number of qualifying biblios. Resolving the codes to names is left to the caller. Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #28 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206936&action=edit Bug 42500: Add unit tests for hold_ratios Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #29 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206937&action=edit Bug 42500: Add REST API for hold ratios The hold ratios page ( reserveratios.pl ) builds its entire result set in Perl and renders every matching row, which is a pain point for larger systems with many holds. This patch adds a /holds/ratios REST endpoint so the page can fetch the data and paginate it. The hold ratio is computed in SQL and the ratio threshold is applied as a HAVING clause, so the database returns only the biblios that meet the ratio and the endpoint returns one page at a time instead of the whole set. Each row carries the computed holds_count, items_count, hold_ratio, copies_to_buy and the count of copies still on order, along with the home and holding libraries, locations, item types, collections and call numbers of the biblio's items. The old page adjusted the item count when it was reached from an acquisitions basket that creates items on receiving. That adjustment is dropped here; the pending order count is still returned separately. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Place several holds on a biblio that has fewer items than holds 4) curl the endpoint as a librarian with circulate permission: curl -s -u koha:koha "http://localhost:8081/api/v1/holds/ratios?ratio=1" | json_pp 5) Note the biblio is returned with its hold ratio, items needed and item details! 6) Try ratio=99, note the biblio is filtered out! Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #30 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206938&action=edit Bug 42500: Update hold ratios page to fetch data via the API The page used to run the hold ratios query and render every matching row, then hand the full table to DataTables to page through in the browser. On larger systems with many holds that means loading the whole result set on every visit. This patch turns the table into a server side DataTable that fetches from the /holds/ratios API, so only one page of rows is loaded at a time. The sidebar form still drives the ratio and date filters; it reloads the page and seeds the table's API request. The libraries, item types, locations and collections come back ready to display, and the title link, item lists and "to order" button are rendered in the browser. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Place several holds on a biblio with fewer items than holds 4) Go to Circulation -> Hold ratios 5) Note the biblio is listed with its hold ratio, libraries, item types and items needed! 6) Change the hold ratio filter and the dates, click Go 7) Note the list updates to match! 8) Sort by Holds, Items, Hold ratio and Items needed 9) Note the sorting works across pages! 10) Reach the page from an acquisitions basket ( with a vendor and basket in the URL ) 11) Note the "N to order" button links into a new order! Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #31 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206939&action=edit Bug 42500: Add unit tests REST API endpoint list_ratios Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #32 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206940&action=edit Bug 42500: Restore hold ratios report behavior Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #33 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206941&action=edit Bug 42500: Count itemless pending orders in hold ratios Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 --- Comment #34 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 206942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206942&action=edit Bug 42500: Fix acquisition orders test plan Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42500 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org