1 <% include( 'elements/search.html',
3 'name_singular' => 'tax adjustment',
5 'count_query' => $count_query,
6 'header' => [ 'Tax', 'Amount', 'Comment', 'Invoice' ],
7 'fields' => [ 'taxname',
8 sub { $money_char. shift->amount },
10 sub { my $l = shift->cust_bill_pkg;
11 $l ? '#'.$l->invnum : '';
14 'links' => [ '', '', '', $ilink ],
21 unless $FS::CurrentUser::CurrentUser->access_right('Add customer tax adjustment');
23 my $conf = new FS::Conf;
24 my $money_char = $conf->config('money_char') || '$';
26 my $count_query = 'SELECT COUNT(*) FROM cust_tax_adjustment';
32 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
34 $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
35 $hashref->{'custnum'} = $custnum;
36 $count_query .= " WHERE custnum = $custnum ";
39 my $title = 'Tax adjustments';
40 $title .= ' for '. $cust_main->name if $cust_main;
42 my $query = { 'table' => 'cust_tax_adjustment',
43 'hashref' => $hashref,
46 my $ilink = [ $p.'view/cust_bill.cgi?', sub { my $l = shift->cust_bill_pkg;
47 $l ? $l->invnum : 'EXCEPTION';
51 #XXX would be nice to list customer fields on the report too, if we ever need
52 # to link to here without a custnum (i'm sure we will, eventually...)