diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2012-07-03 02:26:30 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2012-07-03 02:26:30 -0700 |
| commit | 5e26eb34ecbc90724b4d2894f20049d01f90f013 (patch) | |
| tree | 35cabeda77d4c188d53e1dcb49f56961a3a01cb0 /FS | |
| parent | e6c63380905a96364738715cfb59e408f17fb775 (diff) | |
add advertising source to sales report, RT#18349
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/Report/Table.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/FS/FS/Report/Table.pm b/FS/FS/Report/Table.pm index b0e911f84..e1aec0592 100644 --- a/FS/FS/Report/Table.pm +++ b/FS/FS/Report/Table.pm @@ -416,6 +416,8 @@ sub cust_bill_pkg_setup { $self->in_time_period_and_agent($speriod, $eperiod, $agentnum), ); + push @where, 'cust_main.refnum = '. $opt{'refnum'} if $opt{'refnum'}; + my $total_sql = "SELECT COALESCE(SUM(cust_bill_pkg.setup),0) FROM cust_bill_pkg $cust_bill_pkg_join @@ -436,6 +438,8 @@ sub cust_bill_pkg_recur { $self->with_classnum($opt{'classnum'}, $opt{'use_override'}), ); + push @where, 'cust_main.refnum = '. $opt{'refnum'} if $opt{'refnum'}; + # subtract all usage from the line item regardless of date my $item_usage; if ( $opt{'project'} ) { @@ -489,6 +493,8 @@ sub cust_bill_pkg_detail { my @where = ( "cust_bill_pkg.pkgnum != 0" ); + push @where, 'cust_main.refnum = '. $opt{'refnum'} if $opt{'refnum'}; + $agentnum ||= $opt{'agentnum'}; push @where, |
