summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_pkg.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r--FS/FS/cust_bill_pkg.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index a943921..066ddf1 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -968,6 +968,31 @@ sub tax_locationnum {
}
}
+sub tax_location {
+ my $self = shift;
+ FS::cust_location->by_key($self->tax_locationnum);
+}
+
+=item part_X
+
+Returns the L<FS::part_pkg> or L<FS::part_fee> object that defines this
+charge. If called on a tax line, returns nothing.
+
+=cut
+
+sub part_X {
+ my $self = shift;
+ if ( $self->override_pkgpart ) {
+ return FS::part_pkg->by_key($self->override_pkgpart);
+ } elsif ( $self->pkgnum ) {
+ return $self->cust_pkg->part_pkg;
+ } elsif ( $self->feepart ) {
+ return $self->part_fee;
+ } else {
+ return;
+ }
+}
+
=back
=head1 CLASS METHODS