% } else {
% }
% # permission to edit
% if ( $conf->exists('cust_main-edit_calling_list_exempt') ) {
calling_list_exempt ? 'CHECKED' : '' %>>
<% mt('Calling list exempt') |h %>
% } else {
% }
<%init>
my( $cust_main, %opt ) = @_;
my $custnum = $opt{'custnum'};
if ( $cgi->param('error') ) {
$cust_main->set('residential_commercial',
($cgi->param('residential_commercial') eq 'Commercial')
? 'Commercial'
: 'Residential'
);
} elsif ( $custnum ) { #editing
$cust_main->set('residential_commercial',
length($cust_main->company)
? 'Commercial'
: 'Residential'
);
} else { #new customer
#config to default to commercial and/or disable residential when someone needs
$cust_main->set('residential_commercial', 'Residential');
}
my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
my $r = qq!* !;
# which agents lock the service address, if any
my %ship_locked_agents;
foreach (qsearch('agent',{})) {
my $agentnum = $_->agentnum;
next unless $conf->exists('agent-ship_address', $_->agentnum);
my $cust_main = $_->agent_cust_main or next;
my $agent_ship_location = $cust_main->ship_location;
$ship_locked_agents{$agentnum} = +{
map { $_ => $agent_ship_location->$_ }
qw(address1 city state zip country latitude longitude district)
};
}
%init>