[freeside-commits] branch master updated. da0e47d64f0aabf03c308dd93ab0c7c88a98208b

Ivan ivan at 420.am
Tue May 6 05:35:51 PDT 2014


The branch, master has been updated
       via  da0e47d64f0aabf03c308dd93ab0c7c88a98208b (commit)
       via  bf53da6deb6f4e2e71f60224c27863940b8de3d6 (commit)
      from  7f9a709406959210d4177c6e76a5e074319abf18 (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 da0e47d64f0aabf03c308dd93ab0c7c88a98208b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue May 6 05:35:48 2014 -0700

    optimize package list with lots of packages, RT#28526

diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 746e0c7..a05142f 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -313,4 +313,9 @@ $num_old_packages -= scalar(@packages);
 # (as will change-target packages)
 @packages = grep !$_->main_pkgnum, @packages;
 
+foreach my $cust_pkg ( @packages ) {
+  $cust_pkg->{'_cust_pkg_discount_active'} =
+   [ $cust_pkg->cust_pkg_discount_active ];
+}
+
 </%init>
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index ab7bad2..6a0c7f7 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -49,7 +49,7 @@
 %
 %             if ( $curuser->access_right('Discount customer package')
 %                  && $part_pkg->can_discount
-%                  && ! scalar($cust_pkg->cust_pkg_discount_active)
+%                  && ! scalar( @{ $cust_pkg->{_cust_pkg_discount_active} } )
 %                  && ! scalar($cust_pkg->part_pkg->part_pkg_discount)
 %                )
 %             {
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index 689ee45..dbf3698 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -494,7 +494,7 @@ sub pkg_status_row_discount {
 
   my $html;
 
-  foreach my $cust_pkg_discount ( $cust_pkg->cust_pkg_discount_active ) {
+  foreach my $cust_pkg_discount (@{ $cust_pkg->{_cust_pkg_discount_active} }) {
 
     my $discount = $cust_pkg_discount->discount;
 

commit bf53da6deb6f4e2e71f60224c27863940b8de3d6
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue May 6 00:15:00 2014 -0700

    remove ancient code

diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 39a810c..cd85f67 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -651,47 +651,6 @@ sub cust_suspend_if_balance_over {
   }
 }
 
-=item cust_credit
-
-Depreciated.  See the cust_credited method.
-
- #Returns a list consisting of the total previous credited (see
- #L<FS::cust_credit>) and unapplied for this customer, followed by the previous
- #outstanding credits (FS::cust_credit objects).
-
-=cut
-
-sub cust_credit {
-  use Carp;
-  croak "FS::cust_bill->cust_credit depreciated; see ".
-        "FS::cust_bill->cust_credit_bill";
-  #my $self = shift;
-  #my $total = 0;
-  #my @cust_credit = sort { $a->_date <=> $b->_date }
-  #  grep { $_->credited != 0 && $_->_date < $self->_date }
-  #    qsearch('cust_credit', { 'custnum' => $self->custnum } )
-  #;
-  #foreach (@cust_credit) { $total += $_->credited; }
-  #$total, @cust_credit;
-}
-
-=item cust_pay
-
-Depreciated.  See the cust_bill_pay method.
-
-#Returns all payments (see L<FS::cust_pay>) for this invoice.
-
-=cut
-
-sub cust_pay {
-  use Carp;
-  croak "FS::cust_bill->cust_pay depreciated; see FS::cust_bill->cust_bill_pay";
-  #my $self = shift;
-  #sort { $a->_date <=> $b->_date }
-  #  qsearch( 'cust_pay', { 'invnum' => $self->invnum } )
-  #;
-}
-
 =item cust_bill_pay
 
 Returns all payment applications (see L<FS::cust_bill_pay>) for this invoice.

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

Summary of changes:
 FS/FS/cust_bill.pm                              |   41 -----------------------
 httemplate/view/cust_main/packages.html         |    5 +++
 httemplate/view/cust_main/packages/package.html |    2 +-
 httemplate/view/cust_main/packages/status.html  |    2 +-
 4 files changed, 7 insertions(+), 43 deletions(-)




More information about the freeside-commits mailing list