% if ( @cust_main ) {

Duplicate customer
Choose an existing customer % foreach (@cust_main) { % my $custnum = $_->custnum; % } #foreach cust_main
<% $custnum %>: <% $_->name |h %>—<%$_->ucfirst_cust_status%>
<% $_->address1 |h %>
<% $_->city |h %>, <% $_->state %>  <% $_->zip %>
% } %# else return nothing <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('List customers'); my $conf = new FS::Conf; my $sub = $cgi->param('sub'); my $hashref = decode_json($cgi->param('arg')); my @cust_main = qsearch('cust_main', $hashref); my $set_to_customer = <