2 <CENTER><BR><B>Duplicate customer</B><BR>
3 Choose an existing customer
5 <FORM name="DuplicateForm">
6 % foreach (@cust_main) {
7 % my $custnum = $_->custnum;
9 <TD ALIGN="right" VALIGN="top"><B><% $custnum %>: </B></TD>
11 <% $_->name |h %>—<B><FONT COLOR="#<%$_->statuscolor%>"><%$_->cust_status_label%></FONT></B><BR>
12 <% $_->address1 |h %><BR>
13 <% $_->city |h %>, <% $_->state %> <% $_->zip %>
16 <INPUT TYPE="radio" NAME="dup_custnum" VALUE="<%$custnum%>">
19 % } #foreach cust_main
25 <BUTTON TYPE="button" onclick="submit_continue();">
26 <IMG SRC="<%$p%>images/error.png"> Create a new customer
30 <BUTTON TYPE="button" onclick="<% $set_to_customer %>">
31 <IMG SRC="<%$p%>images/tick.png"> Use the selected customer
36 <TD COLSPAN=2 ALIGN="center">
37 <BUTTON TYPE="button" onclick="submit_abort();">
38 <IMG SRC="<%$p%>images/cross.png"> Cancel submission
43 %# else return nothing
47 unless $FS::CurrentUser::CurrentUser->access_right('List customers');
49 my $conf = new FS::Conf;
51 my $sub = $cgi->param('sub');
52 my $hashref = decode_json($cgi->param('arg'));
53 my $search = FS::cust_main->search($hashref);
54 #warn Dumper($search);
55 my @cust_main = qsearch( $search );
57 my $set_to_customer = <<EOF;
58 var custnum_array = document.getElementsByName('dup_custnum');
60 for(i=0; i<custnum_array.length; i++) {
61 if(custnum_array[i].checked) {
62 custnum = custnum_array[i].value;
65 //alert('Setting to customer '+custnum);
66 document.CustomerForm.elements['duplicate_of_custnum'].value = custnum;