Lines 101-108
our $RULE_KINDS = {
Link Here
|
101 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
101 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
102 |
}, |
102 |
}, |
103 |
fine => { |
103 |
fine => { |
104 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
104 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
105 |
}, |
105 |
is_monetary => 1, |
|
|
106 |
}, |
106 |
finedays => { |
107 |
finedays => { |
107 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
108 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
108 |
}, |
109 |
}, |
Lines 159-166
our $RULE_KINDS = {
Link Here
|
159 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
160 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
160 |
}, |
161 |
}, |
161 |
overduefinescap => { |
162 |
overduefinescap => { |
162 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
163 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
163 |
}, |
164 |
is_monetary => 1, |
|
|
165 |
}, |
164 |
renewalperiod => { |
166 |
renewalperiod => { |
165 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
167 |
scope => [ 'branchcode', 'categorycode', 'itemtype' ], |
166 |
}, |
168 |
}, |
Lines 376-381
sub set_rule {
Link Here
|
376 |
my $rule_value = $params->{rule_value}; |
378 |
my $rule_value = $params->{rule_value}; |
377 |
my $can_be_blank = defined $kind_info->{can_be_blank} ? $kind_info->{can_be_blank} : 1; |
379 |
my $can_be_blank = defined $kind_info->{can_be_blank} ? $kind_info->{can_be_blank} : 1; |
378 |
$rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank; |
380 |
$rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank; |
|
|
381 |
my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary} : 0; |
382 |
$rule_value = Koha::Number::Price->new($rule_value)->unformat if defined $rule_value && $is_monetary; |
379 |
|
383 |
|
380 |
for my $v ( $branchcode, $categorycode, $itemtype ) { |
384 |
for my $v ( $branchcode, $categorycode, $itemtype ) { |
381 |
$v = undef if $v and $v eq '*'; |
385 |
$v = undef if $v and $v eq '*'; |
Lines 389-400
sub set_rule {
Link Here
|
389 |
} |
393 |
} |
390 |
)->next(); |
394 |
)->next(); |
391 |
|
395 |
|
392 |
if ( $rule |
|
|
393 |
&& ( $rule->rule_name eq 'overduefinescap' || $rule->rule_name eq 'fine' ) ) |
394 |
{ |
395 |
$rule_value = Koha::Number::Price->new($rule_value)->unformat; |
396 |
} |
397 |
|
398 |
if ($rule) { |
396 |
if ($rule) { |
399 |
if ( defined $rule_value ) { |
397 |
if ( defined $rule_value ) { |
400 |
$rule->rule_value($rule_value); |
398 |
$rule->rule_value($rule_value); |
401 |
- |
|
|