[freeside-commits] branch master updated. ce9a9630a2232dafc952bdaadb627fcc3a5558f9

Jonathan Prykop jonathan at 420.am
Mon Feb 16 18:03:46 PST 2015


The branch, master has been updated
       via  ce9a9630a2232dafc952bdaadb627fcc3a5558f9 (commit)
      from  5cb958cb932ef9582e9b0e542de280f2bf26197c (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 ce9a9630a2232dafc952bdaadb627fcc3a5558f9
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Mon Feb 16 20:02:30 2015 -0600

    RT#23598: Feature Request - Email notice to A/R Report Results

diff --git a/httemplate/search/elements/cust_main_dayranges.html b/httemplate/search/elements/cust_main_dayranges.html
index 5dbece8..73a429f 100644
--- a/httemplate/search/elements/cust_main_dayranges.html
+++ b/httemplate/search/elements/cust_main_dayranges.html
@@ -5,6 +5,7 @@ Example:
   <& elements/cust_main_dayranges.html,
                  'title'       => 'Accounts Receivable Aging Summary',
                  'range_sub'   => $mysub,
+                 'email_link'  => 1,  #adds an action column with an email link if true
   &>
 
   my $mysub = sub {
@@ -27,6 +28,7 @@ Example:
                                     '90+',
                                     emt('Total'),
                                     @pay_head,
+                                    @act_header,
                                   ],
                  'footer'      => [
                                     'Total',
@@ -42,6 +44,7 @@ Example:
                                     sprintf( '<b>'.$money_char.'%.2f</b>',
                                              $row->{'rangecol_0_0'} ),
                                     ('') x @pay_labels,
+                                    @act_blank,
                                   ],
                  'fields'      => [
                                     FS::UI::Web::cust_fields_subs(),
@@ -51,6 +54,7 @@ Example:
                                     format_rangecol('90_0'),
                                     format_rangecol('0_0'),
                                     @pay_labels,
+                                    @act_fields,
                                   ],
                  'links'       => [
                                     ( map { $_ ne 'Cust. Status' ? $clink : '' }
@@ -62,22 +66,32 @@ Example:
                                     '',
                                     '',
                                     @pay_links,
+                                    @act_blank,
                                   ],
+                 'link_onclicks' => [ ( map '', @cust_header ),
+                                      '', '', '', '', '', 
+                                      ( map '', @pay_labels ),
+                                      @act_link_onclicks,
+                                    ],
                  'align'       => FS::UI::Web::cust_aligns(). 
                                    'rrrrr'.
                                   ('c' x @pay_labels),
+                                  @act_align,
                  'size'        => [ ( map '', @cust_header ),
                                     #'-1', '', '', '', '',  '', ],
                                     '', '', '', '', '',  '', 
                                     ( map '', @pay_labels ),
+                                    @act_blank,
                                     ],
                  'style'       => [ FS::UI::Web::cust_styles(),
                                     #'b', '', '', '', '', 'b', ],
                                     '', '', '', '', 'b', 
                                     ( map '', @pay_labels ),
+                                    @act_blank,
                                     ],
                  'xls_format'  => [ (map '', FS::UI::Web::cust_styles),
                                     '', '', '', '', { bold => 1 },
+                                    @act_blank,
                                   ],
                  'color'       => [
                                     FS::UI::Web::cust_colors(),
@@ -88,6 +102,7 @@ Example:
                                     '',
                                     '',
                                     ( map '', @pay_labels ),
+                                    @act_blank,
                                   ],
                %opt,
 &>
@@ -235,6 +250,19 @@ if($opt{'payment_links'} && $curuser->access_right('Process payment') && @payby)
                          @payby );
 }
 
+my (@act_header, @act_fields, @act_link_onclicks, @act_align, @act_blank);
+if (delete($opt{'email_links'})) {
+  push @act_header, 'Actions';
+  push @act_fields, sub { 'send email' };
+  push @act_link_onclicks, sub {
+    my $row = shift;
+    my $custnum = $row->custnum;
+    return qq!window.open('${p}misc/email-customers.html?table=cust_main&custnum=$custnum','_blank')!;
+  };
+  push @act_align, 'l';
+  push @act_blank, '';
+}
+
 </%init>
 <%once>
 
diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi
index 9c5c0e2..bca2a05 100755
--- a/httemplate/search/report_receivables.cgi
+++ b/httemplate/search/report_receivables.cgi
@@ -2,6 +2,7 @@
                  'title'       => emt('Accounts Receivable Aging Summary'),
                  'range_sub'   => \&balance,
                  'payment_links' => 1,
+                 'email_links' => 1,
 &>
 <%init>
 

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

Summary of changes:
 .../search/elements/cust_main_dayranges.html       |   28 ++++++++++++++++++++
 httemplate/search/report_receivables.cgi           |    1 +
 2 files changed, 29 insertions(+)




More information about the freeside-commits mailing list