diff options
author | jeff <jeff> | 2008-04-15 20:47:59 +0000 |
---|---|---|
committer | jeff <jeff> | 2008-04-15 20:47:59 +0000 |
commit | 6a24254d490f3d023728044daba0765f20f6971e (patch) | |
tree | c486026468a4e33092ae54925ff19b8e5dc7411b /FS/FS/part_pkg_taxproduct.pm | |
parent | bdbfd5c5a3bb7bc193b82dc39b98ae9ffe99da44 (diff) |
(finally) wrap up new tax rate engine (for now)
Diffstat (limited to 'FS/FS/part_pkg_taxproduct.pm')
-rw-r--r-- | FS/FS/part_pkg_taxproduct.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/FS/FS/part_pkg_taxproduct.pm b/FS/FS/part_pkg_taxproduct.pm index 000d0d4..c66fb8c 100644 --- a/FS/FS/part_pkg_taxproduct.pm +++ b/FS/FS/part_pkg_taxproduct.pm @@ -2,7 +2,7 @@ package FS::part_pkg_taxproduct; use strict; use vars qw( @ISA ); -use FS::Record; +use FS::Record qw( qsearch ); @ISA = qw(FS::Record); @@ -79,6 +79,18 @@ Delete this record from the database. =cut +sub delete { + my $self = shift; + + return "Can't delete a tax product which has attached package tax rates!" + if qsearch( 'part_pkg_taxrate', { 'taxproductnum' => $self->taxproductnum } ); + + return "Can't delete a tax product which has attached packages!" + if qsearch( 'part_pkg', { 'taxproductnum' => $self->taxproductnum } ); + + $self->SUPER::delete(@_); +} + =item replace OLD_RECORD Replaces the OLD_RECORD with this one in the database. If there is an error, |