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