import package definitions, RT#32639
[freeside.git] / httemplate / misc / cust_pkg-import.html
1 <& /elements/header.html, 'Customer package import' &>
2
3 Import a file containing customer packages.
4 <BR><BR>
5
6 <& /elements/form-file_upload.html,
7      'name'      => 'PackageImportForm',
8      'action'    => 'process/cust_pkg-import.html',
9      'num_files' => 1,
10      'fields'    => [ 'agentnum', 'pkgbatch', 'format' ],
11      'message'   => 'Customer package import successful',
12      'url'       => $p."search/cust_pkg.cgi?pkgbatch=$pkgbatch",
13      'onsubmit'  => "document.PackageImportForm.submitButton.disabled=true;"
14 &>
15
16 <% &ntable("#cccccc", 2) %>
17
18   <& /elements/tr-select-agent.html,
19        #'curr_value' => '', #$agentnum,
20        'label'       => "<B>Agent</B>",
21        'empty_label' => 'Select agent',
22   &>
23
24   <INPUT TYPE="hidden" NAME="pkgbatch" VALUE="<% $pkgbatch %>"%>
25
26   <TR>
27     <TH ALIGN="right">Format</TH>
28     <TD>
29       <SELECT NAME="format">
30         <OPTION VALUE="default" SELECTED>Default
31         <OPTION VALUE="default-agent_custid">Default with agent_custid
32         <OPTION VALUE="svc_acct">Account service
33         <OPTION VALUE="svc_acct-agent_custid">Account service with agent_custid
34         <OPTION VALUE="svc_phone">Phone service
35         <OPTION VALUE="svc_phone-agent_custid">Phone service with agent_custid
36         <OPTION VALUE="svc_external">External service
37         <OPTION VALUE="svc_external-agent_custid">External service with agent_custid
38         <OPTION VALUE="location">Location
39         <OPTION VALUE="location-agent_custid">Location with agent_custid
40         <OPTION VALUE="location-agent_custid-agent_pkgid">Location with agent_custid and agent_pkgid
41       </SELECT>
42     </TD>
43   </TR>
44
45   <& /elements/file-upload.html,
46        'field' => 'file',
47        'label' => 'Filename',
48   &>
49
50   <TR>
51     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
52       <INPUT TYPE    = "submit"
53              NAME    = "submitButton"
54              ID      = "submitButton"
55              VALUE   = "Import file"
56       >
57     </TD>
58   </TR>
59
60 </TABLE>
61
62 </FORM>
63
64 <BR>
65 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
66 <BR><BR>
67
68 <b>Default</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire</i>
69 <BR><BR>
70
71 <b>Default with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire</i>
72 <BR><BR>
73
74 <b>Account service</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, username, _password, domsvc</i>
75 <BR><BR>
76
77 <b>Account service with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, username, _password, domsvc</i>
78 <BR><BR>
79
80 <b>Phone sevice</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, phonenum, sip_password, pin</i>
81 <BR><BR>
82
83 <b>Phone service with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, phonenum, sip_password, pin</i>
84 <BR><BR>
85
86 <b>External sevice</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, id, title</i>
87 <BR><BR>
88
89 <b>External service with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, id, title</i>
90 <BR><BR>
91
92 <b>Location</b> format has the following field order: <i>custnum<%$req%>,
93 pkgpart<%$req%>, discountnum,
94 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
95 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
96 </i>
97 <BR><BR>
98
99 <b>Location with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>,
100 pkgpart<%$req%>, discountnum,
101 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
102 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
103 </i>
104 <BR><BR>
105
106 <b>Location with agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
107 pkgpart<%$req%>, discountnum,
108 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
109 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
110 </i>
111 <BR><BR>
112
113 <%$req%> Required fields
114 <BR><BR>
115
116 Field information:
117
118 <ul>
119
120   <li><i>custnum</i>: This specifies an existing customer by custnum.
121
122   <li><i>agent_custid</i>: This specifies an existing customer record by agent_custid.
123
124   <li><i>agent_pkgid</i>: This specifies an existing customer record by agent_custid.
125
126   <li><i>pkgpart</i>: Package definition.  Configuration -&gt; Packages -&gt; Package definitions
127
128   <li><i>discountnum</i>: Optional discount.  Configuration -&gt; Packages -&gt; Discounts
129
130   <li><i>start_date</i>: Indicates a future start date; do not fill in for active packages
131
132   <li><i>setup</i>: Indicates setup fee has been charged and package setup on this date
133
134   <li><i>bill</i>: Next bill date
135
136   <li><i>last_bill</i>: Last bill date
137
138   <li><i>susp</i>: Indicates the package is suspended (on the given date).
139
140   <li><i>adjourn</i>: Indicates a future suspension on this date.
141
142   <li><i>cancel</i>: Indicates the package is cancelled (on the given date).
143
144   <li><i>expire</i>: Indicates a future cancellation on this date.
145
146 <!--
147   <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
148 -->
149
150   <li><i>domsvc</i>: Domain svcnum
151
152   <li><i>id</i>: External service id, integer
153
154   <li><i>title</i>: External service identifier, text
155
156   <li><i>address1</i>: Service address, number and street, text
157
158   <li><i>address2</i>: Service address, suite/unit/building identifier, text
159
160   <li><i>city</i>: Service address, name of city, text
161
162   <li><i>state</i>: Service address, state/province, abbreviated
163
164   <li><i>zip</i>: Service address, postal code
165
166   <li><i>country</i>: Service address, country, 2-letter code
167
168 </ul>
169
170 <BR>
171
172 <& /elements/footer.html &>
173
174 <%once>
175
176 my $req = qq!<font color="#ff0000">*</font>!;
177
178 </%once>
179 <%init>
180
181 die "access denied"
182   unless $FS::CurrentUser::CurrentUser->access_right('Import');
183
184 my $pkgbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
185
186 </%init>