Option to ignore old CDRs, RT#81480
[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="default-locationnum">Default with existing location
33         <OPTION VALUE="all_dates">All dates
34         <OPTION VALUE="all_dates-agent_custid">All dates with agent_custid
35         <OPTION VALUE="all_dates-locationnum">All dates with existing location
36         <OPTION VALUE="svc_acct">Account service
37         <OPTION VALUE="svc_acct-agent_custid">Account service with agent_custid
38         <OPTION VALUE="svc_acct-locationnum">Account service with existing location
39         <OPTION VALUE="svc_broadband">Broadband service
40         <OPTION VALUE="svc_phone">Phone service
41         <OPTION VALUE="svc_phone-agent_custid">Phone service with agent_custid
42         <OPTION VALUE="svc_phone-locationnum">Phone service with existing location
43         <OPTION VALUE="bulk_svc_phone">Bulk phone service
44         <OPTION VALUE="bulk_svc_phone-agent_custid">Bulk phone service with agent_custid
45         <OPTION VALUE="bulk_svc_phone-locationnum">Bulk phone service with existing location
46         <OPTION VALUE="svc_external">External service
47         <OPTION VALUE="svc_external-agent_custid">External service with agent_custid
48         <OPTION VALUE="svc_external-locationnum">External service with existing location
49         <OPTION VALUE="location">Location
50         <OPTION VALUE="location-agent_custid">Location with agent_custid
51         <OPTION VALUE="location-agent_custid-agent_pkgid">Location with agent_custid and agent_pkgid
52         <OPTION VALUE="location-quan_price-svc_phone">Location, quantity and price customizations with phone service
53         <OPTION VALUE="location-quan_price-svc_phone-agent_custid">Location, quantity and price customizations with phone service and agent_custid
54         <OPTION VALUE="location-quan_price-svc_phone-agent_custid-agent_pkgid">Location, quantity and price customizations with phone service and agent_custid and agent_pkgid
55       </SELECT>
56     </TD>
57   </TR>
58
59   <& /elements/file-upload.html,
60        'field' => 'file',
61        'label' => 'Filename',
62   &>
63
64   <TR>
65     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
66       <INPUT TYPE    = "submit"
67              NAME    = "submitButton"
68              ID      = "submitButton"
69              VALUE   = "Import file"
70       >
71     </TD>
72   </TR>
73
74 </TABLE>
75
76 </FORM>
77
78 <BR>
79 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
80 <BR><BR>
81
82 <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>
83 <BR><BR>
84
85 <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>
86 <BR><BR>
87
88 <b>Default with existing location</b> format has the following field order: <i>custnum<%$req%>, locationnum, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire</i>
89 <BR><BR>
90
91 <b>All dates</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, order_date, start_date, setup, bill, last_bill, susp, adjourn, resume, cancel, expire, contract_end, dundate</i>
92 <BR><BR>
93
94 <b>All dates with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, order_date, start_date, setup, bill, last_bill, susp, adjourn, resume, cancel, expire, contract_end, dundate</i>
95 <BR><BR>
96
97 <b>All dates with existing location</b> format has the following field order: <i>custnum<%$req%>, locationnum, pkgpart<%$req%>, discountnum, order_date, start_date, setup, bill, last_bill, susp, adjourn, resume, cancel, expire, contract_end, dundate</i>
98 <BR><BR>
99
100 <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>
101 <BR><BR>
102
103 <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>
104 <BR><BR>
105
106 <b>Account service with existing location</b> format has the following field order: <i>custnum<%$req%>, locationnum, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, username, _password, domsvc</i>
107 <BR><BR>
108
109 <b>Broadband service</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, ip_addr<%$req%>, description, routernum, blocknum, sectornum, speed_up, speed_down</i>
110 <BR><BR>
111
112 <b>Phone service</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>
113 <BR><BR>
114
115 <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>
116 <BR><BR>
117
118 <b>Phone service with existing location</b> format has the following field order: <i>custnum<%$req%>, locationnum, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, phonenum, sip_password, pin</i>
119 <BR><BR>
120
121 <b>Bulk phone service</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, start_phonenum-end_phonenum, sip_password, pin</i>
122 <BR><BR>
123
124 <b>Bulk 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, start_phonenum-end_phonenum, sip_password, pin</i>
125 <BR><BR>
126
127 <b>Bulk phone service with existing location</b> format has the following field order: <i>custnum<%$req%>, locationnum, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, start_phonenum-end_phonenum, sip_password, pin</i>
128 <BR><BR>
129
130 <b>External service</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>
131 <BR><BR>
132
133 <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>
134 <BR><BR>
135
136 <b>External service with existing location</b> format has the following field order: <i>custnum<%$req%>, locationnum, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, id, title</i>
137 <BR><BR>
138
139 <b>Location</b> format has the following field order: <i>custnum<%$req%>,
140 pkgpart<%$req%>, discountnum,
141 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
142 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
143 </i>
144 <BR><BR>
145
146 <b>Location with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>,
147 pkgpart<%$req%>, discountnum,
148 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
149 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
150 </i>
151 <BR><BR>
152
153 <b>Location with agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
154 pkgpart<%$req%>, discountnum,
155 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
156 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
157 </i>
158 <BR><BR>
159
160 <b>Location, quantity and price customizations with phone service</b> format has the following field order: <i>custnum<%$req%>,
161 pkgpart<%$req%>, discountnum,
162 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
163 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
164 quantity, setup_fee, recur_fee, invoice_details,
165 countrycode, phonenum, sip_password, pin
166 </i>
167 <BR><BR>
168
169 <b>Location, quantity and price customizations with phone service and agent_custid</b> format has the following field order: <i>agent_custid<%$req%>,
170 pkgpart<%$req%>, discountnum,
171 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
172 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
173 quantity, setup_fee, recur_fee, invoice_details,
174 countrycode, phonenum, sip_password, pin
175 </i>
176 <BR><BR>
177
178 <b>Location, quantity and price customizations with phone service and agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
179 pkgpart<%$req%>, discountnum,
180 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
181 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>,
182 quantity, setup_fee, recur_fee, invoice_details,
183 countrycode, phonenum, sip_password, pin
184 </i>
185 <BR><BR>
186
187 <%$req%> Required fields (for address fields, required if an address is specified)
188 <BR><BR>
189
190 Field information:
191
192 <ul>
193
194   <li><i>custnum</i>: This specifies an existing customer by custnum.
195
196   <li><i>agent_custid</i>: This specifies an existing customer record by agent_custid.
197
198   <li><i>agent_pkgid</i>: This specifies an existing customer record by agent_custid.
199
200   <li><i>pkgpart</i>: Package definition.  Configuration -&gt; Packages -&gt; Package definitions
201
202   <li><i>discountnum</i>: Optional discount.  Configuration -&gt; Packages -&gt; Discounts
203
204   <li><i>start_date</i>: Indicates a future start date; do not fill in for active packages
205
206   <li><i>setup</i>: Indicates setup fee has been charged and package setup on this date
207
208   <li><i>bill</i>: Next bill date
209
210   <li><i>last_bill</i>: Last bill date
211
212   <li><i>susp</i>: Indicates the package is suspended (on the given date).
213
214   <li><i>adjourn</i>: Indicates a future suspension on this date.
215
216   <li><i>cancel</i>: Indicates the package is cancelled (on the given date).
217
218   <li><i>expire</i>: Indicates a future cancellation on this date.
219
220   <li><i>quantity</i>
221
222   <li><i>setup_fee</i>: Including this implements per-customer custom pricing for this package, overriding package definition pricing
223
224   <li><i>recur_fee</i>: Including this implements per-customer custom pricing for this package, overriding package definition pricing
225
226   <li><i>invoice_details</i>: Package invoice details (optionally, can include multiple lines of details separated by a vertical bar)
227
228 <!--
229   <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
230 -->
231
232   <li><i>domsvc</i>: Domain svcnum
233
234   <li><i>id</i>: External service id, integer
235
236   <li><i>title</i>: External service identifier, text
237
238   <li><i>locationnum</i>: Existing location (cust_location.locationnum)
239
240   <li><i>address1</i>: Service address, number and street, text
241
242   <li><i>address2</i>: Service address, suite/unit/building identifier, text
243
244   <li><i>city</i>: Service address, name of city, text
245
246   <li><i>state</i>: Service address, state/province, abbreviated
247
248   <li><i>zip</i>: Service address, postal code
249
250   <li><i>country</i>: Service address, country, 2-letter code
251
252 </ul>
253
254 <BR>
255
256 <& /elements/footer.html &>
257
258 <%once>
259
260 my $req = qq!<font color="#ff0000">*</font>!;
261
262 </%once>
263 <%init>
264
265 die "access denied"
266   unless $FS::CurrentUser::CurrentUser->access_right('Import');
267
268 my $pkgbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
269
270 </%init>