[freeside-commits] freeside/FS/FS cust_main.pm, 1.568.2.3, 1.568.2.4 Conf.pm, 1.397.2.20, 1.397.2.21
Ivan,,,
ivan at wavetail.420.am
Thu Jan 20 01:52:00 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv9011/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
cust_main.pm Conf.pm
Log Message:
add cust_main-status_module to control how customers with cancelled recurring but un-cancelled one time charges are recognized, RT#10478
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.397.2.20
retrieving revision 1.397.2.21
diff -u -w -d -r1.397.2.20 -r1.397.2.21
--- Conf.pm 19 Jan 2011 20:34:55 -0000 1.397.2.20
+++ Conf.pm 20 Jan 2011 09:51:58 -0000 1.397.2.21
@@ -4228,6 +4228,14 @@
'type' => 'checkbox',
},
+ {
+ '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.', #other differences?
+ 'type' => 'select',
+ 'select_enum' => [ 'Classic', 'Recurring' ],
+ },
+
{ key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.568.2.3
retrieving revision 1.568.2.4
diff -u -w -d -r1.568.2.3 -r1.568.2.4
--- cust_main.pm 16 Jan 2011 05:07:07 -0000 1.568.2.3
+++ cust_main.pm 20 Jan 2011 09:51:58 -0000 1.568.2.4
@@ -3,7 +3,7 @@
require 5.006;
use strict;
#FS::cust_main:_Marketgear when they're ready to move to 2.1
-use base qw( FS::cust_main::Packages
+use base qw( FS::cust_main::Packages FS::cust_main::Status
FS::cust_main::Billing FS::cust_main::Billing_Realtime
FS::cust_main::Billing_Discount
FS::otaker_Mixin FS::payinfo_Mixin FS::cust_main_Mixin
@@ -3810,6 +3810,9 @@
=back
+Behavior of inactive vs. cancelled edge cases can be adjusted with the
+cust_main-status_module configuration option.
+
=cut
sub status { shift->cust_status(@_); }
@@ -3847,21 +3850,11 @@
=cut
-use vars qw(%statuscolor);
-tie %statuscolor, 'Tie::IxHash',
- 'prospect' => '7e0079', #'000000', #black? naw, purple
- 'active' => '00CC00', #green
- 'ordered' => '009999', #teal? cyan?
- 'suspended' => 'FF9900', #yellow
- 'cancelled' => 'FF0000', #red
- 'inactive' => '0000CC', #blue
-;
-
sub statuscolor { shift->cust_statuscolor(@_); }
sub cust_statuscolor {
my $self = shift;
- $statuscolor{$self->cust_status};
+ $self->statuscolors->{$self->cust_status};
}
=item tickets
@@ -3957,8 +3950,8 @@
=cut
sub statuses {
- #my $self = shift; #could be class...
- keys %statuscolor;
+ my $self = shift;
+ keys %{ $self->statuscolors };
}
=item cust_status_sql
@@ -4002,13 +3995,14 @@
=item ordered_sql
Returns an SQL expression identifying ordered cust_main records (customers with
-recurring packages not yet setup).
+no active packages, but recurring packages not yet setup or one time charges
+not yet billed).
=cut
sub ordered_sql {
FS::cust_main->none_active_sql.
- " AND 0 < ( $select_count_pkgs AND ". FS::cust_pkg->ordered_sql. " ) ";
+ " AND 0 < ( $select_count_pkgs AND ". FS::cust_pkg->not_yet_billed_sql. " ) ";
}
=item active_sql
@@ -4067,22 +4061,7 @@
=cut
-sub cancelled_sql { cancel_sql(@_); }
-sub cancel_sql {
-
- my $recurring_sql = FS::cust_pkg->recurring_sql;
- my $cancelled_sql = FS::cust_pkg->cancelled_sql;
-
- "
- 0 < ( $select_count_pkgs )
- AND 0 < ( $select_count_pkgs AND $recurring_sql AND $cancelled_sql )
- AND 0 = ( $select_count_pkgs AND $recurring_sql
- AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
- )
- ";
-# AND 0 = ( $select_count_pkgs AND ". FS::cust_pkg->inactive_sql. " )
-
-}
+sub cancel_sql { shift->cancelled_sql(@_); }
=item uncancel_sql
=item uncancelled_sql
More information about the freeside-commits
mailing list