X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_tax.cgi;h=410fe46039135f45403deb9bf554a23afba81021;hb=7118f8f027744b31c87444da0a47de3b1daa5da2;hp=79aa65c9a55fa3b47a44d2828b1e8c158b27ce6c;hpb=b717ff208f1593bc7d2021f17fbb63006e66e6ef;p=freeside.git diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi old mode 100755 new mode 100644 index 79aa65c9a..410fe4603 --- a/httemplate/search/report_tax.cgi +++ b/httemplate/search/report_tax.cgi @@ -1,25 +1,382 @@ - -<% +<& /elements/header.html, $report->title &> +
'; -while('; -print ') { - print $_; +my $conf = new FS::Conf; + +my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi); + +my %params = ( + beginning => $beginning, + ending => $ending, +); +$params{debug} = $DEBUG; +my $agentname; + +# filter by agentnum +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + my $agent = FS::agent->by_key($1) or die "unknown agentnum $1"; + $params{agentnum} = $1; + $agentname = $agent->agentname; +} + +# credit date behavior: limit by the date of the credit application, or +# the invoice? +if ( $cgi->param('credit_date') eq 'cust_credit_bill' ) { + $params{credit_date} = 'cust_credit_bill'; +} else { + $params{credit_date} = 'cust_bill'; } -print '