X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pkg.pm;h=77cdd11230fccf6f4e241e6842323fb13eaf3b86;hb=5f7fe6b10990eee2d1e8a9608cfd2bb656912477;hp=791999c17b64728bb4e704f7a7abb999a88fbde3;hpb=3a0db21942d7214320419c3ffe39948e26f2f23e;p=freeside.git diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 791999c17..77cdd1123 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -412,7 +412,8 @@ sub previous_cust_bill_pkg { Returns an array of detail information for the invoice line item. -Currently available options are: I I +Currently available options are: I, I and +I. If I is set to html or latex then the array members are improved for tabular appearance in those environments if possible. @@ -420,6 +421,12 @@ for tabular appearance in those environments if possible. If I is set then the array members are processed by this function before being returned. +I overrides the normal HTML or LaTeX function for returning +formatted CDRs. It can be set to a subroutine which returns an empty list +to skip usage detail: + + 'format_function' => sub { () }, + =cut sub details { @@ -871,7 +878,7 @@ sub cust_bill_pkg_detail { my %hash = ( 'billpkgnum' => $self->billpkgnum ); $hash{classnum} = $classnum if $classnum; - qsearch ( 'cust_bill_pkg_detail', { %hash } ), + qsearch( 'cust_bill_pkg_detail', \%hash ), } @@ -882,8 +889,34 @@ Returns the list of associated cust_bill_pkg_discount objects. =cut sub cust_bill_pkg_discount { - my $self = shift; - qsearch ( 'cust_bill_pkg_discount', { 'billpkgnum' => $self->billpkgnum } ); + my $self = shift; + qsearch( 'cust_bill_pkg_discount', { 'billpkgnum' => $self->billpkgnum } ); +} + +=item recur_show_zero + +=cut + +sub recur_show_zero { + #my $self = shift; + # $self->recur == 0 + #&& $self->pkgnum + #&& $self->cust_pkg->part_pkg->recur_show_zero; + + shift->_X_show_zero('recur'); + +} + +sub setup_show_zero { + shift->_X_show_zero('setup'); +} + +sub _X_show_zero { + my( $self, $what ) = @_; + + return 0 unless $self->$what() == 0 && $self->pkgnum; + + $self->cust_pkg->_X_show_zero($what); } =back