X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_tax.cgi;h=410fe46039135f45403deb9bf554a23afba81021;hb=a989f40712bcbef325a566802118432063315240;hp=ac76fad6e7ad50c2add0f8cb6a34a41cda96cb97;hpb=eb9668a6f3181ee02cb335272c5ee4616e61fd09;p=freeside.git diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi old mode 100755 new mode 100644 index ac76fad6e..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 '