From d7b529d9a76a60fec319588307a61cf707682b45 Mon Sep 17 00:00:00 2001 From: gmc Date: Mon, 27 Sep 2010 19:27:04 +0000 Subject: [PATCH] fix glitch in hold target OU weighting We want to weight by the copy's circulation library, not the pickup library. Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@18045 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/Publisher/action.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 28e849e5c5..996acf2708 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -1746,15 +1746,16 @@ sub create_prox_list { my ($prox) = $self->method_lookup('open-ils.storage.asset.copy.proximity')->run( $cp, $lib ); next unless (defined($prox)); + my $copy_circ_lib = ''.$cp->circ_lib; # Fetch the weighting value for hold targeting, defaulting to 1 - $self->{target_weight}{$lib} ||= $actor->request( - 'open-ils.actor.ou_setting.ancestor_default' => $lib.'' => 'circ.holds.org_unit_target_weight' + $self->{target_weight}{$copy_circ_lib} ||= $actor->request( + 'open-ils.actor.ou_setting.ancestor_default' => $copy_circ_lib.'' => 'circ.holds.org_unit_target_weight' )->gather(1); - $self->{target_weight}{$lib} = $self->{target_weight}{$lib}{value} if (ref $self->{target_weight}{$lib}); - $self->{target_weight}{$lib} ||= 1; + $self->{target_weight}{$copy_circ_lib} = $self->{target_weight}{$copy_circ_lib}{value} if (ref $self->{target_weight}{$copy_circ_lib}); + $self->{target_weight}{$copy_circ_lib} ||= 1; $prox_list[$prox] = [] unless defined($prox_list[$prox]); - for my $w ( 1 .. $self->{target_weight}{$lib} ) { + for my $w ( 1 .. $self->{target_weight}{$copy_circ_lib} ) { push @{$prox_list[$prox]}, $cp; } } -- 2.43.2