[freeside-commits] freeside/bin import-county-tax-rates,NONE,1.1
Ivan,,,
ivan at wavetail.420.am
Thu Feb 8 20:54:12 PST 2007
Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail:/tmp/cvs-serv760
Added Files:
import-county-tax-rates
Log Message:
quick hack to import rates for landel
--- NEW FILE: import-county-tax-rates ---
#!/usr/bin/perl
#
# import-county-tax-rates username state country <filename.csv
# example: import-county-tax-rates ivan CA US <taxes.csv
#
# rates.csv: taxrate,county
use FS::UID qw(adminsuidsetup);
use FS::cust_main_county;
my $user = shift;
adminsuidsetup $user;
my($state, $country) = (shift, shift);
while (<>) {
my($tax, $county) = split(','); #half-ass CSV parser
my $cust_main_county = new FS::cust_main_county {
'county' => $county,
'state' => $state,
'country' => $country,
'tax' => $tax,
};
my $error = $cust_main_county->insert;
#my $error = $cust_main_county->check;
die $error if $error;
}
More information about the freeside-commits
mailing list