summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/cust_bill_pkg.pm6
-rw-r--r--httemplate/search/cust_bill_pkg.cgi2
2 files changed, 4 insertions, 4 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index f196a0a22..6551ca829 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -1082,9 +1082,9 @@ and 'setuprecur' (set to "setup" or "recur" to limit to one or the other).
sub owed_sql {
my ($class, $start, $end, %opt) = @_;
my $charged =
- $opt{setuprecur} =~ /^s/ ? 'setup' :
- $opt{setuprecur} =~ /^r/ ? 'recur' :
- 'setup + recur';
+ $opt{setuprecur} =~ /^s/ ? 'cust_bill_pkg.setup' :
+ $opt{setuprecur} =~ /^r/ ? 'cust_bill_pkg.recur' :
+ 'cust_bill_pkg.setup + cust_bill_pkg.recur';
if ( $opt{no_usage} ) {
$charged .= ' - ' . $class->usage_sql;
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index fd215969a..a84f981e3 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -511,7 +511,7 @@ if ( $cgi->param('pkg_tax') ) {
if ( $unearned ) {
$count_query .= "SUM( $unearned_base ), SUM( $unearned_sql )";
} elsif ( $use_usage eq 'recurring' ) {
- $count_query .= "SUM(setup + recur - usage)";
+ $count_query .= "SUM(cust_bill_pkg.setup + cust_bill_pkg.recur - usage)";
} elsif ( $use_usage eq 'usage' ) {
$count_query .= "SUM(usage)";
} elsif ( scalar( grep( /locationtaxid/, $cgi->param ) ) ) {