1 <% include("/elements/header.html",'Batch Package Import') %>
3 Import a file containing package records.
6 <& /elements/form-file_upload.html,
7 'name' => 'PackageImportForm',
8 'action' => 'process/cust_pkg-import.html',
10 'fields' => [ 'agentnum', 'pkgbatch', 'format' ],
11 'message' => 'Package import successful',
12 'url' => $p."search/cust_pkg.cgi?pkgbatch=$pkgbatch",
13 'onsubmit' => "document.PackageImportForm.submitButton.disabled=true;"
16 <% &ntable("#cccccc", 2) %>
18 <% include( '/elements/tr-select-agent.html',
19 #'curr_value' => '', #$agentnum,
20 'label' => "<B>Agent</B>",
21 'empty_label' => 'Select agent',
25 <INPUT TYPE="hidden" NAME="pkgbatch" VALUE="<% $pkgbatch %>"%>
28 <TH ALIGN="right">Format</TH>
30 <SELECT NAME="format">
31 <OPTION VALUE="default" SELECTED>Default
32 <OPTION VALUE="default-agent_custid">Default with agent_custid
33 <OPTION VALUE="svc_acct">Account service
34 <OPTION VALUE="svc_acct-agent_custid">Account service with agent_custid
35 <OPTION VALUE="svc_phone">Phone service
36 <OPTION VALUE="svc_phone-agent_custid">Phone service with agent_custid
37 <OPTION VALUE="svc_external">External service
38 <OPTION VALUE="svc_external-agent_custid">External service with agent_custid
39 <OPTION VALUE="location">Location
40 <OPTION VALUE="location-agent_custid">Location with agent_custid
41 <OPTION VALUE="location-agent_custid-agent_pkgid">Location with agent_custid and agent_pkgid
46 <% include( '/elements/file-upload.html',
48 'label' => 'Filename',
53 <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
54 <INPUT TYPE = "submit"
67 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
70 <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>
73 <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>
76 <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>
79 <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>
82 <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>
85 <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>
88 <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>
91 <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>
94 <b>Location</b> format has the following field order: <i>custnum<%$req%>,
95 pkgpart<%$req%>, discountnum,
96 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
97 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
101 <b>Location with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>,
102 pkgpart<%$req%>, discountnum,
103 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
104 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
108 <b>Location with agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
109 pkgpart<%$req%>, discountnum,
110 start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
111 address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
115 <%$req%> Required fields
122 <li><i>custnum</i>: This specifies an existing customer by custnum.
124 <li><i>agent_custid</i>: This specifies an existing customer record by agent_custid.
126 <li><i>agent_pkgid</i>: This specifies an existing customer record by agent_custid.
128 <li><i>pkgpart</i>: Package definition. Configuration -> Packages -> Package definitions
130 <li><i>discountnum</i>: Optional discount. Configuration -> Packages -> Discounts
132 <li><i>start_date</i>: Indicates a future start date; do not fill in for active packages
134 <li><i>setup</i>: Indicates setup fee has been charged and package setup on this date
136 <li><i>bill</i>: Next bill date
138 <li><i>last_bill</i>: Last bill date
140 <li><i>susp</i>: Indicates the package is suspended (on the given date).
142 <li><i>adjourn</i>: Indicates a future suspension on this date.
144 <li><i>cancel</i>: Indicates the package is cancelled (on the given date).
146 <li><i>expire</i>: Indicates a future cancellation on this date.
149 <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
152 <li><i>domsvc</i>: Domain svcnum
154 <li><i>id</i>: External service id, integer
156 <li><i>title</i>: External service identifier, text
158 <li><i>address1</i>: Service address, number and street, text
160 <li><i>address2</i>: Service address, suite/unit/building identifier, text
162 <li><i>city</i>: Service address, name of city, text
164 <li><i>state</i>: Service address, state/province, abbreviated
166 <li><i>zip</i>: Service address, postal code
168 <li><i>country</i>: Service address, country, 2-letter code
174 <% include('/elements/footer.html') %>
178 my $req = qq!<font color="#ff0000">*</font>!;
184 unless $FS::CurrentUser::CurrentUser->access_right('Import');
186 my $pkgbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);