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

(-)a/Koha/CirculationRules.pm (-3 / +4 lines)
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 '*';
(-)a/admin/smart-rules.pl (-2 / +2 lines)
Lines 284-290 elsif ($op eq 'add') { Link Here
284
    my $rentaldiscount = $input->param('rentaldiscount') || 0;
284
    my $rentaldiscount = $input->param('rentaldiscount') || 0;
285
    my $opacitemholds = $input->param('opacitemholds') || 0;
285
    my $opacitemholds = $input->param('opacitemholds') || 0;
286
    my $article_requests = $input->param('article_requests') || 'no';
286
    my $article_requests = $input->param('article_requests') || 'no';
287
    my $overduefinescap = $input->param('overduefinescap') || q{};
287
    my $overduefinescap = $input->param('overduefinescap')
288
        && ( $input->param('overduefinescap') + 0 ) > 0 ? sprintf( "%.02f", $input->param('overduefinescap') ) : q{};
288
    my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || q{}) eq 'on';
289
    my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || q{}) eq 'on';
289
    my $note = $input->param('note');
290
    my $note = $input->param('note');
290
    my $decreaseloanholds = $input->param('decreaseloanholds') || q{};
291
    my $decreaseloanholds = $input->param('decreaseloanholds') || q{};
291
- 

Return to bug 32271