73efd370579a8cbf63d60c43674635a3a3c0dc6e
[freeside.git] / httemplate / misc / cust_main-import.cgi
1 <% include("/elements/header.html",'Batch Customer Import') %>
2
3 <FORM ACTION="process/cust_main-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
4
5 Import a CSV file containing customer records.
6 <BR><BR>
7
8 <!-- Simple file format is CSV, with the following field order: <i>cust_pkg.setup, dayphone, first, last, address1, address2, city, state, zip, comments</i>
9 <BR><BR> -->
10
11 Extended file format is CSV, with the following field order: <i>agent_custid, refnum[1]<%$req%>, last<%$req%>, first<%$req%>, address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country, daytime, night, ship_last, ship_first, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, payinfo<%$req%>, paycvv, paydate<%$req%>, invoicing_list, pkgpart, username[2], _password[2]</i>
12 <BR><BR>
13
14 <%$req%> Required fields
15 <BR><BR>
16
17 [1] This field has special treatment upon import: If a string is passed instead
18 of an integer, the string is searched for and if necessary auto-created in the
19 target table.
20 <BR><BR>
21
22 [2] <i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified.
23 <BR><BR>
24
25 <% &ntable("#cccccc") %>
26
27 <% include('/elements/tr-select-agent.html', '', #$agentnum,
28               'label'       => "<B>Agent</B>",
29               'empty_label' => 'Select agent',
30            )
31 %>
32
33 <TR>
34   <TH ALIGN="right">Format</TH>
35   <TD>
36     <SELECT NAME="format">
37 <!--      <OPTION VALUE="simple">Simple -->
38       <OPTION VALUE="extended" SELECTED>Extended
39     </SELECT>
40   </TD>
41 </TR>
42
43 <TR>
44   <TH ALIGN="right">CSV filename</TH>
45   <TD><INPUT TYPE="file" NAME="csvfile"></TD>
46 </TR>
47 % #include('/elements/tr-select-part_referral.html')
48 %
49
50
51 <!--
52 <TR>
53   <TH>First package</TH>
54   <TD>
55     <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
56 % foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) { 
57
58        <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg. ' - '. $part_pkg->comment %></OPTION>
59 % } 
60
61     </SELECT>
62   </TD>
63 </TR>
64 -->
65
66 </TABLE>
67 <BR><BR>
68
69 <INPUT TYPE="submit" VALUE="Import">
70 </FORM>
71
72 <% include('/elements/footer.html') %>
73
74 <%once>
75 my $req = qq!<font color="#ff0000">*</font>!;
76 </%once>