1 <& /elements/header.html, 'Customer package import' &>
3 Import a file containing customer packages.
6 <& /elements/form-file_upload.html,
7 'name' => 'PackageImportForm',
8 'action' => 'process/cust_pkg-import.html',
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;"
16 <% &ntable("#cccccc", 2) %>
18 <& /elements/tr-select-agent.html,
19 #'curr_value' => '', #$agentnum,
20 'label' => "<B>Agent</B>",
21 'empty_label' => 'Select agent',
24 <INPUT TYPE="hidden" NAME="pkgbatch" VALUE="<% $pkgbatch %>"%>
27 <TH ALIGN="right">Format</TH>
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
55 <& /elements/file-upload.html,
57 'label' => 'Filename',
61 <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
62 <INPUT TYPE = "submit"
75 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
78 <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>
81 <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>
84 <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>
87 <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>
90 <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>
93 <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>
96 <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>
99 <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>
102 <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>
105 <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>
108 <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>
111 <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>
114 <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>
117 <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>
120 <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>
123 <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>
126 <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>
129 <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>
132 <b>Location</b> format has the following field order: <i>custnum<%$req%>,
133 pkgpart<%$req%>, discountnum,
134 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
135 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
139 <b>Location with agent_custid</b> format has the following field order: <i>agent_custid<%$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%>
146 <b>Location with agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
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%>
153 <%$req%> Required fields
160 <li><i>custnum</i>: This specifies an existing customer by custnum.
162 <li><i>agent_custid</i>: This specifies an existing customer record by agent_custid.
164 <li><i>agent_pkgid</i>: This specifies an existing customer record by agent_custid.
166 <li><i>pkgpart</i>: Package definition. Configuration -> Packages -> Package definitions
168 <li><i>discountnum</i>: Optional discount. Configuration -> Packages -> Discounts
170 <li><i>start_date</i>: Indicates a future start date; do not fill in for active packages
172 <li><i>setup</i>: Indicates setup fee has been charged and package setup on this date
174 <li><i>bill</i>: Next bill date
176 <li><i>last_bill</i>: Last bill date
178 <li><i>susp</i>: Indicates the package is suspended (on the given date).
180 <li><i>adjourn</i>: Indicates a future suspension on this date.
182 <li><i>cancel</i>: Indicates the package is cancelled (on the given date).
184 <li><i>expire</i>: Indicates a future cancellation on this date.
187 <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
190 <li><i>domsvc</i>: Domain svcnum
192 <li><i>id</i>: External service id, integer
194 <li><i>title</i>: External service identifier, text
196 <li><i>locationnum</i>: Existing location (cust_location.locationnum)
198 <li><i>address1</i>: Service address, number and street, text
200 <li><i>address2</i>: Service address, suite/unit/building identifier, text
202 <li><i>city</i>: Service address, name of city, text
204 <li><i>state</i>: Service address, state/province, abbreviated
206 <li><i>zip</i>: Service address, postal code
208 <li><i>country</i>: Service address, country, 2-letter code
214 <& /elements/footer.html &>
218 my $req = qq!<font color="#ff0000">*</font>!;
224 unless $FS::CurrentUser::CurrentUser->access_right('Import');
226 my $pkgbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);