[freeside-commits] branch FREESIDE_4_BRANCH updated. 79019df554d5c447da8b1df135b34d66a0cb69c6
Ivan
ivan at 420.am
Wed Mar 23 19:19:38 PDT 2016
The branch, FREESIDE_4_BRANCH has been updated
via 79019df554d5c447da8b1df135b34d66a0cb69c6 (commit)
from d2d9921b2bd4228e78ce6c793d700c327d3c597c (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 79019df554d5c447da8b1df135b34d66a0cb69c6
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Mar 23 19:19:37 2016 -0700
optimize customer list (fix option caching in 3.x), RT#20173
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 45bdc62..8f00304 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -1416,9 +1416,8 @@ sub option {
my( $self, $opt, $ornull ) = @_;
#cache: was pulled up in the original part_pkg query
- if ( $opt =~ /^(setup|recur)_fee$/ && defined($self->hashref->{"_$opt"}) ) {
- return $self->hashref->{"_$opt"};
- }
+ return $self->hashref->{"_opt_$opt"}
+ if exists $self->hashref->{"_opt_$opt"};
cluck "$self -> option: searching for $opt" if $DEBUG;
my $part_pkg_option =
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 04d761b..7b5a3f6 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -136,11 +136,7 @@ sub calc_setup {
sub base_setup {
my($self, $cust_pkg, $sdate, $details ) = @_;
- ( exists( $self->{'Hash'}{'_opt_setup_fee'} )
- ? $self->{'Hash'}{'_opt_setup_fee'}
- : $self->option('setup_fee', 1)
- )
- || 0;
+ $self->option('setup_fee', 1) || 0;
}
sub calc_recur {
@@ -193,11 +189,7 @@ sub cutoff_day {
sub base_recur {
my($self, $cust_pkg, $sdate) = @_;
- ( exists( $self->{'Hash'}{'_opt_recur_fee'} )
- ? $self->{'Hash'}{'_opt_recur_fee'}
- : $self->option('recur_fee', 1)
- )
- || 0;
+ $self->option('recur_fee', 1) || 0;
}
sub base_recur_permonth {
-----------------------------------------------------------------------
Summary of changes:
FS/FS/part_pkg.pm | 5 ++---
FS/FS/part_pkg/flat.pm | 12 ++----------
2 files changed, 4 insertions(+), 13 deletions(-)
More information about the freeside-commits
mailing list