X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pkg.pm;h=df67f3d3eb544b0adfd4937d97aa03d2db52ce6b;hb=5516013d689b79f4440732cd75eaf66737d7588f;hp=d3290bfcf2a35af6505c73a2e7abce2d4e05d446;hpb=9ee7f636a8d23de9634561c9a6aae1e79453b2e5;p=freeside.git diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index d3290bfcf..df67f3d3e 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -338,7 +338,7 @@ sub void { unless (ref($reason) || !$reason) { $reason = FS::reason->new_or_existing( 'class' => 'I', - 'type' => 'Void invoice', + 'type' => 'Invoice void', 'reason' => $reason ); } @@ -1101,17 +1101,34 @@ sub cust_bill_pkg_tax_Xlocation { =item recur_show_zero -=cut +Whether to show a zero recurring amount. This is true if the package or its +definition has the recur_show_zero flag, and the recurring fee is actually +zero for this period. -sub recur_show_zero { shift->_X_show_zero('recur'); } -sub setup_show_zero { shift->_X_show_zero('setup'); } +=cut -sub _X_show_zero { +sub recur_show_zero { my( $self, $what ) = @_; - return 0 unless $self->$what() == 0 && $self->pkgnum; + return 0 unless $self->get('recur') == 0 && $self->pkgnum; + + $self->cust_pkg->_X_show_zero('recur'); +} + +=item setup_show_zero - $self->cust_pkg->_X_show_zero($what); +Whether to show a zero setup charge. This requires the package or its +definition to have the setup_show_zero flag, but it also returns false if +the package's setup date is before this line item's start date. + +=cut + +sub setup_show_zero { + my $self = shift; + return 0 unless $self->get('setup') == 0 && $self->pkgnum; + my $cust_pkg = $self->cust_pkg; + return 0 if ( $self->sdate || 0 ) > ( $cust_pkg->setup || 0 ); + return $cust_pkg->_X_show_zero('setup'); } =item credited [ BEFORE, AFTER, OPTIONS ]