- classnum: Filter on package class.
+- report_optionnum: Filter on package report class. Can be a single report
+ class number, a comma-separated list, the word "multiple", or an empty
+ string (for "no report class").
+
- use_override: Apply "classnum" and "taxclass" filtering based on the
override (bundle) pkgpart, rather than always using the true pkgpart.
@currency_sub = (
map {
my $what = $_;
- sub { my $currency = $_[0]->get($what.'_billed_currency');
+ sub { my $currency = $_[0]->get($what.'_billed_currency') or return '';
$currency. ' '. currency_symbol($currency, SYM_HTML).
$_[0]->get($what.'_billed_amount');
};
push @where, "cust_main.agentnum = $1";
}
+# salesnum
+if ( $cgi->param('salesnum') =~ /^(\d+)$/ ) {
+
+ my $salesnum = $1;
+
+ my $cmp_salesnum = $cgi->param('cust_main_sales')
+ ? ' COALESCE( cust_pkg.salesnum, cust_main.salesnum )'
+ : ' cust_pkg.salesnum ';
+
+ push @where, "$cmp_salesnum = $salesnum";
+
+ $cgi->param('classnum', 0) unless $cgi->param('classnum');
+}
+
# refnum
if ( $cgi->param('refnum') =~ /^(\d+)$/ ) {
push @where, "cust_main.refnum = $1";
push @where, "COALESCE($part_pkg.classnum, 0) = $1";
}
+ if ( $cgi->param('report_optionnum') =~ /^(\w+)$/ ) {
+ # code reuse FTW
+ my $num = $1;
+ push @where,
+ FS::Report::Table->with_report_option( $1, $cgi->param('use_override') )
+ ;
+ }
+
# taxclass
if ( $cgi->param('taxclassNULL') ) {
# a little different from 'taxclass' in that it applies to the