Bugzilla – Attachment 159351 Details for
Bug 35432
Clarify and simplify the workings of MapItemsToHoldRequests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35432: Add comments and POD
Bug-35432-Add-comments-and-POD.patch (text/plain), 3.29 KB, created by
Nick Clemens (kidclamp)
on 2023-11-29 16:41:39 UTC
(
hide
)
Description:
Bug 35432: Add comments and POD
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-11-29 16:41:39 UTC
Size:
3.29 KB
patch
obsolete
>From 2d5f5c722ba9fcc27c0de7da99be477ad3d085bc Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 29 Nov 2023 14:02:08 +0000 >Subject: [PATCH] Bug 35432: Add comments and POD > >--- > C4/HoldsQueue.pm | 27 +++++++++++++++++++++++---- > 1 file changed, 23 insertions(+), 4 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 5e555f4f959..7e8779e22e0 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -395,7 +395,16 @@ sub _checkHoldPolicy { > > =head2 MapItemsToHoldRequests > >- MapItemsToHoldRequests($hold_requests, $available_items, $branches, $transport_cost_matrix) >+ my $item_map = MapItemsToHoldRequests($hold_requests, $available_items, $branches, $transport_cost_matrix) >+ >+ Parameters: >+ $hold_requests is a hash containing hold information built by GetPendingHoldRequestsForBib >+ $available_items is a hash containing item information built by GetItemsAvailableToFillHoldRequestsForBib >+ $branches is an arrayref to a list of branches filled by load_branches_to_pull_from >+ $transport_cost_matrix is a hash of hashes with branchcodes as keys, listing the cost to transfer from that branch to another >+ >+ Returns a hash of hashes with itemnumbers as keys, each itemnumber containing a hash with the information >+ about the hold it has been mapped to. > > =cut > >@@ -548,9 +557,14 @@ sub MapItemsToHoldRequests { > next if $request->{allocated}; > next if defined($request->{itemnumber}); # already handled these > >- # look for local match first >+ # HoldsQueuePrioritizeBranch check >+ # ******************************** > my $pickup_branch = $request->{branchcode} || $request->{borrowerbranch}; >- my ($itemnumber, $holdingbranch); >+ my ($itemnumber, $holdingbranch); # These variables are used for tracking the filling of the hold >+ # $itemnumber, when set, is the item that has been chosen for the hold >+ # $holdingbranch gets set to the pickup branch of the request if there are items held at that branch >+ # otherwise it gets set to the least cost branch of the transport cost matrix >+ # otherwise it gets sets to the first branch from the list of branches to pull from > > my $holding_branch_items = $items_by_branch{$pickup_branch}; > my $priority_branch = C4::Context->preference('HoldsQueuePrioritizeBranch') // 'homebranch'; >@@ -605,6 +619,9 @@ sub MapItemsToHoldRequests { > next; > } > } >+ # End HoldsQueuePrioritizeBranch check >+ # ******************************** >+ > > unless ($itemnumber) { > # not found yet, fall back to basics >@@ -620,7 +637,9 @@ sub MapItemsToHoldRequests { > my $holding_branch_items = $items_by_branch{$branch} > or next; > >- $holdingbranch ||= $branch; >+ $holdingbranch ||= $branch; # We set this as the first from the list of pull branches >+ # unless we set it above to the pickupbranch or the least cost branch >+ # FIXME: The itention is to follow StaticHoldsQueueWeight, but we don't check that pref > foreach my $item (@$holding_branch_items) { > next if $pickup_branch ne $item->{homebranch}; > next unless _checkHoldPolicy($item, $request); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35432
:
159351
|
159352
|
159353
|
159354
|
159355
|
159381
|
159382
|
159383
|
159384
|
159385
|
162194
|
162195
|
162196
|
162197
|
162198