projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c19528e
)
fix tax report under MySQL, RT#17856
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 31 May 2012 08:30:24 +0000
(
01:30
-0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 31 May 2012 08:30:24 +0000
(
01:30
-0700)
FS/FS/cust_location.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_location.pm
b/FS/FS/cust_location.pm
index
1f07aa8
..
2810dc9
100644
(file)
--- a/
FS/FS/cust_location.pm
+++ b/
FS/FS/cust_location.pm
@@
-4,7
+4,7
@@
use base qw( FS::geocode_Mixin FS::Record );
use strict;
use vars qw( $import );
use Locale::Country;
use strict;
use vars qw( $import );
use Locale::Country;
-use FS::UID qw( dbh );
+use FS::UID qw( dbh
driver_name
);
use FS::Record qw( qsearch ); #qsearchs );
use FS::Conf;
use FS::prospect_main;
use FS::Record qw( qsearch ); #qsearchs );
use FS::Conf;
use FS::prospect_main;
@@
-507,9
+507,11
@@
sub in_county_sql {
('state') x $x,
'country');
('state') x $x,
'country');
+ my $text = (driver_name =~ /^mysql/i) ? 'char' : 'text';
+
my @where = (
my @where = (
- "cust_location.district = ? OR ? = '' OR CAST(? AS text) IS NULL",
- "cust_location.city = ? OR ? = '' OR CAST(? AS text) IS NULL",
+ "cust_location.district = ? OR ? = '' OR CAST(? AS
$
text) IS NULL",
+ "cust_location.city = ? OR ? = '' OR CAST(? AS
$
text) IS NULL",
"cust_location.county = ? OR (? = '' AND cust_location.county IS NULL) $ornull",
"cust_location.state = ? OR (? = '' AND cust_location.state IS NULL ) $ornull",
"cust_location.country = ?"
"cust_location.county = ? OR (? = '' AND cust_location.county IS NULL) $ornull",
"cust_location.state = ? OR (? = '' AND cust_location.state IS NULL ) $ornull",
"cust_location.country = ?"