$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
$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'} ) {
my @where = ( "cust_bill_pkg.pkgnum != 0" );
+ push @where, 'cust_main.refnum = '. $opt{'refnum'} if $opt{'refnum'};
+
$agentnum ||= $opt{'agentnum'};
push @where,