RT# 73964 - Added biling event action to send an email to phone nunber, and updated...
[freeside.git] / httemplate / misc / rate_edit_excel.html
1 <% include('/elements/header.html', 'Edit rates with Excel' ) %>
2
3 % if ( $have_conn ) { 
4   <FONT COLOR="#FF0000">WARNING: This functionality does not yet preserve connection charges.</FONT><BR><BR>
5 % }
6
7 <& /elements/form-file_upload.html,
8      'name'      => 'RateImportForm',
9      'action'    => 'process/rate_edit_excel.html',
10      'num_files' => 1,
11      'fields'    => [ 'format' ],
12      'message'   => 'Rate edit successful',
13      'url'       => $p."browse/rate_region.html",
14      'onsubmit'  => "document.RateImportForm.submitButton.disabled=true;"
15 &>
16
17 <% &ntable("#cccccc", 2) %>
18
19   <TR>
20     <TH ALIGN="left">1. Download current rates:</TH>
21     <TD>
22       <A HREF="<%$p%>/browse/rate_region.html?show_rates=1;_type=regions.xls">Download rate spreadsheet</A>
23     </TD>
24   </TR>
25
26   <TR>
27     <TH ALIGN="left" COLSPAN=2>2. Edit rates with Excel (or other .XLS-compatible application)</TH>
28   </TR>
29
30   <TR>
31     <TD ALIGN="left" COLSPAN=2>
32       &nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;To add rates, add four columns like an existing rate, with headers starting with "NEW: Rate Name" or "Rate Name".<BR>
33      &nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<FONT SIZE="-2"><I>For rate addition, protection can be turned off in Excel via the Tools-&gt;Protection-&gt;Unprotect Sheet menu command.  Note that only new rates can be added; modified grayed out cells will not be imported.</I></FONT>
34     </TD>
35   </TR>
36
37   <% include( '/elements/file-upload.html',
38                 'field' => 'file',
39                 'label' => '3. Upload edited rate file: ',
40                 'label_align' => 'left',
41             )
42   %>
43
44   <INPUT TYPE="hidden" NAME="format" VALUE="default">
45
46   <TR>
47     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
48       <INPUT TYPE    = "submit"
49              ID      = "submitButton"
50              NAME    = "submitButton"
51              VALUE   = "Upload"
52       >
53     </TD>
54   </TR>
55
56
57 </TABLE>
58
59 <% include('/elements/footer.html') %>
60 <%init>
61
62 die "access denied"
63   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
64
65 my $sth = dbh->prepare('SELECT COUNT(*) FROM rate_detail WHERE conn_charge > 0 OR conn_sec > 0 LIMIT 1')
66   or die dbh->errstr;
67 $sth->execute or die $sth->errstr;
68 my $have_conn = $sth->fetchrow_arrayref->[0];
69
70 </%init>