X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FReport%2FTable.pm;fp=FS%2FFS%2FReport%2FTable.pm;h=479747307f537db8871355eef90c1aab7bbe65d0;hp=69686df9b12febcba0805cf3a8dd1b9489c9a9a5;hb=1ac6983f11ce30a2196ef5e44c051a34c776831f;hpb=4bbd2db7a016d9da19f1524895e3d04c3abf89a4 diff --git a/FS/FS/Report/Table.pm b/FS/FS/Report/Table.pm index 69686df9b..479747307 100644 --- a/FS/FS/Report/Table.pm +++ b/FS/FS/Report/Table.pm @@ -495,12 +495,17 @@ sub _cust_bill_pkg_recurring { my @where = ( '(pkgnum != 0 OR feepart IS NOT NULL)', - $self->with_classnum($opt{'classnum'}, $opt{'use_override'}), $self->with_report_option(%opt), $self->with_refnum(%opt), $self->with_cust_classnum(%opt) ); + my $where_classnum = $self->with_classnum($opt{'classnum'}, $opt{'use_override'}); + if ($opt{'project'}) { + $where_classnum =~ s/\bcust_bill_pkg/v_cust_bill_pkg/g; + } + push @where, $where_classnum; + if ( $opt{'distribute'} ) { $where[0] = 'pkgnum != 0'; # specifically exclude fees push @where, "cust_main.agentnum = $agentnum" if $agentnum;