[freeside-commits] freeside/FS/FS cust_main.pm, 1.264, 1.265 cust_main_Mixin.pm, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Mon Jan 29 08:01:25 PST 2007


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv29037/FS/FS

Modified Files:
	cust_main.pm cust_main_Mixin.pm 
Log Message:
fix invoice email display bug on advanced package report, closes: Bug#1416

Index: cust_main_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main_Mixin.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cust_main_Mixin.pm	19 Jun 2006 08:05:28 -0000	1.2
+++ cust_main_Mixin.pm	29 Jan 2007 16:01:22 -0000	1.3
@@ -1,8 +1,11 @@
 package FS::cust_main_Mixin;
 
 use strict;
+use vars qw( $DEBUG );
 use FS::cust_main;
 
+$DEBUG = 0;
+
 =head1 NAME
 
 FS::cust_main_Mixin - Mixin class for records that contain fields from cust_main
@@ -109,20 +112,51 @@
 
 Given an object that contains fields from cust_main (say, from a JOINed
 search; see httemplate/search/ for examples), returns the equivalent of the
-FS::cust_main I<country_full> method, or "(unlinked)" if this object is not
-linked to a customer.
+FS::cust_main I<invoicing_list_emailonly> method, or "(unlinked)" if this
+object is not linked to a customer.
 
 =cut
 
 sub invoicing_list_emailonly {
   my $self = shift;
   warn "invoicing_list_email only called on $self, ".
-       "custnum ". $self->custnum. "\n";
+       "custnum ". $self->custnum. "\n"
+    if $DEBUG;
   $self->cust_linked
     ? FS::cust_main::invoicing_list_emailonly($self)
     : $self->cust_unlinked_msg;
 }
 
+=item invoicing_list_emailonly_scalar
+
+Given an object that contains fields from cust_main (say, from a JOINed
+search; see httemplate/search/ for examples), returns the equivalent of the
+FS::cust_main I<invoicing_list_emailonly_scalar> method, or "(unlinked)" if
+this object is not linked to a customer.
+
+=cut
+
+sub invoicing_list_emailonly_scalar {
+  my $self = shift;
+  warn "invoicing_list_email only called on $self, ".
+       "custnum ". $self->custnum. "\n"
+    if $DEBUG;
+  $self->cust_linked
+    ? FS::cust_main::invoicing_list_emailonly_scalar($self)
+    : $self->cust_unlinked_msg;
+}
+
+=item invoicing_list
+
+Given an object that contains fields from cust_main (say, from a JOINed
+search; see httemplate/search/ for examples), returns the equivalent of the
+FS::cust_main I<invoicing_list> method, or "(unlinked)" if this object is not
+linked to a customer.
+
+Note: this method is read-only.
+
+=cut
+
 #read-only
 sub invoicing_list {
   my $self = shift;

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -d -r1.264 -r1.265
--- cust_main.pm	23 Jan 2007 23:42:59 -0000	1.264
+++ cust_main.pm	29 Jan 2007 16:01:22 -0000	1.265
@@ -61,7 +61,7 @@
 # 1 is mostly method/subroutine entry and options
 # 2 traces progress of some operations
 # 3 is even more information including possibly sensitive data
-$DEBUG = 0;
+$DEBUG = 1;
 $me = '[FS::cust_main]';
 
 $import = 0;
@@ -3539,9 +3539,25 @@
 
 sub invoicing_list_emailonly {
   my $self = shift;
+  warn "$me invoicing_list_emailonly called"
+    if $DEBUG;
   grep { $_ !~ /^([A-Z]+)$/ } $self->invoicing_list;
 }
 
+=item invoicing_list_emailonly_scalar
+
+Returns the list of email invoice recipients (invoicing_list without non-email
+destinations such as POST and FAX) as a comma-separated scalar.
+
+=cut
+
+sub invoicing_list_emailonly_scalar {
+  my $self = shift;
+  warn "$me invoicing_list_emailonly_scalar called"
+    if $DEBUG;
+  join(', ', $self->invoicing_list_emailonly);
+}
+
 =item referral_cust_main [ DEPTH [ EXCLUDE_HASHREF ] ]
 
 Returns an array of customers referred by this customer (referral_custnum set



More information about the freeside-commits mailing list