Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Sat, 5 Jan 2013 22:49:44 +0000 (14:49 -0800)
committerIvan Kohler <ivan@freeside.biz>
Sat, 5 Jan 2013 22:49:44 +0000 (14:49 -0800)
1  2 
httemplate/search/cust_bill_pkg.cgi

@@@ -120,6 -120,8 +120,8 @@@ Filtering parameters
  
  - refnum: Filter on customer reference source.
  
+ - cust_classnum: Filter on customer class.
  - classnum: Filter on package class.
  
  - use_override: Apply "classnum" and "taxclass" filtering based on the 
@@@ -189,7 -191,7 +191,7 @@@ my $money_char = $conf->config('money_c
  
  my @select = ( 'cust_bill_pkg.*', 'cust_bill._date' );
  my @total = ( 'COUNT(*)', 'SUM(cust_bill_pkg.setup + cust_bill_pkg.recur)');
 -my @total_desc = ( '%d line items', $money_char.'%.2f total' ); # sprintf strings
 +my @total_desc = ( $money_char.'%.2f total' ); # sprintf strings
  
  my @peritem = ( 'setup', 'recur' );
  my @peritem_desc = ( 'Setup charge', 'Recurring charge' );
@@@ -258,6 -260,13 +260,13 @@@ if ( $cgi->param('refnum') =~ /^(\d+)$
    push @where, "cust_main.refnum = $1";
  }
  
+ # cust_classnum
+ if ( $cgi->param('cust_classnum') ) {
+   my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+   push @where, 'cust_main.classnum IN('.join(',',@classnums).')'
+     if @classnums;
+ }
  # custnum
  if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
    push @where, "cust_main.custnum = $1";
@@@ -443,7 -452,7 +452,7 @@@ if ( $cgi->param('nottax') ) 
      push @select, "($recur_no_usage) AS recur_no_usage";
      $peritem[1] = 'recur_no_usage';
      $total[1] = "SUM(cust_bill_pkg.setup + $recur_no_usage)";
 -    $total_desc[1] .= ' (excluding usage)';
 +    $total_desc[0] .= ' (excluding usage)';
  
    } elsif ( $cgi->param('usage') eq 'usage' ) {
  
      $peritem[1] = '_usage';
      $peritem_desc[1] = 'Usage charge';
      $total[1] = "SUM($usage)";
 -    $total_desc[1] .= ' usage charges';
 +    $total_desc[0] .= ' usage charges';
    }
  
  } elsif ( $cgi->param('istax') ) {
@@@ -650,6 -659,8 +659,6 @@@ my $count_query 
    " FROM cust_bill_pkg $join_cust $join_pkg
    $where";
  
 -shift @total_desc; #the first one is implicit
 -
  @peritem_desc = map {emt($_)} @peritem_desc;
  my @peritem_sub = map {
    my $field = $_;