projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
httemplate
/
search
/
cust_tax_exempt_pkg.cgi
diff --git
a/httemplate/search/cust_tax_exempt_pkg.cgi
b/httemplate/search/cust_tax_exempt_pkg.cgi
index
3a5155a
..
40b9ed7
100644
(file)
--- a/
httemplate/search/cust_tax_exempt_pkg.cgi
+++ b/
httemplate/search/cust_tax_exempt_pkg.cgi
@@
-1,4
+1,4
@@
-<
% include( 'elements/search.html'
,
+<
& elements/search.html
,
'title' => 'Tax exemptions',
'name' => 'tax exemptions',
'query' => $query,
'title' => 'Tax exemptions',
'name' => 'tax exemptions',
'query' => $query,
@@
-77,14
+77,12
@@
'',
FS::UI::Web::cust_styles(),
],
'',
FS::UI::Web::cust_styles(),
],
- )
-%>
+&>
<%once>
my $join_cust = "
<%once>
my $join_cust = "
- JOIN cust_bill USING ( invnum )
- LEFT JOIN cust_main USING ( custnum )
-";
+ JOIN cust_bill USING ( invnum )" .
+ FS::UI::Web::join_cust_main('cust_bill', 'cust_pkg');
my $join_pkg = "
LEFT JOIN cust_pkg USING ( pkgnum )
my $join_pkg = "
LEFT JOIN cust_pkg USING ( pkgnum )
@@
-93,8
+91,8
@@
my $join_pkg = "
my $join = "
JOIN cust_bill_pkg USING ( billpkgnum )
my $join = "
JOIN cust_bill_pkg USING ( billpkgnum )
- $join_cust
$join_pkg
$join_pkg
+ $join_cust
";
</%once>
";
</%once>
@@
-103,7
+101,7
@@
my $join = "
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('View customer tax exemptions');
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('View customer tax exemptions');
-my @where = ();
+my @where = (
"exempt_monthly = 'Y'"
);
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
if ( $beginning || $ending ) {
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
if ( $beginning || $ending ) {
@@
-121,6
+119,7
@@
if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
}
if ( $cgi->param('out') ) {
}
if ( $cgi->param('out') ) {
+ # wtf? how would you ever get exemptions on a non-taxable package location?
push @where, "
0 = (
push @where, "
0 = (
@@
-151,6
+150,11
@@
if ( $cgi->param('out') ) {
push @where, 'taxclass = '. dbh->quote( $cgi->param('taxclass') )
if $cgi->param('taxclass');
push @where, 'taxclass = '. dbh->quote( $cgi->param('taxclass') )
if $cgi->param('taxclass');
+} elsif ( $cgi->param('taxnum') ) {
+
+ my $taxnum_in = join(',', grep /^\d+$/, $cgi->param('taxnum') );
+ push @where, "taxnum IN ($taxnum_in)" if $taxnum_in;
+
}
my $where = scalar(@where) ? 'WHERE '.join(' AND ', @where) : '';
}
my $where = scalar(@where) ? 'WHERE '.join(' AND ', @where) : '';