[freeside-commits] branch FREESIDE_4_BRANCH updated. 3eb36ed54fe59f2867f9343a46f01cc728dce938

Mark Wells mark at 420.am
Wed May 11 17:51:07 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  3eb36ed54fe59f2867f9343a46f01cc728dce938 (commit)
      from  ecd3448a5df4a9cda68d16a69356154c70db8703 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3eb36ed54fe59f2867f9343a46f01cc728dce938
Author: Mark Wells <mark at freeside.biz>
Date:   Wed May 11 17:06:33 2016 -0700

    with setup_show_zero enabled, still only show zero setup when billing on the setup date, #42375

diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index e7860e0..df67f3d 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -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 ]

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_bill_pkg.pm |   29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list