<%init> my $conf = new FS::Conf; my $countrydefault = $conf->config('countrydefault') || 'US'; my %opt = @_; my $cust_main = $opt{'cust_main'}; my $locationnum = $opt{'curr_value'}; $opt{'cust_location'} ||= [ $cust_main ? $cust_main->cust_location : () ]; my $addnew = exists($opt{addnew}) ? $opt{addnew} : $cust_main ? 1 : ( $locationnum>0 ? 0 : 1 );