sales by ad source report: filter by ad source, #17971
authorMark Wells <mark@freeside.biz>
Thu, 2 Aug 2012 22:54:31 +0000 (15:54 -0700)
committerMark Wells <mark@freeside.biz>
Thu, 2 Aug 2012 22:54:31 +0000 (15:54 -0700)
httemplate/elements/tr-select-part_referral.html
httemplate/search/cust_bill_pkg_referral.html
httemplate/search/report_cust_bill_pkg_referral.html

index 765aa84..5041f7f 100644 (file)
      <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'refnum' %>" VALUE="<% $opt{'part_referrals'}->[0]->refnum %>">
 
 % } else { 
-
-     <TR>
-%      if ( $opt{'label'} ) {
-         <TD ALIGN="right"><% $opt{'label'} %></TD>
-%      } else {
-         <TH ALIGN="right"><%$r%><% mt('Advertising source') |h %></TH>
-%      }
+     <& /elements/tr-td-label.html, label => 'Advertising source', %opt &>
        <TD COLSPAN="<% $colspan %>">
          <& /elements/select-part_referral.html,
                        'curr_value' => $refnum,
index 3cb434c..77b4860 100644 (file)
@@ -146,6 +146,16 @@ if ( @status_where ) {
     ') IN (' . join(',', @status_where) .')';
 }
 
+my @refnum;
+foreach my $refnum ($cgi->param('refnum')) {
+  if ( $refnum =~ /^\d+$/ ) {
+    push @refnum, $refnum;
+  }
+}
+if ( @refnum ) {
+  push @where, 'cust_main.refnum IN ('.join(',', @refnum).')';
+}
+
 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
   push @where, "cust_main.agentnum = $1";
 }
index ff2caa1..b4716d4 100644 (file)
   'disable_empty' => 1,
 &>
 
+<& /elements/tr-select-part_referral.html,
+  'multiple'      => 1,
+  'disable_empty' => 1,
+&>
+
 <& /elements/tr-select-pkg_class.html,
   'pre_options' => [ '' => 'all', '0' => '(empty class)' ],
   'disable_empty' => 1,