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 <julian.maurice@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
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"); }
}
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"; }
}