[freeside-commits] branch master updated. 580d1080593d3b2583d6e164c1efeff86cde6f89
Ivan
ivan at 420.am
Wed May 8 13:54:08 PDT 2013
The branch, master has been updated
via 580d1080593d3b2583d6e164c1efeff86cde6f89 (commit)
from 04a9b5d2558b495f23508f3efc25fb51edae88e4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 580d1080593d3b2583d6e164c1efeff86cde6f89
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed May 8 13:54:06 2013 -0700
cch tools
diff --git a/bin/cch.finish_failed b/bin/cch.finish_failed
new file mode 100644
index 0000000..cb25330
--- /dev/null
+++ b/bin/cch.finish_failed
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Storable qw( thaw nfreeze );
+use MIME::Base64;
+use FS::UID qw( adminsuidsetup );
+use FS::tax_rate;
+
+adminsuidsetup(shift);
+
+#my @namelist = qw( code detail geocode plus4 txmatrix zip );
+my @namelist = qw( code detail plus4 txmatrix zip );
+
+my $cache_dir = '/usr/local/etc/freeside/cache.'. $FS::UID::datasrc. '/';
+my $dir = $cache_dir.'taxdata/cch';
+
+my @list = ();
+foreach my $name ( @namelist ) {
+ my $difffile = "$dir.new/$name.txt";
+ if (1) { # ($update) {
+ #my $error = $job->update_statustext( "0,Comparing to previous $name" );
+ #die $error if $error;
+ warn "processing $dir.new/$name.txt\n"; # if $DEBUG;
+ #my $olddir = $update ? "$dir.1" : "";
+ my $olddir = "$dir.1";
+ $difffile = FS::tax_rate::_perform_cch_diff( $name, "$dir.new", $olddir );
+ }
+ $difffile =~ s/^$cache_dir//;
+ push @list, "${name}file:$difffile";
+}
+
+# perform the import
+local $FS::tax_rate::keep_cch_files = 1;
+my $param = {
+ 'format' => 'cch-update',
+ 'uploaded_files' => join( ',', @list ),
+};
+my $error =
+ #_perform_batch_import( $job, encode_base64( nfreeze( $param ) ) );
+ FS::tax_rate::_perform_batch_import( '', encode_base64( nfreeze( $param ) ) );
+
+if ( $error ) {
+ warn "ERROR: $error\n";
+} else {
+ warn "success!\n";
+}
+
+#XXX do this manually
+#rename "$dir.new", "$dir"
+# or die "cch tax update processed, but can't rename $dir.new: $!\n";
+
diff --git a/bin/cch.redelete b/bin/cch.redelete
new file mode 100644
index 0000000..2cff389
--- /dev/null
+++ b/bin/cch.redelete
@@ -0,0 +1,52 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Storable qw( thaw nfreeze );
+use MIME::Base64;
+use FS::UID qw( adminsuidsetup );
+use FS::tax_rate;
+
+adminsuidsetup(shift);
+
+#my @namelist = qw( code detail geocode plus4 txmatrix zip );
+my @namelist = qw( plus4 txmatrix zip );
+
+my $cache_dir = '/usr/local/etc/freeside/cache.'. $FS::UID::datasrc. '/';
+my $dir = $cache_dir.'taxdata/cch';
+
+my @list = ();
+foreach my $name ( @namelist ) {
+ my $difffile = "$dir.new/$name.txt";
+ if (1) { # ($update) {
+ #my $error = $job->update_statustext( "0,Comparing to previous $name" );
+ #die $error if $error;
+ warn "processing $dir.new/$name.txt\n"; # if $DEBUG;
+ #my $olddir = $update ? "$dir.1" : "";
+ my $olddir = "$dir.1";
+ $difffile = FS::tax_rate::_perform_cch_diff( $name, "$dir.new", $olddir );
+ }
+ $difffile =~ s/^$cache_dir//;
+ push @list, "${name}file:$difffile";
+}
+
+# perform the import
+local $FS::tax_rate::keep_cch_files = 1;
+my $param = {
+ 'format' => 'cch-update',
+ 'uploaded_files' => join( ',', @list ),
+ 'delete_only' => 1,
+};
+my $error =
+ #_perform_batch_import( $job, encode_base64( nfreeze( $param ) ) );
+ FS::tax_rate::_perform_batch_import( '', encode_base64( nfreeze( $param ) ) );
+
+if ( $error ) {
+ warn "ERROR: $error\n";
+} else {
+ warn "success!\n";
+}
+
+#XXX do this manually
+#rename "$dir.new", "$dir"
+# or die "cch tax update processed, but can't rename $dir.new: $!\n";
+
-----------------------------------------------------------------------
Summary of changes:
bin/cch.finish_failed | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
bin/cch.redelete | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 103 insertions(+), 0 deletions(-)
create mode 100644 bin/cch.finish_failed
create mode 100644 bin/cch.redelete
More information about the freeside-commits
mailing list