From f96d1a4a1521d2e59ae9e1fbf6f1e9e74773b5b3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Sun, 16 Sep 2018 01:21:16 +0000 Subject: [PATCH] Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER More recent MySql versions require the use of SIGNED or UNSIGNED rather than INTEGER. UNSIGNED will still work in older installs --- C4/Acquisition.pm | 2 +- C4/Budgets.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index d9ec0f0..522f6d5 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -2021,7 +2021,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 ("CAST($round_string*100 AS INTEGER)/100"); } + if ( $rounding_pref eq "nearest_cent" ) { return ("CAST($round_string*100 AS UNSIGNED)/100"); } else { return ("$round_string"); } } diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 40d11a1..192878f 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -1359,7 +1359,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 "CAST($to_round*100 AS INTEGER)/100"; } + if ($rounding_pref eq 'nearest_cent') { return "CAST($to_round*100 AS UNSIGNED)/100"; } else { return "$to_round"; } } -- 2.1.4