summaryrefslogtreecommitdiff
path: root/FS/FS/part_fee.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-04-28 13:54:33 -0700
committerMark Wells <mark@freeside.biz>2014-04-28 13:54:33 -0700
commitebd92772ce134b05f72d11e564a9f9abf72f1b4e (patch)
tree4f23f3647e8ddb91cc12453143acf98c621cc2a8 /FS/FS/part_fee.pm
parent496842b7db855bd616844c7667e5d70de42535fd (diff)
in invoice rendering, treat administrative fees more like package charges, #28883
Notes
Notes: for #28861, not #28883
Diffstat (limited to 'FS/FS/part_fee.pm')
-rw-r--r--FS/FS/part_fee.pm26
1 files changed, 24 insertions, 2 deletions
diff --git a/FS/FS/part_fee.pm b/FS/FS/part_fee.pm
index ccf1351..370005c 100644
--- a/FS/FS/part_fee.pm
+++ b/FS/FS/part_fee.pm
@@ -4,6 +4,7 @@ use strict;
use base qw( FS::o2m_Common FS::Record );
use vars qw( $DEBUG );
use FS::Record qw( qsearch qsearchs );
+use FS::cust_bill_pkg_display;
$DEBUG = 0;
@@ -375,11 +376,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.
@@ -484,6 +493,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 {