[freeside-commits] branch master updated. 0e252ec0538eadf8a9e76b32718161d9844b02c3

Ivan ivan at 420.am
Sun Jun 3 23:28:46 PDT 2012


The branch, master has been updated
       via  0e252ec0538eadf8a9e76b32718161d9844b02c3 (commit)
       via  af4463a31677181a21df0cde767cc11728cfeb0c (commit)
      from  bf265b9f6f18bd5e0a6089888cb6dfc20ae0d430 (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 0e252ec0538eadf8a9e76b32718161d9844b02c3
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jun 3 23:28:43 2012 -0700

    fix explicitly shown $0 line items (setup_show_zero / recur_show_zero) with invoice_sections, RT#17969

diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index d1cb3ba..7d7d363 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -3887,17 +3887,20 @@ sub _items_sections {
         if ( $display->post_total && !$summarypage ) {
           if (! $type || $type eq 'S') {
             $late_subtotal{$section} += $cust_bill_pkg->setup
-              if $cust_bill_pkg->setup != 0;
+              if $cust_bill_pkg->setup != 0
+              || $cust_bill_pkg->setup_show_zero;
           }
 
           if (! $type) {
             $late_subtotal{$section} += $cust_bill_pkg->recur
-              if $cust_bill_pkg->recur != 0;
+              if $cust_bill_pkg->recur != 0
+              || $cust_bill_pkg->recur_show_zero;
           }
 
           if ($type && $type eq 'R') {
             $late_subtotal{$section} += $cust_bill_pkg->recur - $usage
-              if $cust_bill_pkg->recur != 0;
+              if $cust_bill_pkg->recur != 0
+              || $cust_bill_pkg->recur_show_zero;
           }
           
           if ($type && $type eq 'U') {
@@ -3911,17 +3914,20 @@ sub _items_sections {
 
           if (! $type || $type eq 'S') {
             $subtotal{$section} += $cust_bill_pkg->setup
-              if $cust_bill_pkg->setup != 0;
+              if $cust_bill_pkg->setup != 0
+              || $cust_bill_pkg->setup_show_zero;
           }
 
           if (! $type) {
             $subtotal{$section} += $cust_bill_pkg->recur
-              if $cust_bill_pkg->recur != 0;
+              if $cust_bill_pkg->recur != 0
+              || $cust_bill_pkg->recur_show_zero;
           }
 
           if ($type && $type eq 'R') {
             $subtotal{$section} += $cust_bill_pkg->recur - $usage
-              if $cust_bill_pkg->recur != 0;
+              if $cust_bill_pkg->recur != 0
+              || $cust_bill_pkg->recur_show_zero;
           }
           
           if ($type && $type eq 'U') {
@@ -4914,6 +4920,8 @@ sub _items_cust_bill_pkg {
       }
     }
 
+    my @cust_bill_pkg_display = $cust_bill_pkg->cust_bill_pkg_display;
+
     warn "$me _items_cust_bill_pkg considering cust_bill_pkg ".
          $cust_bill_pkg->billpkgnum. ", pkgnum ". $cust_bill_pkg->pkgnum. "\n"
       if $DEBUG > 1;
@@ -4924,7 +4932,7 @@ sub _items_cust_bill_pkg {
                                }
                           #grep { !$_->summary || !$summary_page } # bunk!
                           grep { !$_->summary || $multisection }
-                          $cust_bill_pkg->cust_bill_pkg_display
+                          @cust_bill_pkg_display
                         )
     {
 

commit af4463a31677181a21df0cde767cc11728cfeb0c
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jun 3 23:24:57 2012 -0700

    cleanup

diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 6551ca8..e866a3f 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -955,8 +955,6 @@ sub cust_bill_pkg_display {
   my $default =
     new FS::cust_bill_pkg_display { billpkgnum =>$self->billpkgnum };
 
-  return ( $default ) unless defined dbdef->table('cust_bill_pkg_display');#hmmm
-
   my $type = $opt{type} if exists $opt{type};
   my @result;
 
@@ -1043,19 +1041,8 @@ sub cust_bill_pkg_discount {
 
 =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 recur_show_zero { shift->_X_show_zero('recur'); }
+sub setup_show_zero { shift->_X_show_zero('setup'); }
 
 sub _X_show_zero {
   my( $self, $what ) = @_;

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

Summary of changes:
 FS/FS/cust_bill.pm     |   22 +++++++++++++++-------
 FS/FS/cust_bill_pkg.pm |   17 ++---------------
 2 files changed, 17 insertions(+), 22 deletions(-)




More information about the freeside-commits mailing list