diff options
author | jeff <jeff> | 2008-08-08 18:13:05 +0000 |
---|---|---|
committer | jeff <jeff> | 2008-08-08 18:13:05 +0000 |
commit | 20d7ca3a3e37b9748eed3f7ef362f04c757420ba (patch) | |
tree | a07e30a32bbe662e2d9fc9f2594f79f4ed1b96a2 /FS/FS/cust_bill_pkg.pm | |
parent | b2474be9902af86b59b8e581de4609dee136264b (diff) |
cdrs can be in separate invoice section, after total, summarized inline, with hints for page breaks
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r-- | FS/FS/cust_bill_pkg.pm | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 638e707..b3b8ea5 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -57,6 +57,24 @@ supported: =item itemdesc - Line item description (overrides normal package description) +=item section - Invoice section (overrides normal package section) + +=duplicate - Indicates this item appears elsewhere on the invoice + (and should not be retaxed or reincluded in totals) + +=post_total - A hint that this item should appear after invoice totals + +=cut + +sub section { + my ( $self, $value ) = @_; + if ( defined($value) ) { + $self->setfield('section', $value); + } else { + $self->getfield('section') || $self->part_pkg->categoryname; + } +} + =item quantity - If not set, defaults to 1 =item unitsetup - If not set, defaults to setup @@ -174,6 +192,9 @@ sub check { || $self->ut_numbern('sdate') || $self->ut_numbern('edate') || $self->ut_textn('itemdesc') + || $self->ut_textn('section') + || $self->ut_enum('duplicate', [ '', 'Y' ]) + || $self->ut_enum('post_total', [ '', 'Y' ]) ; return $error if $error; @@ -382,7 +403,7 @@ line item. sub units { my $self = shift; - $self->part_pkg->calc_units($self->cust_pkg); + $self->pkgnum ? $self->part_pkg->calc_units($self->cust_pkg) : 0; # 1? } =item quantity @@ -425,6 +446,18 @@ sub unitrecur { : $self->getfield('unitrecur'); } +=item separate_cdr + +Returns true if this line item represents a cdr line item in its own section. + +=cut + +# lame, but works for now +sub separate_cdr { + my( $self ) = shift; + $self->pkgnum && $self->section ne $self->part_pkg->categoryname; +} + =back =head1 BUGS |