@@ -, +, @@ appropriate rounding --- C4/Acquisition.pm | 2 +- C4/Budgets.pm | 2 +- t/db_dependent/Budgets.t | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -2013,7 +2013,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 ("CEIL($round_string*100)/100"); } + if ( $rounding_pref eq "nearest_cent" ) { return ("CAST($round_string*100 AS INTEGER)/100"); } else { return ("$round_string"); } } --- a/C4/Budgets.pm +++ a/C4/Budgets.pm @@ -1345,7 +1345,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 "CEIL($to_round*100)/100"; } + if ($rounding_pref eq 'nearest_cent') { return "CAST($to_round*100 AS INTEGER)/100"; } else { return "$to_round"; } } --- a/t/db_dependent/Budgets.t +++ a/t/db_dependent/Budgets.t @@ -852,7 +852,7 @@ subtest 'GetBudgetSpent GetBudgetOrdered tests' => sub { t::lib::Mocks::mock_preference('OrderPriceRounding','nearest_cent'); $spent_ordered = GetBudgetOrdered( $spent_order->{budget_id} ); - is($spent_ordered,'78.80',"We expect the ordered amount to be equal to the estimated price rounded times quantity"); + is($spent_ordered,'78.8000',"We expect the ordered amount to be equal to the estimated price rounded times quantity"); #Okay, now we can receive the order, giving the price as the user would --