doc
[freeside.git] / httemplate / search / cust_bill_pkg.cgi
index bf73d74..7ed320f 100644 (file)
@@ -283,6 +283,24 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
   push @where, "cust_main.agentnum = $1";
 }
 
+# salesnum
+if ( $cgi->param('salesnum') =~ /^(\d+)$/ ) {
+
+  my $salesnum = $1;
+
+  my $cmp_salesnum = $cgi->param('cust_main_sales')
+                       ? ' COALESCE( cust_pkg.salesnum, cust_main.salesnum )'
+                       : ' cust_pkg.salesnum ';
+
+  push @where, "$cmp_salesnum = $salesnum";
+
+  #because currently we're called from sales_pkg_class.html for a specific
+  # class (or empty class) but not for all classes
+  #will have to do something to distinguish if someone wants the sales report
+  # (report_cust_bill_pkg.html) to have a sales person dropdown
+  $cgi->param('classnum', 0) unless $cgi->param('classnum');
+}
+
 # refnum
 if ( $cgi->param('refnum') =~ /^(\d+)$/ ) {
   push @where, "cust_main.refnum = $1";