[freeside-commits] branch master updated. 5c7c467af6e6880b05df8bd04a6744e72d8d0577

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


The branch, master has been updated
       via  5c7c467af6e6880b05df8bd04a6744e72d8d0577 (commit)
      from  5cc16936f50d1ab2ea4b3f7b209405731b3ac014 (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 5c7c467af6e6880b05df8bd04a6744e72d8d0577
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 8 05:09:37 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