[freeside-commits] branch master updated. 2124062154b8716e2d75264f9a6254b596052df6

Mark Wells mark at 420.am
Wed Jan 27 03:16:39 PST 2016


The branch, master has been updated
       via  2124062154b8716e2d75264f9a6254b596052df6 (commit)
       via  6048d99b43a9ecba680c1075554d285db8056664 (commit)
      from  4da3c98f2f021ac48b195dd205bdbb85dc5b58b9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2124062154b8716e2d75264f9a6254b596052df6
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Jan 27 02:50:56 2016 -0800

    show customer email on commission credit detail reports, #40033

diff --git a/httemplate/search/cust_credit.html b/httemplate/search/cust_credit.html
index 7738494..2241f02 100755
--- a/httemplate/search/cust_credit.html
+++ b/httemplate/search/cust_credit.html
@@ -56,33 +56,57 @@ if ($unapplied) {
 push @header, emt('Date'), 
               emt('By'),
               emt('Reason'),
-              FS::UI::Web::cust_header(),
               ;
 push @fields, sub { time2str('%b %d %Y', shift->_date ) },
               'otaker',
               'reason',
-              \&FS::UI::Web::cust_fields,
               ;
-push @sort_fields, '_date', 'otaker', 'reason', FS::UI::Web::cust_sort_fields();
-$align .= 'rll'.FS::UI::Web::cust_aligns();
+push @sort_fields, '_date', 'otaker', 'reason';
+$align .= 'rll';
 push @links,  '',
               '',
               '',
-              ( map { $_ ne 'Cust. Status' ? $clink : '' }
-                         FS::UI::Web::cust_header()
-                   ),
               ;
 push @color,  '',
               '',
               '',
-              FS::UI::Web::cust_colors(),
               ;
 push @style,  '',
               '',
               '',
-              FS::UI::Web::cust_styles(),
               ;
 
+# insert customer email after 'Reason' if this is a commission report
+if ( $cgi->param('commission_salesnum') or $cgi->param('commission_agentnum') ) {
+  my $sub_customer_email = sub {
+    my $cust_credit = shift;
+    my $cust_event = $cust_credit->cust_event or return '';
+    my $cust_X = $cust_event->cust_X or return '';
+    my $cust_main = $cust_X->cust_main or return '';
+    my ($email) = $cust_main->invoicing_list_emailonly;
+    return encode_entities("<$email>") if length($email);
+    '';
+  };
+  push @header, '';
+  push @fields, $sub_customer_email;
+  push @sort_fields, '';
+  $align .= 'l';
+  push @links, '';
+  push @color, '';
+  push @style, '';
+}
+
+# cust fields
+push @header, FS::UI::Web::cust_header();
+push @fields, \&FS::UI::Web::cust_fields;
+push @sort_fields, FS::UI::Web::cust_sort_fields;
+$align .= FS::UI::Web::cust_aligns();
+push @links, map { $_ ne 'Cust. Status' ? $clink : '' }
+                         FS::UI::Web::cust_header();
+push @color, FS::UI::Web::cust_colors();
+push @style, FS::UI::Web::cust_styles();
+
+
 my @search = ();
 my $addl_from = '';
 

commit 6048d99b43a9ecba680c1075554d285db8056664
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Jan 27 02:49:14 2016 -0800

    use Commission_Mixin, #23348

diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm
index a3489f0..4ad878d 100644
--- a/FS/FS/agent.pm
+++ b/FS/FS/agent.pm
@@ -1,5 +1,5 @@
 package FS::agent;
-use base qw( FS::m2m_Common FS::m2name_Common FS::Record );
+use base qw( FS::Commission_Mixin FS::m2m_Common FS::m2name_Common FS::Record );
 
 use strict;
 use vars qw( @ISA );

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/agent.pm                     |    2 +-
 httemplate/search/cust_credit.html |   42 ++++++++++++++++++++++++++++--------
 2 files changed, 34 insertions(+), 10 deletions(-)




More information about the freeside-commits mailing list