1 <& 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 ],
20 unless $FS::CurrentUser::CurrentUser->access_right('Add customer tax adjustment');
22 my $conf = new FS::Conf;
23 my $money_char = $conf->config('money_char') || '$';
25 my $count_query = 'SELECT COUNT(*) FROM cust_tax_adjustment';
31 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
33 $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
34 $hashref->{'custnum'} = $custnum;
35 $count_query .= " WHERE custnum = $custnum ";
38 my $title = 'Tax adjustments';
39 $title .= ' for '. $cust_main->name if $cust_main;
41 my $query = { 'table' => 'cust_tax_adjustment',
42 'hashref' => $hashref,
45 my $ilink = [ $p.'view/cust_bill.cgi?', sub { my $l = shift->cust_bill_pkg;
46 $l ? $l->invnum : 'EXCEPTION';
50 #XXX would be nice to list customer fields on the report too, if we ever need
51 # to link to here without a custnum (i'm sure we will, eventually...)