[freeside-commits] branch master updated. f619b706a2b375b5ef29fa3664eb3da90bb90ef5

Ivan ivan at 420.am
Tue Jul 3 02:34:07 PDT 2012


The branch, master has been updated
       via  f619b706a2b375b5ef29fa3664eb3da90bb90ef5 (commit)
      from  dae45b800de33e67dd8836b4dbb57df7595b03b5 (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 f619b706a2b375b5ef29fa3664eb3da90bb90ef5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jul 3 02:34:04 2012 -0700

    add advertising source to customer accounting summary, RT#18349

diff --git a/httemplate/search/customer_accounting_summary.html b/httemplate/search/customer_accounting_summary.html
index 8da8914..72a00ed 100644
--- a/httemplate/search/customer_accounting_summary.html
+++ b/httemplate/search/customer_accounting_summary.html
@@ -30,6 +30,19 @@ elsif ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
   die "agentnum $agentnum not found!" unless $sel_agent;
 }
 my $title = $sel_agent ? $sel_agent->agent.' ' : '';
+
+my ($refnum,$sel_part_referral);
+#if ( $cgi->param('refnum') eq 'all' ) {
+#  $refnum = 0;
+#} els
+if ( $cgi->param('refnum') =~ /^(\d+)$/ ) {
+  $refnum = $1;
+  $sel_part_referral = qsearchs('part_referral', { 'refnum' => $refnum } );
+  die "refnum $refnum not found!" unless $sel_part_referral;
+}
+$title .=  $sel_part_referral->referral.' '
+  if $sel_part_referral;
+
 $title .= 'Customer Accounting Summary Report';
 
 my @custs = ();
@@ -45,6 +58,7 @@ die "invalid status" unless $status =~ /^\w+|$/;
 foreach my $cust_main ( @custs ) {
   next unless ($status eq '' || $status eq $cust_main->status); 
   next unless ($agentnum == 0 || $cust_main->agentnum eq $agentnum);
+  next unless ($refnum   == 0 || $cust_main->refnum eq $refnum);
 
   push @items, 'netsales', 'cashflow';
 
diff --git a/httemplate/search/report_customer_accounting_summary.html b/httemplate/search/report_customer_accounting_summary.html
index d20f756..f2a13a2 100755
--- a/httemplate/search/report_customer_accounting_summary.html
+++ b/httemplate/search/report_customer_accounting_summary.html
@@ -11,6 +11,14 @@
              )
     %>
 
+    <% include( '/elements/tr-select-part_referral.html',
+                 'curr_value'    => scalar( $cgi->param('refnum') ),
+                 'label'         => 'Advertising source ',
+                 'disable_empty' => 0,
+                 'empty_label'   => 'all',
+             )
+    %>
+
     <% include('/elements/tr-select-from_to.html' ) %>
     
     <% include( '/elements/tr-select-cust_main-status.html',

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

Summary of changes:
 httemplate/search/customer_accounting_summary.html |   14 ++++++++++++++
 .../search/report_customer_accounting_summary.html |    8 ++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)




More information about the freeside-commits mailing list