diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-08-03 12:27:05 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-08-03 19:32:48 -0500 |
commit | d75c483901028621700cad4c1b27e9ebc19d985d (patch) | |
tree | c5ee74502136215c3d35458dadba889217b50e91 /httemplate | |
parent | c8ea63ee0f94ff3d3ac3917e41b0e38fb53b3fd4 (diff) |
RT#71518: Bug in the address editor [v3 reconcile]
Diffstat (limited to 'httemplate')
-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 e9d131a78..4399c4348 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -225,12 +225,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}; |