Bugzilla – Attachment 153489 Details for
Bug 32271
Overdue fines cap (amount) set to 0.00 when editing rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value
Bug-32271-QA-follow-up-Convert-all-positive-number.patch (text/plain), 2.31 KB, created by
Katrin Fischer
on 2023-07-14 13:31:06 UTC
(
hide
)
Description:
Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-14 13:31:06 UTC
Size:
2.31 KB
patch
obsolete
>From d1398df470f5df1851b0c1a1dbb247d0deaafec7 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 14 Jul 2023 09:08:51 -0400 >Subject: [PATCH] Bug 32271: (QA follow-up) Convert all positive numbers to > monetary float and convert all 0 equivilents to blank value > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > Koha/CirculationRules.pm | 3 ++- > admin/smart-rules.pl | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index 38cd6a26b0..52a7643f0d 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -163,6 +163,7 @@ our $RULE_KINDS = { > overduefinescap => { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > is_monetary => 1, >+ can_be_blank => 1, > }, > renewalperiod => { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], >@@ -382,7 +383,7 @@ sub set_rule { > $rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank; > my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary} : 0; > Koha::Exceptions::BadParameter->throw("set_rule expected decimal") >- if ( $is_monetary && defined($rule_value) && $rule_value !~ /^\d+(\.\d{2})?$/ ); >+ if ( $is_monetary && !$can_be_blank && defined($rule_value) && $rule_value !~ /^\d+(\.\d{2})?$/ ); > > for my $v ( $branchcode, $categorycode, $itemtype ) { > $v = undef if $v and $v eq '*'; >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index b74a0ceeab..d073bda5d5 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -284,7 +284,8 @@ elsif ($op eq 'add') { > my $rentaldiscount = $input->param('rentaldiscount') || 0; > my $opacitemholds = $input->param('opacitemholds') || 0; > my $article_requests = $input->param('article_requests') || 'no'; >- my $overduefinescap = $input->param('overduefinescap') || q{}; >+ my $overduefinescap = $input->param('overduefinescap') >+ && ( $input->param('overduefinescap') + 0 ) > 0 ? sprintf( "%.02f", $input->param('overduefinescap') ) : q{}; > my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || q{}) eq 'on'; > my $note = $input->param('note'); > my $decreaseloanholds = $input->param('decreaseloanholds') || q{}; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32271
:
144430
|
144528
|
153486
|
153487
|
153488
|
153489
|
153638
|
153639
|
153640
|
153641
|
153642