1 <% include('elements/process.html',
2 'table' => 'prospect_main',
3 'precheck_callback' => $precheck,
4 'args_callback' => $args_callback,
8 'fields' => \@contact_fields,
10 'redirect' => popurl(3). 'view/prospect_main.html?',
17 my $vendor = FS::Conf->new->config('tax_data_vendor');
18 if ( $vendor eq 'avalara' or $vendor eq 'suretax' ) {
19 if ( ! $cgi->param('taxstatusnum') ) {
20 return 'Tax status required';
25 my $args_callback = sub {
26 my( $cgi, $object ) = @_;
28 $cgi->param('locationnum') =~ /^(\-?\d*)$/
29 or die 'illegal locationnum '. $cgi->param('locationnum');
32 return ( 'cust_location' => '' ) unless $locationnum;
34 my $cust_location = new FS::cust_location {
35 map { $_ => scalar($cgi->param($_)) }
36 qw( address1 address2 city county state zip country
38 location_kind location_type location_number
42 $cust_location->locationnum($locationnum) unless $locationnum == -1;
44 ( 'cust_location' => $cust_location );
48 my @contact_fields = qw( classnum first last title comment emailaddress );
49 foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) {
50 push @contact_fields, 'phonetypenum'.$phone_type->phonetypenum;