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

(-)a/Koha/CirculationRules.pm (-1 / +2 lines)
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 '*';
(-)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