invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / misc / contact-import.cgi
1 <% include("/elements/header.html",'Batch Contacts Import') %>
2
3 Import a file containing customer contact records.
4 <BR><BR>
5
6 <& /elements/form-file_upload.html,
7      'name'      => 'ContactImportForm',
8      'action'    => 'process/contact-import.cgi',
9      'num_files' => 1,
10      'fields'    => [ 'custbatch', 'format' ],
11      'message'   => 'Customer contacts import successful',
12      'onsubmit'  => "document.ContactImportForm.submitButton.disabled=true;",
13 &>
14
15 <% &ntable("#cccccc", 2) %>
16
17   <INPUT TYPE="hidden" NAME="custbatch" VALUE="<% $custbatch %>"%>
18
19   <TR>
20     <TH ALIGN="right">Format</TH>
21     <TD>
22       <SELECT NAME="format">
23         <OPTION VALUE="default" SELECTED>Default
24       </SELECT>
25     </TD>
26   </TR>
27
28   <% include( '/elements/file-upload.html',
29                 'field' => 'file',
30                 'label' => 'Filename',
31             )
32   %>
33
34   <TR>
35     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
36       <INPUT TYPE    = "submit"
37              NAME    = "submitButton"
38              ID      = "submitButton"
39              VALUE   = "Import file"
40       >
41     </TD>
42   </TR>
43
44 </TABLE>
45
46 </FORM>
47
48 <BR>
49
50 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
51 <BR><BR>
52
53 Default Format has the following field order:
54 <BR>
55 <i>custnum<%$req%>, last<%$req%>, first<%$req%>, title<%$req%>, comment, selfservice_access, emailaddress, workphone, mobilephone, homephone</i>
56 <BR><BR>
57
58 Field information:
59 <BR>
60 You must include a customer number and either a last name, first name or title.
61
62 <ul>
63
64   <li><i>custnum</i>: This is the customer number of the customer the contact is attached to.</li>
65
66   <li><i>last</i>: Last name for contact.</li>
67
68   <li><i>first</i>: First name for contact.</li>
69
70   <li><i>title</i>: Optional title for contact.</li>
71
72   <li><i>comment</i>: Optional comment for contact.</li>
73
74   <li><i>selfservice_access</i>: Empty for no self service access or Y if granting self service access.</li>
75
76   <li><i>emailaddress</i>: Email address for contact.</li>
77
78   <li><i>workphone</i>: Work phone number for contact. Format xxxxxxxxxx</li>
79
80   <li><i>mobilephone</i>: Mobile phone number for contact. Format xxxxxxxxxx</li>
81
82   <li><i>homephone</i>: Home phone number for contact. Format xxxxxxxxxx</li>
83
84 </ul>
85
86 <BR>
87
88 <% include('/elements/footer.html') %>
89
90 <%once>
91
92 my $req = qq!<font color="#ff0000">*</font>!;
93
94 </%once>
95 <%init>
96
97 die "access denied"
98   unless $FS::CurrentUser::CurrentUser->access_right('Import');
99
100 my $custbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
101
102 </%init>