summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_pkg.pm
diff options
context:
space:
mode:
authorivan <ivan>2005-07-09 10:36:43 +0000
committerivan <ivan>2005-07-09 10:36:43 +0000
commitc160bc6f05b17d8084addc4d638ebc908c9ec0e6 (patch)
treefe2093b6abddb221e892b76f1095f25742d61e26 /FS/FS/cust_bill_pkg.pm
parentff0258d05484670831222da23427606f719cc009 (diff)
add desc method to cust_bill_pkg and use it in cust_bill... this should help with any *other* cust_bill_pkg.pkgnum == -1 stuff that needs to be sorted out
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r--FS/FS/cust_bill_pkg.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 2267323..77429f2 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -204,6 +204,25 @@ sub details {
#qsearch ( 'cust_bill_pkg_detail', { 'lineitemnum' => $self->lineitemnum });
}
+=item desc
+
+Returns a description for this line item. For typical line items, this is the
+I<pkg> field of the corresponding B<FS::part_pkg> object (see L<FS::part_pkg>).
+For one-shot line items and named taxes, it is the I<itemdesc> field of this
+line item, and for generic taxes, simply returns "Tax".
+
+=cut
+
+sub desc {
+ my $self = shift;
+
+ if ( $self->pkgnum > 0 ) {
+ $self->cust_pkg->part_pkg->pkg;
+ } else {
+ $self->itemdesc || 'Tax';
+ }
+}
+
=back
=head1 BUGS