From: ivan <ivan>
Date: Thu, 29 Sep 2011 05:54:25 +0000 (+0000)
Subject: fix DBI binding for negative integers, shoudl fix CCH update, RT#14243
X-Git-Tag: freeside_2_1_3~9
X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=f7fa2159d28bbb66e19ac7b585b2406341ec93df

fix DBI binding for negative integers, shoudl fix CCH update, RT#14243
---

diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index e5bfb0a89..ad26d6041 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -265,7 +265,7 @@ sub _bind_type {
 
   my $bind_type = { TYPE => SQL_VARCHAR };
 
-  if ( $type =~ /(big)?(int|serial)/i && $value =~ /^\d+(\.\d+)?$/ ) {
+  if ( $type =~ /(big)?(int|serial)/i && $value =~ /^-?\d+(\.\d+)?$/ ) {
 
     $bind_type = { TYPE => SQL_INTEGER };