1 <& /elements/header.html, 'Import package definitions' &>
3 Import a file containing package definitions.
6 <& /elements/form-file_upload.html,
7 'name' => 'PackageDefImportForm',
8 'action' => 'process/part_pkg-import.html',
10 'fields' => [ 'agentnum', 'pkgpartbatch', 'format' ],
11 'message' => 'Package definition import successful',
12 'url' => $p."browse/part_pkg.cgi?pkgpartbatch=$pkgpartbatch",
13 'onsubmit' => "document.PackageDefImportForm.submitButton.disabled=true;"
16 <% &ntable("#cccccc", 2) %>
18 <& /elements/tr-select-agent.html,
19 #'curr_value' => '', #$agentnum,
20 'label' => "<B>Agent</B>",
23 #this doesn't work yet, no type_pkgs records are inserted
24 #'empty_label' => '(global)',
26 #disable_empty => ! $acl_edit_global,
30 <INPUT TYPE="hidden" NAME="pkgpartbatch" VALUE="<% $pkgpartbatch %>"%>
33 <TH ALIGN="right">Format</TH>
35 <SELECT NAME="format">
36 <OPTION VALUE="default" SELECTED>Default
41 <& /elements/file-upload.html,
43 'label' => 'Filename',
47 <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
48 <INPUT TYPE = "submit"
61 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
64 <b>Default</b> format has the following field order: <i>agent_pkgpartid, pkg<%$req%>, comment<%$req%>, freq<%$req%>, plan<%$req%>, setup_fee<%$req%>, recur_fee<%$req%>, setup_cost, recur_cost, classnum, taxclass
68 <%$req%> Required fields
75 <li><i>agent_pkgpartid</i>: Current product ID or code
77 <li><i>pkg</i>: Package name (customer-visible)
79 <li><i>comment</i>: Package comment (customer-hidden)
81 <li><i>freq</i>: Recurring fee frequency - 0 for one-time charges, a number of months (i.e. 1 for months, 12 for yearly), or a number followed by h, d or w for hours, days or weeks.
83 <li><i>plan</i>: Price plan, i.e. flat, prorate, voip_cdr, etc.
85 <li><i>setup_fee</i>: Setup price
87 <li><i>recur_fee</i>: Recurring price
89 <li><i>setup_cost</i>: Setup cost
91 <li><i>recur_cost</i>: Recurring cost
93 <li><i>classnum</i>: Package class (integer)
95 <li><i>taxclass</i>: Tax class (string)
101 <& /elements/footer.html &>
105 my $req = qq!<font color="#ff0000">*</font>!;
111 unless $FS::CurrentUser::CurrentUser->access_right('Import');
114 time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);