X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FTemplateItem_Mixin.pm;h=dcd7ab3fbf2216619a993ef1427f4b9bc5dd5e7b;hb=b64599c894116623746b90d184ba708d67392c65;hp=6ae3364d193efa1e38aebd9362d49d7ac9e9145c;hpb=c2f7d8ba623194ad1fae37b231b2e29b33d05674;p=freeside.git diff --git a/FS/FS/TemplateItem_Mixin.pm b/FS/FS/TemplateItem_Mixin.pm index 6ae3364d1..dcd7ab3fb 100644 --- a/FS/FS/TemplateItem_Mixin.pm +++ b/FS/FS/TemplateItem_Mixin.pm @@ -45,7 +45,31 @@ sub part_pkg { $part_pkg = $cust_pkg->part_pkg if $cust_pkg; $part_pkg; } +} + +=item part_fee +Returns the fee definition for this line item, if there is one. + +=cut + +sub part_fee { + my $self = shift; + $self->feepart + ? FS::part_fee->by_key($self->feepart) + : ''; +} + +=item part_X + +Returns L or L, whichever is applicable (or nothing, +if called on a tax line item). + +=cut + +sub part_X { + my $self = shift; + $self->part_pkg || $self->part_fee; } =item desc LOCALE @@ -367,15 +391,17 @@ sub cust_bill_pkg_detail { } -=item cust_bill_pkg_discount +=item pkg_discount -Returns the list of associated cust_bill_pkg_discount objects. +Returns the list of associated cust_bill_pkg_discount or +quotation_pkg_discount objects. =cut -sub cust_bill_pkg_discount { +sub pkg_discount { my $self = shift; - qsearch( $self->discount_table, { 'billpkgnum' => $self->billpkgnum } ); + my $pkey = $self->primary_key; + qsearch( $self->discount_table, { $pkey => $self->get($pkey) } ); } 1;