[Koha-bugs] [Bug 33028] The decimal separator 'comma' and its consequences on the calculation of fines (crons)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 3 12:23:55 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33028

--- Comment #4 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Comment on attachment 147058
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147058
Bug 33028: Fix calculations around cronjob fines.pl

Review of attachment 147058:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=33028&attachment=147058)
-----------------------------------------------------------------

::: Koha/CirculationRules.pm
@@ +392,5 @@
> +    if ( $rule
> +    && ( $rule->rule_name eq 'overduefinescap' || $rule->rule_name eq 'fine' ) )
> +    {
> +        $rule_value = Koha::Number::Price->new($rule_value)->unformat;
> +    }

I think we should generalise this and add it as a parameter in the hash above..

i.e.

. . . 

     overduefinescap => {                                                       
         scope => [ 'branchcode', 'categorycode', 'itemtype' ],                 
         is_monetary => 1,
     }, 

. . .

my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary}
: 0;
$rule_value = Koha::Number::Price->new($rule_value)->unformat if $is_monetary;

. . .

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list