View | Details | Raw Unified | Return to bug 26510
Collapse All | Expand All

(-)a/C4/HoldsQueue.pm (-1 / +4 lines)
Lines 61-66 Returns Transport Cost Matrix as a hashref <to branch code> => <from branch code Link Here
61
=cut
61
=cut
62
62
63
sub TransportCostMatrix {
63
sub TransportCostMatrix {
64
    my ( $params ) = @_;
65
    my $ignore_holds_queue_skip_closed = $params->{ignore_holds_queue_skip_closed};
66
64
    my $dbh   = C4::Context->dbh;
67
    my $dbh   = C4::Context->dbh;
65
    my $transport_costs = $dbh->selectall_arrayref("SELECT * FROM transport_cost",{ Slice => {} });
68
    my $transport_costs = $dbh->selectall_arrayref("SELECT * FROM transport_cost",{ Slice => {} });
66
69
Lines 77-83 sub TransportCostMatrix { Link Here
77
            disable_transfer => $disabled
80
            disable_transfer => $disabled
78
        };
81
        };
79
82
80
        if ( C4::Context->preference("HoldsQueueSkipClosed") ) {
83
        if ( !$ignore_holds_queue_skip_closed && C4::Context->preference("HoldsQueueSkipClosed") ) {
81
            $calendars->{$from} ||= Koha::Calendar->new( branchcode => $from );
84
            $calendars->{$from} ||= Koha::Calendar->new( branchcode => $from );
82
            $transport_cost_matrix{$to}{$from}{disable_transfer} ||=
85
            $transport_cost_matrix{$to}{$from}{disable_transfer} ||=
83
              $calendars->{$from}->is_holiday( $today );
86
              $calendars->{$from}->is_holiday( $today );
(-)a/admin/transport-cost-matrix.pl (-2 / +1 lines)
Lines 46-52 my $update = ( $input->param('op') // '' ) eq 'set-cost-matrix'; Link Here
46
46
47
my ($cost_matrix, $have_matrix);
47
my ($cost_matrix, $have_matrix);
48
unless ($update) {
48
unless ($update) {
49
    $cost_matrix = TransportCostMatrix();
49
    $cost_matrix = TransportCostMatrix({ ignore_holds_queue_skip_closed => 1 });
50
    $have_matrix = keys %$cost_matrix if $cost_matrix;
50
    $have_matrix = keys %$cost_matrix if $cost_matrix;
51
}
51
}
52
52
53
- 

Return to bug 26510