diff options
author | jeff <jeff> | 2009-12-21 14:37:23 +0000 |
---|---|---|
committer | jeff <jeff> | 2009-12-21 14:37:23 +0000 |
commit | d3916ae37c77a9bd8a9f1a33e0e9679b143d9fdf (patch) | |
tree | bc0e3ed049a2d44ca7a9f31e01a2b12a0d877b40 /FS | |
parent | d3a1ad461c8cad4cfa4000490ddd441bebcc7309 (diff) |
move cch conf into database and add a couple small tools for processing updates more manually
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 4 | ||||
-rw-r--r-- | FS/FS/tax_rate.pm | 13 |
2 files changed, 10 insertions, 7 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index f0e5f432e..ac9bbf018 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1659,8 +1659,8 @@ worry that config_items is freeside-specific and icky. { 'key' => 'taxdatadirectdownload', 'section' => 'billing', #well - 'description' => 'Enable downloading tax data directly from the vendor site', - 'type' => 'checkbox', + 'description' => 'Enable downloading tax data directly from the vendor site. at least three lines: URL, username, and password.j', + 'type' => 'textarea', }, { diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm index 58be8cba6..93550b178 100644 --- a/FS/FS/tax_rate.pm +++ b/FS/FS/tax_rate.pm @@ -1398,11 +1398,14 @@ sub process_download_and_update { eval "use XBase;"; die $@ if $@; - my $conffile = '%%%FREESIDE_CONF%%%/cchconf'; - my $conffh = new IO::File "<$conffile" or die "can't open $conffile: $!\n"; - my ( $urls, $secret, $states ) = - map { /^(.*)$/ or die "bad config line in $conffile: $_\n"; $1 } - <$conffh>; + my $conf = new FS::Conf; + die "direct download of tax data not enabled\n" + unless $conf->exists('taxdatadirectdownload'); + my ( $urls, $username, $secret, $states ) = + $conf->config('taxdatadirectdownload'); + die "No tax download URL provided. ". + "Did you set the taxdatadirectdownload configuration value?\n" + unless $urls; $dir .= '/cch'; |