[freeside-commits] branch FREESIDE_3_BRANCH updated. 9d39272b3a6f8e43ae54c57b8690aa2fa0f5aec7
Ivan
ivan at 420.am
Mon Mar 21 13:15:37 PDT 2016
The branch, FREESIDE_3_BRANCH has been updated
via 9d39272b3a6f8e43ae54c57b8690aa2fa0f5aec7 (commit)
from 37fa9b067e286bc5f0abe693ec7c3aec4fd0b0b8 (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 9d39272b3a6f8e43ae54c57b8690aa2fa0f5aec7
Author: Ivan Kohler <ivan at freeside.biz>
Date: Mon Mar 21 13:15:35 2016 -0700
optimize customer list, RT#20173
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 10bb59c..028a949 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5775,7 +5775,7 @@ and customer address. Include units.',
{
'key' => 'cust_main-status_module',
'section' => 'UI',
- 'description' => 'Which module to use for customer status display. The "Classic" module (the default) considers accounts with cancelled recurring packages but un-cancelled one-time charges Inactive. The "Recurring" module considers those customers Cancelled. Similarly for customers with suspended recurring packages but one-time charges.', #other differences?
+ 'description' => 'Which module to use for customer status display. The "Classic" module (the default) considers accounts with cancelled recurring packages but un-cancelled one-time charges Inactive. The "Recurring" module considers those customers Cancelled. Similarly for customers with suspended recurring packages but one-time charges. Restart Apache after changing.', #other differences?
'type' => 'select',
'select_enum' => [ 'Classic', 'Recurring' ],
},
diff --git a/FS/FS/cust_main/Status.pm b/FS/FS/cust_main/Status.pm
index b0f6b4c..b30cef4 100644
--- a/FS/FS/cust_main/Status.pm
+++ b/FS/FS/cust_main/Status.pm
@@ -1,20 +1,17 @@
package FS::cust_main::Status;
use strict;
-use vars qw( $conf ); # $module ); #$DEBUG $me );
+use vars qw( $conf $module ); #$DEBUG $me );
+use Tie::IxHash;
use FS::UID;
use FS::cust_pkg;
-#use Tie::IxHash;
-
-use FS::UID qw( getotaker dbh driver_name );
-
#$DEBUG = 0;
#$me = '[FS::cust_main::Status]';
install_callback FS::UID sub {
$conf = new FS::Conf;
- #$module = $conf->config('cust_main-status_module') || 'Classic';
+ $module = $conf->config('cust_main-status_module') || 'Classic';
};
=head1 NAME
@@ -43,8 +40,6 @@ sub statuscolors {
my %statuscolors;
- my $module = $conf->config('cust_main-status_module') || 'Classic';
-
if ( $module eq 'Classic' ) {
tie %statuscolors, 'Tie::IxHash',
'prospect' => 'FF00F5', #'000000', #black? naw, purple
@@ -90,8 +85,6 @@ sub cancelled_sql {
AND 0 < ( $select_count_pkgs AND $cancelled_sql )
";
- my $module = $conf->config('cust_main-status_module') || 'Classic';
-
if ( $module eq 'Classic' ) {
$sql .=
" AND 0 = ( $select_count_pkgs AND ". FS::cust_pkg->inactive_sql. " ) ";
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 6ff91b5..9ad583c 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -5,13 +5,22 @@ use base qw( FS::part_pkg::prorate_Mixin
);
use strict;
-use vars qw( %info %usage_recharge_fields @usage_recharge_fieldorder );
+use vars qw( $conf $money_char %info
+ %usage_recharge_fields @usage_recharge_fieldorder
+ );
+use FS::UID;
use FS::Record qw( qsearch );
use Tie::IxHash;
use List::Util qw( min );
use FS::UI::bytecount;
use FS::Conf;
+#ask FS::UID to run this stuff for us later
+FS::UID->install_callback( sub {
+ $conf = new FS::Conf;
+ $money_char = $conf->config('money_char') || '$';
+});
+
tie my %temporalities, 'Tie::IxHash',
'upcoming' => "Upcoming (future)",
'preceding' => "Preceding (past)",
@@ -97,16 +106,16 @@ tie my %contract_years, 'Tie::IxHash', (
);
sub price_info {
- my $self = shift;
- my $conf = new FS::Conf;
- my $money_char = $conf->config('money_char') || '$';
- my $setup = $self->option('setup_fee') || 0;
- my $recur = $self->option('recur_fee', 1) || 0;
- my $str = '';
- $str = $money_char . $setup . ($recur ? ' setup ' : ' one-time') if $setup;
- $str .= ', ' if ($setup && $recur);
- $str .= $money_char. $recur. '/'. $self->freq_pretty if $recur;
- $str;
+ my $self = shift;
+
+ my $setup = $self->option('setup_fee') || 0;
+ my $recur = $self->option('recur_fee', 1) || 0;
+
+ my $str = '';
+ $str = $money_char . $setup . ($recur ? ' setup ' : ' one-time') if $setup;
+ $str .= ', ' if ($setup && $recur);
+ $str .= $money_char. $recur. '/'. $self->freq_pretty if $recur;
+ $str;
}
sub calc_setup {
@@ -205,7 +214,6 @@ sub base_recur_permonth {
sub calc_cancel {
my $self = shift;
- my $conf = new FS::Conf;
if ( $self->recur_temporality eq 'preceding'
and $self->option('bill_recur_on_cancel', 1) ) {
# run another recurring cycle
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Conf.pm | 2 +-
FS/FS/cust_main/Status.pm | 13 +++----------
FS/FS/part_pkg/flat.pm | 32 ++++++++++++++++++++------------
3 files changed, 24 insertions(+), 23 deletions(-)
More information about the freeside-commits
mailing list