[freeside-commits] freeside/FS/FS cust_pkg.pm,1.139.2.2,1.139.2.3
Ivan,,,
ivan at wavetail.420.am
Tue Nov 3 16:53:14 PST 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv28431/FS/FS
Modified Files:
Tag: FREESIDE_1_9_BRANCH
cust_pkg.pm
Log Message:
fix customer package search (fallout from customer classes) & add "not yet billed" status to customer package report
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.139.2.2
retrieving revision 1.139.2.3
diff -u -d -r1.139.2.2 -r1.139.2.3
--- cust_pkg.pm 28 Oct 2009 06:15:08 -0000 1.139.2.2
+++ cust_pkg.pm 4 Nov 2009 00:53:12 -0000 1.139.2.3
@@ -2221,6 +2221,7 @@
sub active_sql { "
". $_[0]->recurring_sql(). "
+ AND cust_pkg.setup IS NOT NULL AND cust_pkg.setup != 0
AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
"; }
@@ -2384,8 +2385,8 @@
push @where, FS::cust_pkg->active_sql();
- } elsif ( $params->{'magic'} eq 'not yet billed'
- || $params->{'status'} eq 'not yet billed' ) {
+ } elsif ( $params->{'magic'} =~ /^not[ _]yet[ _]billed$/
+ || $params->{'status'} =~ /^not[ _]yet[ _]billed$/ ) {
push @where, FS::cust_pkg->not_yet_billed_sql();
@@ -2419,7 +2420,7 @@
{
$classnum = $1;
if ( $classnum ) { #a specific class
- push @where, "classnum = $classnum";
+ push @where, "part_pkg.classnum = $classnum";
#@pkg_class = ( qsearchs('pkg_class', { 'classnum' => $classnum } ) );
#die "classnum $classnum not found!" unless $pkg_class[0];
@@ -2427,7 +2428,7 @@
} elsif ( $classnum eq '' ) { #the empty class
- push @where, "classnum IS NULL";
+ push @where, "part_pkg.classnum IS NULL";
#$title .= 'Empty class ';
#@pkg_class = ( '(empty class)' );
} elsif ( $classnum eq '0' ) {
@@ -2591,9 +2592,9 @@
my $extra_sql = scalar(@where) ? ' WHERE '. join(' AND ', @where) : '';
- my $addl_from = 'LEFT JOIN cust_main USING ( custnum ) '.
- 'LEFT JOIN part_pkg USING ( pkgpart ) '.
- 'LEFT JOIN pkg_class USING ( classnum ) ';
+ my $addl_from = 'LEFT JOIN part_pkg USING ( pkgpart ) '.
+ 'LEFT JOIN pkg_class USING ( classnum ) '.
+ 'LEFT JOIN cust_main USING ( custnum ) ';
my $count_query = "SELECT COUNT(*) FROM cust_pkg $addl_from $extra_sql";
More information about the freeside-commits
mailing list