|
Lines 29-35
use C4::Circulation;
Link Here
|
| 29 |
use C4::Members; |
29 |
use C4::Members; |
| 30 |
use C4::Biblio; |
30 |
use C4::Biblio; |
| 31 |
use Koha::DateUtils; |
31 |
use Koha::DateUtils; |
| 32 |
|
32 |
use Koha::DiscreteCalendar; |
| 33 |
use List::Util qw(shuffle); |
33 |
use List::Util qw(shuffle); |
| 34 |
use List::MoreUtils qw(any); |
34 |
use List::MoreUtils qw(any); |
| 35 |
use Data::Dumper; |
35 |
use Data::Dumper; |
|
Lines 76-82
sub TransportCostMatrix {
Link Here
|
| 76 |
}; |
76 |
}; |
| 77 |
|
77 |
|
| 78 |
if ( C4::Context->preference("HoldsQueueSkipClosed") ) { |
78 |
if ( C4::Context->preference("HoldsQueueSkipClosed") ) { |
| 79 |
$calendars->{$from} ||= Koha::Calendar->new( branchcode => $from ); |
79 |
$calendars->{$from} ||= Koha::DiscreteCalendar->new( branchcode => $from ); |
| 80 |
$transport_cost_matrix{$to}{$from}{disable_transfer} ||= |
80 |
$transport_cost_matrix{$to}{$from}{disable_transfer} ||= |
| 81 |
$calendars->{$from}->is_holiday( $today ); |
81 |
$calendars->{$from}->is_holiday( $today ); |
| 82 |
} |
82 |
} |
|
Lines 205-211
sub CreateQueue {
Link Here
|
| 205 |
$total_requests += scalar(@$hold_requests); |
205 |
$total_requests += scalar(@$hold_requests); |
| 206 |
$total_available_items += scalar(@$available_items); |
206 |
$total_available_items += scalar(@$available_items); |
| 207 |
|
207 |
|
| 208 |
my $item_map = MapItemsToHoldRequests($hold_requests, $available_items, $branches_to_use, $transport_cost_matrix); |
208 |
my $item_map = MapItemsToHoldRequests($hold_requests, $available_items, $branches_to_use, $transport_cost_matrix); |
| 209 |
$item_map or next; |
209 |
$item_map or next; |
| 210 |
my $item_map_size = scalar(keys %$item_map) |
210 |
my $item_map_size = scalar(keys %$item_map) |
| 211 |
or next; |
211 |
or next; |
|
Lines 736-742
sub load_branches_to_pull_from {
Link Here
|
| 736 |
my $today = dt_from_string(); |
736 |
my $today = dt_from_string(); |
| 737 |
if ( C4::Context->preference('HoldsQueueSkipClosed') ) { |
737 |
if ( C4::Context->preference('HoldsQueueSkipClosed') ) { |
| 738 |
@branches_to_use = grep { |
738 |
@branches_to_use = grep { |
| 739 |
!Koha::Calendar->new( branchcode => $_ ) |
739 |
!Koha::DiscreteCalendar->new( branchcode => $_ ) |
| 740 |
->is_holiday( $today ) |
740 |
->is_holiday( $today ) |
| 741 |
} @branches_to_use; |
741 |
} @branches_to_use; |
| 742 |
} |
742 |
} |