[freeside-commits] freeside/FS/FS cust_main.pm,1.453,1.454

Ivan,,, ivan at wavetail.420.am
Fri Sep 18 15:41:27 PDT 2009


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

Modified Files:
	cust_main.pm 
Log Message:
add active option to has_referral_custnum condition, RT#6150

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.453
retrieving revision 1.454
diff -u -d -r1.453 -r1.454
--- cust_main.pm	24 Aug 2009 08:50:47 -0000	1.453
+++ cust_main.pm	18 Sep 2009 22:41:25 -0000	1.454
@@ -6951,6 +6951,24 @@
   join(', ', $self->invoicing_list_emailonly);
 }
 
+=item referral_custnum_cust_main
+
+Returns the customer who referred this customer (or the empty string, if
+this customer was not referred).
+
+Note the difference with referral_cust_main method: This method,
+referral_custnum_cust_main returns the single customer (if any) who referred
+this customer, while referral_cust_main returns an array of customers referred
+BY this customer.
+
+=cut
+
+sub referral_custnum_cust_main {
+  my $self = shift;
+  return '' unless $self->referral_custnum;
+  qsearchs('cust_main', { 'custnum' => $self->referral_custnum } );
+}
+
 =item referral_cust_main [ DEPTH [ EXCLUDE_HASHREF ] ]
 
 Returns an array of customers referred by this customer (referral_custnum set
@@ -6958,6 +6976,11 @@
 customers referred by customers referred by this customer and so on, inclusive.
 The default behavior is DEPTH 1 (no recursion).
 
+Note the difference with referral_custnum_cust_main method: This method,
+referral_cust_main, returns an array of customers referred BY this customer,
+while referral_custnum_cust_main returns the single customer (if any) who
+referred this customer.
+
 =cut
 
 sub referral_cust_main {



More information about the freeside-commits mailing list