Bug 33796 - Holds Queue builder never looks at any but the least cost branch of the transport cost matrix
Summary: Holds Queue builder never looks at any but the least cost branch of the trans...
Status: RESOLVED DUPLICATE of bug 35826
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
: 34673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-22 15:23 UTC by Kyle M Hall (khall)
Modified: 2024-02-15 16:01 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 33796: Holds Queue builder should check more than just least cost branch for TCM (9.33 KB, patch)
2023-05-22 18:33 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2023-05-22 15:23:21 UTC
If for some reason all the items from the least cost branch fail ( can't be transferred, fail the hold policy, non-matching itemtype filter, etc ), Koha does not check the next cheapest branch, but instead moves onto the "fall back to basics" code. We should loop over all the branches from least costly to most costly to find the least costly items that can be used.
Comment 1 Kyle M Hall (khall) 2023-05-22 18:33:09 UTC
Created attachment 151541 [details] [review]
Bug 33796: Holds Queue builder should check more than just least cost branch for TCM

If for some reason all the items from the least cost branch fail ( can't be transferred, fail the hold policy, non-matching itemtype filter, etc ), Koha does not check the next cheapest branch, but instead moves onto the "fall back to basics" code. We should loop over all the branches from least costly to most costly to find the least costly items that can be used.

Test Plan:
1) Set up TCM so it's cheapest to transport item from A to C than from
   B to C.
2) Place hold for record with items at A and B, for pick at C
3) Disable transfer from A to C
4) Build the holds queue
5) Note the B item was selected over other more costly items, but not
   the less costly A item ( which cannot be transferred ).
Comment 2 Kyle M Hall (khall) 2023-05-22 18:33:57 UTC
Unit tests are failing, but are so complicated I cannot figure out how to fix them!
Comment 3 Kyle M Hall (khall) 2023-09-29 15:23:45 UTC
*** Bug 34673 has been marked as a duplicate of this bug. ***
Comment 4 Andreas Jonsson 2024-01-17 13:17:42 UTC
I think that we should go further.  I am working on a solution for optimizing the item allocation based on the transport cost matrix.  The greedy algorithm that currently is used does not produce optimal allocation.

I have created bug 35826 for this.
Comment 5 Nick Clemens (kidclamp) 2024-02-15 16:01:41 UTC
As 35826 does a better job and is perfomant, closing this in favor of that

*** This bug has been marked as a duplicate of bug 35826 ***