@@ -, +, @@
---
C4/HoldsQueue.pm | 8 ++++++--
.../prog/en/modules/admin/transport-cost-matrix.tt | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
--- a/C4/HoldsQueue.pm
+++ a/C4/HoldsQueue.pm
@@ -94,8 +94,12 @@ sub UpdateTransportCostMatrix {
my $cost = $_->{cost};
my $from = $_->{frombranch};
my $to = $_->{tobranch};
- if ( !defined ($cost) || ($cost !~ m/(0|[1-9][0-9]*)(\.[0-9]*)?/o) ) {
- warn "Invalid $from -> $to cost $cost - nust be a number in 0 to 1 range, disablig";
+ if ($_->{disable_transfer}) {
+ $cost ||= 0;
+ }
+ elsif ( !defined ($cost) || ($cost !~ m/(0|[1-9][0-9]*)(\.[0-9]*)?/o) ) {
+ warn "Invalid $from -> $to cost $cost - must be a number >= 0, disablig";
+ $cost = 0;
$_->{disable_transfer} = 1;
}
$sth->execute( $from, $to, $cost, $_->{disable_transfer} ? 1 : 0 );
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt
@@ -28,7 +28,7 @@ function enable_cost_input(cost_id) {
$(cell).removeClass('disabled-transfer');
$('#celldiv_'+cost_id).html(
- ''+
+ ''+
'
Disable '
);
disable_transport_cost(cost_id, disabled);
@@ -106,7 +106,7 @@ $(document).ready(function() {
[% ELSE %]