@@ -, +, @@ --- C4/Acquisition.pm | 2 +- C4/Budgets.pm | 2 +- installer/data/mysql/atomicupdate/bug18736_add_rounding_syspref.perl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -2011,7 +2011,7 @@ 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 ("ROUND($round_string,2)"); } + if ( $rounding_pref eq "nearest_cent" ) { return ("CEIL($round_string*100)/100"); } else { return ("$round_string"); } } --- a/C4/Budgets.pm +++ a/C4/Budgets.pm @@ -1292,7 +1292,7 @@ returns the correct SQL routine based on OrderPriceRounding system preference. sub _get_rounding_sql { my $to_round = shift; my $rounding_pref = C4::Context->preference('OrderPriceRounding'); - if ($rounding_pref eq 'nearest_cent') { return "ROUND($to_round,2)"; } + if ($rounding_pref eq 'nearest_cent') { return "CEIL($to_round*100)/100"; } else { return "$to_round"; } } --- a/installer/data/mysql/atomicupdate/bug18736_add_rounding_syspref.perl +++ a/installer/data/mysql/atomicupdate/bug18736_add_rounding_syspref.perl @@ -1,6 +1,6 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - # $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OrderPriceRounding',NULL,'Local preference for rounding orders before calculations to ensure correct calculations','|nearest_cent','Choice')" ); + $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OrderPriceRounding',NULL,'Local preference for rounding orders before calculations to ensure correct calculations','|nearest_cent','Choice')" ); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 18736 - Add syspref to control order rounding)\n"; --