X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_fee.pm;h=a10b066343903f70b1f6fae14567b51cb56b28bc;hb=eb4d11c3c769f55969dbfb46b081781f47b439de;hp=2f48bfe16eb6f74a8729744200845a81dc131e80;hpb=4757eb16173dcc09d37b2f3856c0b7aba0e4652f;p=freeside.git diff --git a/FS/FS/part_fee.pm b/FS/FS/part_fee.pm index 2f48bfe16..a10b06634 100644 --- a/FS/FS/part_fee.pm +++ b/FS/FS/part_fee.pm @@ -5,6 +5,7 @@ use base qw( FS::o2m_Common FS::Record ); use vars qw( $DEBUG ); use FS::Record qw( qsearch qsearchs ); use FS::pkg_class; +use FS::cust_bill_pkg_display; use FS::part_pkg_taxproduct; use FS::agent; use FS::part_fee_usage; @@ -379,11 +380,19 @@ sub lineitem { # set the amount that we'll charge $cust_bill_pkg->set( $self->setuprecur, $amount ); + # create display record + my $categoryname = ''; if ( $self->classnum ) { my $pkg_category = $self->pkg_class->pkg_category; - $cust_bill_pkg->set('section' => $pkg_category->categoryname) - if $pkg_category; + $categoryname = $pkg_category->categoryname if $pkg_category; } + my $displaytype = ($self->setuprecur eq 'setup') ? 'S' : 'R'; + my $display = FS::cust_bill_pkg_display->new({ + type => $displaytype, + section => $categoryname, + # post_total? summary? who the hell knows? + }); + $cust_bill_pkg->set('display', [ $display ]); # if this is a percentage fee and has line item fractions, # adjust them to be proportional and to add up correctly. @@ -488,6 +497,19 @@ sub tax_rates { return @taxes; } +=item categoryname + +Returns the package category name, or the empty string if there is no package +category. + +=cut + +sub categoryname { + my $self = shift; + my $pkg_class = $self->pkg_class; + $pkg_class ? $pkg_class->categoryname : ''; +} + sub part_pkg_taxoverride {} # we don't do overrides here sub has_taxproduct {