[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 79b2902567088a6a6d1e087cb98d5852896874ea

Ivan ivan at 420.am
Wed May 8 05:09:40 PDT 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  79b2902567088a6a6d1e087cb98d5852896874ea (commit)
      from  4f354d58c5e109c9b1ee3c05088c801eea14f41d (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 79b2902567088a6a6d1e087cb98d5852896874ea
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 8 05:09:39 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 79bb248..7fe1023 100644
--- a/FS/FS/tax_class.pm
+++ b/FS/FS/tax_class.pm
@@ -84,9 +84,6 @@ sub delete {
   my $self = shift;
 
   return "Can't delete a tax class which has package tax rates!"
-    if qsearch( 'part_pkg_taxrate', { 'taxclassnum' => $self->taxclassnum } );
-
-  return "Can't delete a tax class which has package tax rates!"
     if qsearch( 'part_pkg_taxrate', { 'taxclassnumtaxed' => $self->taxclassnum } );
 
   return "Can't delete a tax class which has package tax overrides!"
@@ -113,6 +110,16 @@ sub delete {
     }
   }
 
+  foreach my $part_pkg_taxrate (
+    qsearch( 'part_pkg_taxrate', { taxclassnum=>$self->taxclassnum } )
+  ) {
+    my $error = $part_pkg_taxrate->delete;
+    if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
+      return $error;
+    }
+  }
+
   my $error = $self->SUPER::delete(@_);
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;

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

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




More information about the freeside-commits mailing list