Merge branch 'master' of ssh://git.freeside.biz/home/git/freeside
[freeside.git] / httemplate / misc / tax_edit_excel.html
1 <% include('/elements/header.html', 'Edit  tax rates with Excel' ) %>
2
3 % # 'name' => 'RateImportForm',
4
5 <& /elements/form-file_upload.html,
6      'name'      => 'TaxEditForm',
7      'action'    => 'process/tax_edit_excel.html',
8      'num_files' => 1,
9      'fields'    => [ 'format' ],
10      'message'   => 'Tax Rate edit successful',
11      'url'       => $p."browse/cust_main_county.cgi",
12      'onsubmit'  => "document.TaxEditForm.submitButton.disabled=true;"
13 &>
14
15 <% &ntable("#cccccc", 2) %>
16
17   <TR>
18     <TD ALIGN="left" COLSPAN=2>File format should be as follows:<BR>
19       <TABLE>
20         <TR><TD><B>Country</B> as standard two letter code</TD></TR>
21         <TR><TD><B>State</B> as standard two letter code</TD></TR>
22         <TR><TD><B>County name</B></TD></TR>
23         <TR><TD><B>City name</B></TD></TR>
24         <TR><TD><B>Tax name</B></TD></TR>
25         <TR><TD><B>Tax rate</B></TD></TR>
26       </TABLE><BR>
27       * first row should be blank or contain headers<BR>
28       * Tax rate should be formated as a number not percentage.
29       <P>
30     </TD>
31   </TR>
32   <TR>
33     <TH ALIGN="left" COLSPAN=2>Upload tax rates with Excel (or other .XLS-compatible application)</TH>
34   </TR>
35
36
37   <% include( '/elements/file-upload.html',
38                 'field' => 'file',
39                 'label' => '',
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>