projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use GROUP BY instead of DISTINCT ON in the state and country queries for better cross...
[freeside.git]
/
FS
/
FS
/
Misc.pm
diff --git
a/FS/FS/Misc.pm
b/FS/FS/Misc.pm
index
101a2d4
..
06fa51f
100644
(file)
--- a/
FS/FS/Misc.pm
+++ b/
FS/FS/Misc.pm
@@
-359,10
+359,12
@@
sub states_hash {
# sort
map { s/[\n\r]//g; $_; }
map { $_->state; }
# sort
map { s/[\n\r]//g; $_; }
map { $_->state; }
- qsearch( 'cust_main_county',
- { 'country' => $country },
- 'DISTINCT ON ( state ) *',
- )
+ qsearch({
+ 'select' => 'state',
+ 'table' => 'cust_main_county',
+ 'hashref' => { 'country' => $country },
+ 'extra_sql' => 'GROUP BY state',
+ })
;
#it could throw a fatal "Invalid country code" error (for example "AX")
;
#it could throw a fatal "Invalid country code" error (for example "AX")