stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / misc / tax-import.cgi
1 <& /elements/header.html,'Batch Tax Rate Import' &>
2
3 Import a CSV file set containing tax rate records.
4 <BR><BR>
5
6 <& /elements/form-file_upload.html,
7      'name'      => 'TaxRateUpload',
8      'action'    => 'process/tax-import.cgi', 
9      'fields'    => [ 'format', 'reload' ],
10      'num_files' => $vendor_info{$data_vendor}->{num_files},
11      'message'   => 'Tax rates imported',
12      'onsubmit'  => "document.TaxRateUpload.submitButton.disabled=true;",
13 &>
14
15 <& /elements/table-grid.html &>
16
17   <TR>
18     <TH ALIGN="right">Format</TH>
19     <TD>
20       <SELECT NAME="format">
21 % my @formats = @{ $vendor_info{$data_vendor}->{formats} };
22 % while (@formats) {
23         <OPTION VALUE="<% shift @formats %>"><% shift @formats %></OPTION>
24 % }
25       </SELECT>
26     </TD>
27   </TR>
28
29   <TR>
30     <TH ALIGN="right">Replace existing data from this vendor</TH>
31     <TD>
32       <INPUT NAME="reload" TYPE="checkbox" VALUE="1" CHECKED>
33     </TD>
34   </TR>
35
36   <& /elements/file-upload.html,
37                 'field' => $vendor_info{$data_vendor}->{field},
38                 'label' => $vendor_info{$data_vendor}->{label},
39                 'debug'    => 0,
40   &>
41
42   <TR>
43     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
44       <INPUT TYPE  = "submit"
45              NAME  = "submitButton"
46              ID    = "submitButton"
47              VALUE = "Import CSV files"
48       >
49     </TD>
50   </TR>
51
52 </TABLE>
53
54 </FORM>
55
56 <% include('/elements/footer.html') %>
57 <%init>
58
59 die "access denied"
60   unless $FS::CurrentUser::CurrentUser->access_right('Import');
61
62 my $conf = FS::Conf->new;
63 my $data_vendor = $conf->config('tax_data_vendor');
64
65 my %vendor_info = (
66   cch => {
67     'num_files' => 6,
68     'formats' => [ 'cch'        => 'CCH import (CSV)',
69                    'cch-fixed'  => 'CCH import (fixed length)' ],
70     'field'   => [ 'geocodefile',
71                    'codefile',
72                    'plus4file',
73                    'zipfile',
74                    'txmatrixfile',
75                    'detailfile',
76                  ],
77     'label'   => [ 'geocode filename',
78                    'code filename',
79                    'plus4 filename',
80                    'zip filename',
81                    'txmatrix filename',
82                    'detail filename',
83                  ],
84   },
85   billsoft => {
86     'num_files' => 1,
87     'formats' => [ 'billsoft-pcode' => 'Billsoft PCodes',
88                    'billsoft-taxclass' => 'Tax classes',
89                    'billsoft-taxproduct' => 'Tax products' ],
90     'field'   => [ 'file' ],
91     'label'   => [ 'Filename' ],
92   },
93 );
94     
95 </%init>