summaryrefslogtreecommitdiff
path: root/httemplate/misc/cust_pkg-import.html
blob: 2ed3c48f1ad66b43a2ec9cc7abc005eb2c16b42c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<& /elements/header.html, 'Customer package import' &>

Import a file containing customer packages.
<BR><BR>

<& /elements/form-file_upload.html,
     'name'      => 'PackageImportForm',
     'action'    => 'process/cust_pkg-import.html',
     'num_files' => 1,
     'fields'    => [ 'agentnum', 'pkgbatch', 'format' ],
     'message'   => 'Customer package import successful',
     'url'       => $p."search/cust_pkg.cgi?pkgbatch=$pkgbatch",
     'onsubmit'  => "document.PackageImportForm.submitButton.disabled=true;"
&>

<% &ntable("#cccccc", 2) %>

  <& /elements/tr-select-agent.html,
       #'curr_value' => '', #$agentnum,
       'label'       => "<B>Agent</B>",
       'empty_label' => 'Select agent',
  &>

  <INPUT TYPE="hidden" NAME="pkgbatch" VALUE="<% $pkgbatch %>"%>

  <TR>
    <TH ALIGN="right">Format</TH>
    <TD>
      <SELECT NAME="format">
        <OPTION VALUE="default" SELECTED>Default
        <OPTION VALUE="default-agent_custid">Default with agent_custid
        <OPTION VALUE="default-locationnum">Default with existing location
        <OPTION VALUE="all_dates">All dates
        <OPTION VALUE="all_dates-agent_custid">All dates with agent_custid
        <OPTION VALUE="all_dates-locationnum">All dates with existing location
        <OPTION VALUE="svc_acct">Account service
        <OPTION VALUE="svc_acct-agent_custid">Account service with agent_custid
        <OPTION VALUE="svc_acct-locationnum">Account service with existing location
        <OPTION VALUE="svc_phone">Phone service
        <OPTION VALUE="svc_phone-agent_custid">Phone service with agent_custid
        <OPTION VALUE="svc_phone-locationnum">Phone service with existing location
        <OPTION VALUE="bulk_svc_phone">Bulk phone service
        <OPTION VALUE="bulk_svc_phone-agent_custid">Bulk phone service with agent_custid
        <OPTION VALUE="bulk_svc_phone-locationnum">Bulk phone service with existing location
        <OPTION VALUE="svc_external">External service
        <OPTION VALUE="svc_external-agent_custid">External service with agent_custid
        <OPTION VALUE="svc_external-locationnum">External service with existing location
        <OPTION VALUE="location">Location
        <OPTION VALUE="location-agent_custid">Location with agent_custid
        <OPTION VALUE="location-agent_custid-agent_pkgid">Location with agent_custid and agent_pkgid
      </SELECT>
    </TD>
  </TR>

  <& /elements/file-upload.html,
       'field' => 'file',
       'label' => 'Filename',
  &>

  <TR>
    <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
      <INPUT TYPE    = "submit"
             NAME    = "submitButton"
             ID      = "submitButton"
             VALUE   = "Import file"
      >
    </TD>
  </TR>

</TABLE>

</FORM>

<BR>
Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<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>
<BR><BR>

<b>Location</b> format has the following field order: <i>custnum<%$req%>,
pkgpart<%$req%>, discountnum,
start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
</i>
<BR><BR>

<b>Location 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,
address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
</i>
<BR><BR>

<b>Location with agent_custid and agent_pkgid</b> format has the following field order: <i>agent_custid<%$req%>, agent_pkgid,
pkgpart<%$req%>, discountnum,
start_date, setup, bill, last_bill, susp, adjourn, cancel, expire,
address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country<%$req%>
</i>
<BR><BR>

<%$req%> Required fields
<BR><BR>

Field information:

<ul>

  <li><i>custnum</i>: This specifies an existing customer by custnum.

  <li><i>agent_custid</i>: This specifies an existing customer record by agent_custid.

  <li><i>agent_pkgid</i>: This specifies an existing customer record by agent_custid.

  <li><i>pkgpart</i>: Package definition.  Configuration -&gt; Packages -&gt; Package definitions

  <li><i>discountnum</i>: Optional discount.  Configuration -&gt; Packages -&gt; Discounts

  <li><i>start_date</i>: Indicates a future start date; do not fill in for active packages

  <li><i>setup</i>: Indicates setup fee has been charged and package setup on this date

  <li><i>bill</i>: Next bill date

  <li><i>last_bill</i>: Last bill date

  <li><i>susp</i>: Indicates the package is suspended (on the given date).

  <li><i>adjourn</i>: Indicates a future suspension on this date.

  <li><i>cancel</i>: Indicates the package is cancelled (on the given date).

  <li><i>expire</i>: Indicates a future cancellation on this date.

<!--
  <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
-->

  <li><i>domsvc</i>: Domain svcnum

  <li><i>id</i>: External service id, integer

  <li><i>title</i>: External service identifier, text

  <li><i>locationnum</i>: Existing location (cust_location.locationnum)

  <li><i>address1</i>: Service address, number and street, text

  <li><i>address2</i>: Service address, suite/unit/building identifier, text

  <li><i>city</i>: Service address, name of city, text

  <li><i>state</i>: Service address, state/province, abbreviated

  <li><i>zip</i>: Service address, postal code

  <li><i>country</i>: Service address, country, 2-letter code

</ul>

<BR>

<& /elements/footer.html &>

<%once>

my $req = qq!<font color="#ff0000">*</font>!;

</%once>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Import');

my $pkgbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);

</%init>