From ab4cf23286219b473820b61bca82c884de274e80 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 Signed-off-by: Julian Maurice Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- 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 4d33a68636..b28b4b0e10 100644 --- a/C4/Acquisition.pm +++ b/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 ("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 e43b44f4f7..83ed17dc09 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -1382,7 +1382,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.39.5