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