invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / misc / part_pkg-import.html
1 <& /elements/header.html, 'Import package definitions' &>
2
3 Import a file containing package definitions.
4 <BR><BR>
5
6 <& /elements/form-file_upload.html,
7      'name'      => 'PackageDefImportForm',
8      'action'    => 'process/part_pkg-import.html',
9      'num_files' => 1,
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;"
14 &>
15
16 <% &ntable("#cccccc", 2) %>
17
18   <& /elements/tr-select-agent.html,
19        #'curr_value' => '', #$agentnum,
20        'label'       => "<B>Agent</B>",
21
22        'disable_empty' => 1,
23        #this doesn't work yet, no type_pkgs records are inserted
24        #'empty_label' => '(global)',
25
26        #disable_empty => ! $acl_edit_global,
27   &>
28
29
30   <INPUT TYPE="hidden" NAME="pkgpartbatch" VALUE="<% $pkgpartbatch %>"%>
31
32   <TR>
33     <TH ALIGN="right">Format</TH>
34     <TD>
35       <SELECT NAME="format">
36         <OPTION VALUE="default" SELECTED>Default
37       </SELECT>
38     </TD>
39   </TR>
40
41   <& /elements/file-upload.html,
42        'field' => 'file',
43        'label' => 'Filename',
44   &>
45
46   <TR>
47     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
48       <INPUT TYPE    = "submit"
49              NAME    = "submitButton"
50              ID      = "submitButton"
51              VALUE   = "Import file"
52       >
53     </TD>
54   </TR>
55
56 </TABLE>
57
58 </FORM>
59
60 <BR>
61 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
62 <BR><BR>
63
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
65 </i>
66 <BR><BR>
67
68 <%$req%> Required fields
69 <BR><BR>
70
71 Field information:
72
73 <ul>
74
75   <li><i>agent_pkgpartid</i>: Current product ID or code
76
77   <li><i>pkg</i>: Package name (customer-visible)
78
79   <li><i>comment</i>: Package comment (customer-hidden)
80
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.
82
83   <li><i>plan</i>: Price plan, i.e. flat, prorate, voip_cdr, etc.
84
85   <li><i>setup_fee</i>: Setup price
86
87   <li><i>recur_fee</i>: Recurring price
88
89   <li><i>setup_cost</i>: Setup cost
90
91   <li><i>recur_cost</i>: Recurring cost
92
93   <li><i>classnum</i>: Package class (integer)
94
95   <li><i>taxclass</i>: Tax class (string)
96
97 </ul>
98
99 <BR>
100
101 <& /elements/footer.html &>
102
103 <%once>
104
105 my $req = qq!<font color="#ff0000">*</font>!;
106
107 </%once>
108 <%init>
109
110 die "access denied"
111   unless $FS::CurrentUser::CurrentUser->access_right('Import');
112
113 my $pkgpartbatch =
114   time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
115
116 </%init>