Bugzilla – Attachment 152510 Details for
Bug 33028
Wrongly formatted monetary amounts in circulation rules break scripts and calculations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33028: (follow-up) Move monetary definition into hash
Bug-33028-follow-up-Move-monetary-definition-into-.patch (text/plain), 2.33 KB, created by
Katrin Fischer
on 2023-06-21 10:48:47 UTC
(
hide
)
Description:
Bug 33028: (follow-up) Move monetary definition into hash
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-06-21 10:48:47 UTC
Size:
2.33 KB
patch
obsolete
>From 106965c3ce5b45f4cacf04badcdbfb81ffcdeff4 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 3 Mar 2023 11:28:20 +0000 >Subject: [PATCH] Bug 33028: (follow-up) Move monetary definition into hash > >This patch moves the defintion of monetary rule type into the rule kinds >hash. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/CirculationRules.pm | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index d002937237..5f6d31c851 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -101,8 +101,9 @@ our $RULE_KINDS = { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > }, > fine => { >- scope => [ 'branchcode', 'categorycode', 'itemtype' ], >- }, >+ scope => [ 'branchcode', 'categorycode', 'itemtype' ], >+ is_monetary => 1, >+ }, > finedays => { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > }, >@@ -159,8 +160,9 @@ our $RULE_KINDS = { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > }, > overduefinescap => { >- scope => [ 'branchcode', 'categorycode', 'itemtype' ], >- }, >+ scope => [ 'branchcode', 'categorycode', 'itemtype' ], >+ is_monetary => 1, >+ }, > renewalperiod => { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > }, >@@ -376,6 +378,8 @@ sub set_rule { > my $rule_value = $params->{rule_value}; > my $can_be_blank = defined $kind_info->{can_be_blank} ? $kind_info->{can_be_blank} : 1; > $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; >+ $rule_value = Koha::Number::Price->new($rule_value)->unformat if defined $rule_value && $is_monetary; > > for my $v ( $branchcode, $categorycode, $itemtype ) { > $v = undef if $v and $v eq '*'; >@@ -389,12 +393,6 @@ sub set_rule { > } > )->next(); > >- if ( $rule >- && ( $rule->rule_name eq 'overduefinescap' || $rule->rule_name eq 'fine' ) ) >- { >- $rule_value = Koha::Number::Price->new($rule_value)->unformat; >- } >- > if ($rule) { > if ( defined $rule_value ) { > $rule->rule_value($rule_value); >-- >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 33028
:
147058
|
147686
|
147687
|
147688
|
152441
|
152442
|
152443
|
152444
|
152445
|
152446
|
152509
|
152510
|
152511
|
152512
|
152513
|
152514
|
152515
|
152752
|
152753
|
152754
|
152755
|
152756
|
152757
|
152758
|
152759
|
152760
|
152761
|
152762
|
152763
|
152764
|
152803
|
152804
|
152805
|
152829
|
152928
|
152929
|
152930
|
152931
|
152932
|
152933
|
152934
|
152935
|
152936
|
153313
|
153314
|
153315
|
153316
|
153317
|
153318
|
153319
|
153320
|
153321
|
153322
|
153323
|
153619
|
153620
|
153632
|
153633
|
153634
|
153635
|
153636
|
153677