diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-08-03 17:52:34 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-08-03 17:52:34 -0700 |
commit | cf54023e010df76e0c39ac70902877d7c4c94c6e (patch) | |
tree | 8109fa975ae8ecb4435172f9a990435a734c67b6 /httemplate/edit/cust_main.cgi | |
parent | d7759b49c2ff3b220ab328767645bfed85d18f31 (diff) | |
parent | ecf1c9cc0a20be6e489657e005ea771977b9f69c (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/cust_main.cgi')
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 39cddc021..b314d2d6e 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -203,12 +203,19 @@ if ( $cgi->param('error') ) { my %locations; for my $pre (qw(bill ship)) { my %hash; - foreach ( FS::cust_main->location_fields ) { - $hash{$_} = scalar($cgi->param($pre.'_'.$_)); + foreach my $locfield ( FS::cust_main->location_fields ) { + # don't search on lat/long, string values can cause qsearchs to die + next if grep {$_ eq $locfield} qw(latitude longitude); + $hash{$locfield} = scalar($cgi->param($pre.'_'.$locfield)); } $hash{'custnum'} = $cgi->param('custnum'); $locations{$pre} = qsearchs('cust_location', \%hash) || FS::cust_location->new( \%hash ); + # now set lat/long, for redisplay of entered values + foreach my $locfield ( qw(latitude longitude) ) { + my $locvalue = scalar($cgi->param($pre.'_'.$locfield)); + $locations{$pre}->set($locfield,$locvalue); + } } if ( $same ) { $locations{ship} = $locations{bill}; |