[freeside-commits] freeside/FS/FS tax_rate.pm,1.29.2.4,1.29.2.5

Jeff Finucane,420,, jeff at wavetail.420.am
Mon Feb 15 18:19:40 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv32273/FS/FS

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	tax_rate.pm 
Log Message:
refactor cch tax import to remove tons of false laziness and improve flexibility; allow reload from local files

Index: tax_rate.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/tax_rate.pm,v
retrieving revision 1.29.2.4
retrieving revision 1.29.2.5
diff -u -d -r1.29.2.4 -r1.29.2.5
--- tax_rate.pm	13 Jan 2010 03:14:10 -0000	1.29.2.4
+++ tax_rate.pm	16 Feb 2010 02:19:38 -0000	1.29.2.5
@@ -3,11 +3,11 @@
 use strict;
 use vars qw( @ISA $DEBUG $me
              %tax_unittypes %tax_maxtypes %tax_basetypes %tax_authorities
-             %tax_passtypes %GetInfoType );
+             %tax_passtypes %GetInfoType $keep_cch_files );
 use Date::Parse;
 use DateTime;
 use DateTime::Format::Strptime;
-use Storable qw( thaw );
+use Storable qw( thaw nfreeze );
 use IO::File;
[...1222 lines suppressed...]
-      close $fh;
-      #unlink $file or warn "Can't delete $file: $!";
-    }
+    # perform the import
+    local $keep_cch_files = 1;
+    $param->{uploaded_files} = join( ',', @list );
+    $param->{format} .= '-update' if $update;
+    $error ||=
+      _perform_batch_import( $job, encode_base64( nfreeze( $param ) ) );
     
-    if ($error) {
-      $dbh->rollback or die $dbh->errstr if $oldAutoCommit;
-      die $error;
-    }else{
-      $dbh->commit or die $dbh->errstr if $oldAutoCommit;
-    }
-
     rename "$dir.new", "$dir"
       or die "cch tax update processed, but can't rename $dir.new: $!\n";
 



More information about the freeside-commits mailing list