[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 972a6864dc38864bbe7705ef860560e257d4d7a7

Ivan ivan at 420.am
Wed May 8 02:12:10 PDT 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  972a6864dc38864bbe7705ef860560e257d4d7a7 (commit)
       via  85e62c996e1733c59ccad85f97cbf2635429fafc (commit)
      from  90be53617907d8cf156c5c9348dea22f5bad268c (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 972a6864dc38864bbe7705ef860560e257d4d7a7
Merge: 85e62c9 90be536
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 8 02:12:03 2013 -0700

    Merge branch 'FREESIDE_2_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_2_3_BRANCH


commit 85e62c996e1733c59ccad85f97cbf2635429fafc
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 8 02:11:46 2013 -0700

    fix CCH update adding a TAXCAT, RT#21687

diff --git a/FS/FS/tax_class.pm b/FS/FS/tax_class.pm
index bfec2c0..eeb8993 100644
--- a/FS/FS/tax_class.pm
+++ b/FS/FS/tax_class.pm
@@ -259,13 +259,15 @@ sub batch_import {
                                  'description' => $type->[1].':'.$cat->[1],
                              } );
           my $error = $tax_class->insert;
-          return $error if $error;
+          return "can't insert tax_class for old TAXTYPE $type and new TAXCAT $cat: $error" if $error;
           $imported++;
         }
       }
 
+      my %cats = map { $_=>1 } ( @old_cats, @{$data->{'taxcat'}} );
+
       foreach my $type (@{$data->{'taxtype'}}) {
-        foreach my $cat (@old_cats, @{$data->{'taxcat'}}) {
+        foreach my $cat (keys %cats) {
 
           if ( $job ) {  # progress bar
             if ( time - $min_sec > $last ) {
@@ -283,7 +285,7 @@ sub batch_import {
                                  'description' => $type->[1].':'.$cat->[1],
                              } );
           my $error = $tax_class->insert;
-          return $error if $error;
+          return "can't insert tax_class for new TAXTYPE $type and TAXCAT $cat: $error" if $error;
           $imported++;
         }
       }
@@ -363,7 +365,7 @@ sub batch_import {
   my $error = &{$endhook}();
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;
-    return "can't insert tax_class for $line: $error";
+    return "can't run end hook: $error";
   }
 
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/tax_class.pm |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list