[freeside-commits] freeside/FS/FS cust_main_Mixin.pm, 1.6.2.1, 1.6.2.2

Ivan,,, ivan at wavetail.420.am
Sat Dec 19 12:29:51 PST 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv32080

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	cust_main_Mixin.pm 
Log Message:
fix event report w/ a customer status

Index: cust_main_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main_Mixin.pm,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- cust_main_Mixin.pm	30 Oct 2009 23:30:13 -0000	1.6.2.1
+++ cust_main_Mixin.pm	19 Dec 2009 20:29:49 -0000	1.6.2.2
@@ -2,6 +2,7 @@
 
 use strict;
 use vars qw( $DEBUG $me );
+use Carp qw( confess );
 use FS::UID qw(dbh);
 use FS::cust_main;
 
@@ -255,21 +256,22 @@
 
 =item cancelled_sql
 
-Given an object that contains fields from cust_main (say, from a JOINed
-search; see httemplate/search/ for examples), returns the equivalent of the
-corresponding FS::cust_main method, or "0" if this object is not linked to
-a customer.
+Class methods that return SQL framents, equivalent to the corresponding
+FS::cust_main method.
 
 =cut
 
+#      my \$self = shift;
+#      \$self->cust_linked
+#        ? FS::cust_main::${sub}_sql(\$self)
+#        : '0';
+
 foreach my $sub (qw( prospect active inactive suspended cancelled )) {
   eval "
     sub ${sub}_sql {
-      my \$self = shift;
-      \$self->cust_linked
-        ? FS::cust_main::${sub}_sql(\$self)
-        : '0';
-      }
+      confess 'cust_main_Mixin ${sub}_sql called with object' if ref(\$_[0]);
+      'cust_main.custnum IS NOT NULL AND '. FS::cust_main->${sub}_sql();
+    }
   ";
   die $@ if $@;
 }



More information about the freeside-commits mailing list