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
|
<% include("/elements/header.html",'Batch Tax Rate Import') %>
Import a CSV file set containing tax rate records.
<BR><BR>
<% include( '/elements/progress-init.html',
'TaxRateUpload',
[ 'format', 'uploaded_files' ],
'process/tax-import.cgi',
{ 'message' => 'Tax rates imported' },
)
%>
<SCRIPT>
function gotLoaded(success, message) {
var uploaded = document.getElementById('uploaded_files');
var a = uploaded.value.split(',');
if (uploaded.value.split(',').length == 4){
process();
}else{
var p = document.getElementById('uploadError');
p.innerHTML='<FONT SIZE="+1" COLOR="#ff0000">Error: '+message+'</FONT><BR><BR>';
p.style='display:visible';
return false;
}
}
</SCRIPT>
<div style="display:none:" id="uploadError"></div>
<FORM NAME="TaxRateUpload" ACTION="<% $fsurl %>misc/file-upload.html" METHOD="post" ENCTYPE="multipart/form-data" onsubmit="return doUpload(this, gotLoaded )">
<% &ntable("#cccccc", 2) %>
<TR>
<TH ALIGN="right">Format</TH>
<TD>
<SELECT NAME="format">
<OPTION VALUE="cch-update" SELECTED>CCH update
<OPTION VALUE="cch">CCH initial import
</SELECT>
</TD>
</TR>
<% include('/elements/file-upload.html', 'field' => [ 'codefile',
'plus4file',
'txmatrix',
'detail',
],
'label' => [ 'code CSV filename',
'plus4 CSV filename',
'txmatrix CSV filename',
'detail CSV filename',
],
'callback' => 'gotLoaded',
'debug' => 0,
)
%>
<TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import CSV files" onClick="document.TaxRateUpload.submit.disabled=true;"></TD></TR>
</TABLE>
</FORM>
<% include('/elements/footer.html') %>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Import');
</%init>
|