X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pkg.pm;h=7257a9bb888ccaeca8e07b83259afbeed00222d0;hb=e18263db61c9695eb4c139f23c79730fd7659ad6;hp=352ed6a12a05e640054a886e09a5693daadb8216;hpb=5b884dd940f7dce415ba77dcbc2ab6840f0b5673;p=freeside.git diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 352ed6a12..7257a9bb8 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -25,6 +25,7 @@ use FS::cust_bill_pkg_discount_void; use FS::cust_bill_pkg_tax_location_void; use FS::cust_bill_pkg_tax_rate_location_void; use FS::cust_tax_exempt_pkg_void; +use FS::cust_bill_pkg_fee_void; use FS::Cursor; @@ -358,6 +359,7 @@ sub void { cust_bill_pkg_tax_location cust_bill_pkg_tax_rate_location cust_tax_exempt_pkg + cust_bill_pkg_fee )) { foreach my $linked ( qsearch($table, { billpkgnum=>$self->billpkgnum }) ) { @@ -417,6 +419,7 @@ sub delete { cust_tax_exempt_pkg cust_bill_pay_pkg cust_credit_bill_pkg + cust_bill_pkg_fee )) { foreach my $linked ( qsearch($table, { billpkgnum=>$self->billpkgnum }) ) { @@ -899,7 +902,13 @@ sub usage { my $sql = 'SELECT SUM(COALESCE(amount,0)) FROM cust_bill_pkg_detail '. ' WHERE billpkgnum = '. $self->billpkgnum; - $sql .= " AND classnum = $classnum" if defined($classnum); + if (defined $classnum) { + if ($classnum =~ /^(\d+)$/) { + $sql .= " AND classnum = $1"; + } elsif ($classnum eq '') { + $sql .= " AND classnum IS NULL"; + } + } my $sth = dbh->prepare($sql) or die dbh->errstr; $sth->execute or die $sth->errstr; @@ -1020,26 +1029,6 @@ sub tax_location { } } -=item part_X - -Returns the L or L object that defines this -charge. If called on a tax line, returns nothing. - -=cut - -sub part_X { - my $self = shift; - if ( $self->pkgpart_override ) { - return FS::part_pkg->by_key($self->pkgpart_override); - } elsif ( $self->pkgnum ) { - return $self->cust_pkg->part_pkg; - } elsif ( $self->feepart ) { - return $self->part_fee; - } else { - return; - } -} - =back =head1 CLASS METHODS