[freeside-commits] freeside/FS/FS cust_main.pm,1.527,1.528
Ivan,,,
ivan at wavetail.420.am
Mon Aug 2 19:11:33 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv27780
Modified Files:
cust_main.pm
Log Message:
fix active customers sometimes showing in search results for new "ordered" status, RT#9381
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.527
retrieving revision 1.528
diff -u -w -d -r1.527 -r1.528
--- cust_main.pm 28 Jul 2010 23:16:29 -0000 1.527
+++ cust_main.pm 3 Aug 2010 02:11:30 -0000 1.528
@@ -7488,7 +7488,8 @@
=cut
sub ordered_sql {
- " 0 < ( $select_count_pkgs AND ". FS::cust_pkg->ordered_sql. " ) ";
+ FS::cust_main->none_active_sql.
+ " AND 0 < ( $select_count_pkgs AND ". FS::cust_pkg->ordered_sql. " ) ";
}
=item active_sql
@@ -7502,6 +7503,18 @@
" 0 < ( $select_count_pkgs AND ". FS::cust_pkg->active_sql. " ) ";
}
+=item none_active_sql
+
+Returns an SQL expression identifying cust_main records with no active
+recurring packages. This includes customers of status prospect, ordered,
+inactive, and suspended.
+
+=cut
+
+sub none_active_sql {
+ " 0 = ( $select_count_pkgs AND ". FS::cust_pkg->active_sql. " ) ";
+}
+
=item inactive_sql
Returns an SQL expression identifying inactive cust_main records (customers with
@@ -7509,11 +7522,10 @@
=cut
-sub inactive_sql { "
- 0 = ( $select_count_pkgs AND ". FS::cust_pkg->active_sql. " )
- AND
- 0 < ( $select_count_pkgs AND ". FS::cust_pkg->inactive_sql. " )
-"; }
+sub inactive_sql {
+ FS::cust_main->none_active_sql.
+ " AND 0 < ( $select_count_pkgs AND ". FS::cust_pkg->inactive_sql. " ) ";
+}
=item susp_sql
=item suspended_sql
@@ -7524,11 +7536,10 @@
sub suspended_sql { susp_sql(@_); }
-sub susp_sql { "
- 0 < ( $select_count_pkgs AND ". FS::cust_pkg->suspended_sql. " )
- AND
- 0 = ( $select_count_pkgs AND ". FS::cust_pkg->active_sql. " )
-"; }
+sub susp_sql {
+ FS::cust_main->none_active_sql.
+ " AND 0 < ( $select_count_pkgs AND ". FS::cust_pkg->suspended_sql. " ) ";
+}
=item cancel_sql
=item cancelled_sql
More information about the freeside-commits
mailing list