Bugzilla – Attachment 153639 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.58 KB, created by
Martin Renvoize
on 2023-07-19 11:42:27 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:
Martin Renvoize
Created:
2023-07-19 11:42:27 UTC
Size:
2.58 KB
patch
obsolete
>From 8152fde0764751d44c09bd97d3c560ab4dd88e68 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> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/CirculationRules.pm | 7 ++++--- > admin/smart-rules.pl | 3 ++- > 2 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index 8518aa6112..97438f0e43 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -162,8 +162,9 @@ our $RULE_KINDS = { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > }, > overduefinescap => { >- scope => [ 'branchcode', 'categorycode', 'itemtype' ], >- is_monetary => 1, >+ scope => [ 'branchcode', 'categorycode', 'itemtype' ], >+ is_monetary => 1, >+ can_be_blank => 1, > }, > renewalperiod => { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], >@@ -383,7 +384,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::CirculationRule::NotDecimal->throw( name => $rule_name, value => $rule_value ) >- 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.41.0
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