diff options
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/elements/menu.html | 8 | ||||
-rw-r--r-- | httemplate/misc/process/tax-fetch_and_import.cgi | 9 | ||||
-rw-r--r-- | httemplate/misc/tax-fetch_and_import.cgi | 48 |
3 files changed, 64 insertions, 1 deletions
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 627f9c857..409a1525a 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -227,8 +227,14 @@ tie my %tools_importing, 'Tie::IxHash', 'Import payments from CSV file' => [ $fsurl.'misc/cust_pay-import.cgi', '' ], 'Import phone numbers (DIDs)' => [ $fsurl.'misc/phone_avail-import.html', '' ], 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], - 'Import tax rates from CSV files' => [ $fsurl.'misc/tax-import.cgi', '' ], ; +if ( $conf->exists('taxdatadirectdownload') ) { + $tools_importing{'Import tax rates from vendor site'} = + [ $fsurl.'misc/tax-fetch_and_import.cgi', '' ]; +} else { + $tools_importing{'Import tax rates from CSV files'} = + [ $fsurl.'misc/tax-import.cgi', '' ]; +} tie my %tools_exporting, 'Tie::IxHash', 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ], diff --git a/httemplate/misc/process/tax-fetch_and_import.cgi b/httemplate/misc/process/tax-fetch_and_import.cgi new file mode 100644 index 000000000..553c7551a --- /dev/null +++ b/httemplate/misc/process/tax-fetch_and_import.cgi @@ -0,0 +1,9 @@ +<% $server->process %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $server = new FS::UI::Web::JSRPC 'FS::tax_rate::process_download_and_update', $cgi; + +</%init> diff --git a/httemplate/misc/tax-fetch_and_import.cgi b/httemplate/misc/tax-fetch_and_import.cgi new file mode 100644 index 000000000..33a6c9b01 --- /dev/null +++ b/httemplate/misc/tax-fetch_and_import.cgi @@ -0,0 +1,48 @@ +<% include("/elements/header.html",'Tax Rate Download and Import') %> + +Import a tax data update. +<BR><BR> + +<% include( '/elements/progress-init.html', 'TaxRateImport',[ 'format', ], + 'process/tax-fetch_and_import.cgi', { 'message' => 'Tax rates imported' }, + ) +%> + +<FORM NAME="TaxRateImport" ACTION="javascript:void()" METHOD="POST"> +<% &ntable("#cccccc", 2) %> + + <TR> + <TH ALIGN="right">Format</TH> + <TD> + <SELECT NAME="format"> + <OPTION VALUE="cch">CCH import + </SELECT> + </TD> + </TR> + <TR> + <TH ALIGN="right">Update Password</TH> + <TD> + <INPUT TYPE="text" NAME="password"> + </TD> + </TR> + + <TR> + <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"> + <INPUT TYPE = "submit" + VALUE = "Download and Import" + onClick = "document.TaxRateImport.submit.disabled=true; process();" + > + </TD> + </TR> + +</TABLE> + +</FORM> + +<% include('/elements/footer.html') %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Import'); + +</%init> |