X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=d84679d4e1480d4ee045147fb3fb2965159cd6f9;hb=56cca7cecebae066e066561ca2c086cfa82f40fe;hp=c36a6e4b76c6b37f9adf90147fc0fd6247cf41bf;hpb=98912ac0e8ca237cb9ce5a969f026a099b2954ea;p=freeside.git diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index c36a6e4b7..d84679d4e 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -112,7 +112,7 @@ function samechanged(what) { t1.style.visibility = 'visible' } } -//samechanged(document.getElementById('same')); +samechanged(document.getElementById('same'));
@@ -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}; @@ -252,7 +259,8 @@ if ( $cgi->param('error') ) { unless $curuser->access_right($custnum ? 'Edit customer' : 'New customer'); @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') ); - $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid'); + $cust_main->setfield( 'paid' => scalar($cgi->param('paid')) ) + if $cgi->param('paid'); $ss = $cust_main->ss; # don't mask an entered value on errors $stateid = $cust_main->stateid; # don't mask an entered value on errors $payinfo = $cust_main->payinfo; # don't mask an entered value on errors