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

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

Return to bug 28510