Lines 162-169
our $RULE_KINDS = {
Link Here
|
162 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
162 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
163 |
}, |
163 |
}, |
164 |
overduefinescap => { |
164 |
overduefinescap => { |
165 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
165 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
166 |
is_monetary => 1, |
166 |
is_monetary => 1, |
|
|
167 |
can_be_blank => 1, |
167 |
}, |
168 |
}, |
168 |
renewalperiod => { |
169 |
renewalperiod => { |
169 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
170 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
Lines 383-389
sub set_rule {
Link Here
|
383 |
$rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank; |
384 |
$rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank; |
384 |
my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary} : 0; |
385 |
my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary} : 0; |
385 |
Koha::Exceptions::CirculationRule::NotDecimal->throw( name => $rule_name, value => $rule_value ) |
386 |
Koha::Exceptions::CirculationRule::NotDecimal->throw( name => $rule_name, value => $rule_value ) |
386 |
if ( $is_monetary && defined($rule_value) && $rule_value !~ /^\d+(\.\d{2})?$/ ); |
387 |
if ( $is_monetary && !$can_be_blank && defined($rule_value) && $rule_value !~ /^\d+(\.\d{2})?$/ ); |
387 |
|
388 |
|
388 |
for my $v ( $branchcode, $categorycode, $itemtype ) { |
389 |
for my $v ( $branchcode, $categorycode, $itemtype ) { |
389 |
$v = undef if $v and $v eq '*'; |
390 |
$v = undef if $v and $v eq '*'; |