-<% include( 'elements/search.html',
+<& elements/search.html,
'title' => 'Package discounts',
'name' => 'discounts',
'query' => $query,
'',
FS::UI::Web::cust_styles(),
],
- )
-%>
+
+&>
<%init>
die "access denied"
"; #XXX also end date
}
-#otaker
-if ( $cgi->param('otaker') && $cgi->param('otaker') =~ /^([\w\.\-]+)$/ ) {
- push @where, "cust_pkg_discount.otaker = '$1'";
+#usernum
+if ( $cgi->param('usernum') =~ /^(\d+)$/ ) {
+ push @where, "cust_pkg_discount.usernum = $1";
}
#agent
my $join = ' LEFT JOIN discount USING ( discountnum )
LEFT JOIN cust_pkg USING ( pkgnum )
- LEFT JOIN part_pkg USING ( pkgpart )
- LEFT JOIN cust_main USING ( custnum ) ';
+ LEFT JOIN part_pkg USING ( pkgpart ) '.
+ FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg');
my $where = ' WHERE '. join(' AND ', @where);