Bugzilla – Attachment 79562 Details for
Bug 18736
Problems in order calculations (rounding errors)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18736: (QA follow-up) Cosmetic changes
Bug-18736-QA-follow-up-Cosmetic-changes.patch (text/plain), 2.31 KB, created by
Marcel de Rooy
on 2018-09-28 10:26:10 UTC
(
hide
)
Description:
Bug 18736: (QA follow-up) Cosmetic changes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-09-28 10:26:10 UTC
Size:
2.31 KB
patch
obsolete
>From 0ebfe7b5cae7c03b9a4a68655c887a73a1749380 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 28 Sep 2018 10:09:01 +0200 >Subject: [PATCH] Bug 18736: (QA follow-up) Cosmetic changes >Content-Type: text/plain; charset=utf-8 > >[1] Resolve warnings like: >Use of uninitialized value $rounding_pref in string eq at /usr/share/koha/devclone/C4/Acquisition.pm line 2040. > >[2] Fixing unusual use of whitespace too. > >[3] Remove list operator from get_rounding_sql return. Only used in scalar >context. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Acquisition.pm | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 9ccb3a7..2d055a5 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2013,7 +2013,7 @@ sub TransferOrder { > > =head3 get_rounding_sql > >- $rounding_sql = get_rounding_sql("mysql_variable_to_round_string"); >+ $rounding_sql = get_rounding_sql($column_name); > > returns the correct SQL routine based on OrderPriceRounding system preference. > >@@ -2021,9 +2021,11 @@ returns the correct SQL routine based on OrderPriceRounding system preference. > > sub get_rounding_sql { > my ( $round_string ) = @_; >- my $rounding_pref = C4::Context->preference('OrderPriceRounding'); >- if ( $rounding_pref eq "nearest_cent" ) { return ("CAST($round_string*100 AS UNSIGNED)/100"); } >- else { return ("$round_string"); } >+ my $rounding_pref = C4::Context->preference('OrderPriceRounding') // q{}; >+ if ( $rounding_pref eq "nearest_cent" ) { >+ return "CAST($round_string*100 AS UNSIGNED)/100"; >+ } >+ return $round_string; > } > > =head3 get_rounded_price >@@ -2036,9 +2038,11 @@ returns a price rounded as specified in OrderPriceRounding system preference. > > sub get_rounded_price { > my ( $price ) = @_; >- my $rounding_pref = C4::Context->preference('OrderPriceRounding'); >- if( $rounding_pref eq 'nearest_cent' ) { return Koha::Number::Price->new( $price )->round(); } >- else { return $price; } >+ my $rounding_pref = C4::Context->preference('OrderPriceRounding') // q{}; >+ if( $rounding_pref eq 'nearest_cent' ) { >+ return Koha::Number::Price->new( $price )->round(); >+ } >+ return $price; > } > > >-- >2.1.4
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 18736
:
64061
|
64065
|
70187
|
70188
|
70189
|
70768
|
71062
|
71063
|
71627
|
71628
|
71629
|
71630
|
71631
|
71632
|
74335
|
74336
|
74337
|
74338
|
74339
|
74340
|
74341
|
74342
|
74370
|
74371
|
74374
|
74397
|
74398
|
74422
|
74427
|
74438
|
76979
|
76980
|
76981
|
76982
|
76983
|
76984
|
76985
|
76986
|
76987
|
76988
|
76989
|
76990
|
76991
|
77614
|
77615
|
77616
|
77617
|
77618
|
78101
|
78120
|
78981
|
78982
|
78983
|
78984
|
78985
|
78986
|
78987
|
78988
|
79087
|
79088
|
79089
|
79090
|
79091
|
79092
|
79093
|
79094
|
79098
|
79099
|
79100
|
79101
|
79102
|
79103
|
79104
|
79105
|
79187
|
79223
|
79562
|
79563
|
82967
|
82968
|
82969
|
82970
|
82971
|
82972
|
82973
|
82974
|
82975
|
82976
|
82977
|
83212
|
83213
|
83214
|
83973
|
83974
|
83975
|
83976
|
83977
|
83978
|
83979
|
83980
|
83981
|
83982
|
83983
|
83984
|
83985
|
86646
|
86647
|
86648
|
86649
|
86650
|
86651
|
86652
|
86653
|
86654
|
86655
|
86656
|
86657
|
86658