X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_tax.cgi;h=918383b6743c891aeeb17a63a6ceb2290cc6e836;hb=587f0384fb03179f6b504daeada93e193d2ea27f;hp=1b6f40b8a0b7f73b630fbb6379af2a013c063aa7;hpb=c363307c1af959dce2ab4821ff5dfa697e3f0e19;p=freeside.git diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi index 1b6f40b8a..918383b67 100755 --- a/httemplate/search/report_tax.cgi +++ b/httemplate/search/report_tax.cgi @@ -1,4 +1,173 @@ -<% +<% include("/elements/header.html", "$agentname Sales Tax Report - ". + ( $beginning + ? time2str('%h %o %Y ', $beginning ) + : '' + ). + 'through '. + ( $ending == 4294967295 + ? 'now' + : time2str('%h %o %Y', $ending ) + ), + menubar( 'Main Menu'=>$p, ) + ) +%> + +<% include('/elements/table-grid.html') %> + + + + Sales + + Rate + + Tax owed +% unless ( $cgi->param('show_taxclasses') ) { + + Tax invoiced +% } + + + + Total + + Non-taxable
(tax-exempt customer) + + Non-taxable
(tax-exempt package) + + Non-taxable
(monthly exemption) + + Taxable + +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor; +% +% foreach my $region ( @regions ) { +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% +% my $link = ''; +% if ( $region->{'label'} ne 'Total' ) { +% if ( $region->{'label'} eq $out ) { +% $link = ';out=1'; +% } else { +% $link = ';'. $region->{'url_param'}; +% } +% } +% +% +% +% +% + + + + <% $region->{'label'} %> + + <% $money_char %><% sprintf('%.2f', $region->{'total'} ) %> + + - + + <% $money_char %><% sprintf('%.2f', $region->{'exempt_cust'} ) %> + + - + + <% $money_char %><% sprintf('%.2f', $region->{'exempt_pkg'} ) %> + + - + + <% $money_char %><% sprintf('%.2f', $region->{'exempt_monthly'} ) %> + + = + + <% $money_char %><% sprintf('%.2f', $region->{'taxable'} ) %> + + <% $region->{'label'} eq 'Total' ? '' : ' X ' %> + <% $region->{'rate'} %> + <% $region->{'label'} eq 'Total' ? '' : ' = ' %> + + <% $money_char %><% sprintf('%.2f', $region->{'owed'} ) %> + +% unless ( $cgi->param('show_taxclasses') ) { + + + <% $money_char %><% sprintf('%.2f', $region->{'tax'} ) %> + +% } + + +% } + + + +% if ( $cgi->param('show_taxclasses') ) { + + +
+ <% include('/elements/table-grid.html') %> + + + Tax invoiced + +% #some false laziness w/above +% $bgcolor1 = '#eeeeee'; +% $bgcolor2 = '#ffffff'; +% foreach my $region ( @base_regions ) { +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% +% my $link = ''; +% #if ( $region->{'label'} ne 'Total' ) { +% if ( $region->{'label'} eq $out ) { +% $link = ';out=1'; +% } else { +% $link = ';'. $region->{'url_param'}; +% } +% #} +% + + + + <% $region->{'label'} %> + + <% $money_char %><% sprintf('%.2f', $region->{'tax'} ) %> + + +% } +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% + + + + Total + + <% $money_char %><% sprintf('%.2f', $tax ) %> + + + + +% } + + + + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; @@ -359,180 +528,12 @@ sub scalar_sql { $sth->fetchrow_arrayref->[0] || 0; } -%> -<% + my $dateagentlink = "begin=$beginning;end=$ending"; $dateagentlink .= ';agentnum='. $cgi->param('agentnum') if length($agentname); my $baselink = $p. "search/cust_bill_pkg.cgi?$dateagentlink"; my $exemptlink = $p. "search/cust_tax_exempt_pkg.cgi?$dateagentlink"; -%> - -<%= include("/elements/header.html", "$agentname Sales Tax Report - ". - ( $beginning - ? time2str('%h %o %Y ', $beginning ) - : '' - ). - 'through '. - ( $ending == 4294967295 - ? 'now' - : time2str('%h %o %Y', $ending ) - ), - menubar( 'Main Menu'=>$p, ) - ) -%> - -<%= include('/elements/table-grid.html') %> - - - - Sales - - Rate - - Tax owed - <% unless ( $cgi->param('show_taxclasses') ) { %> - Tax invoiced - <% } %> - - - Total - - Non-taxable
(tax-exempt customer) - - Non-taxable
(tax-exempt package) - - Non-taxable
(monthly exemption) - - Taxable - - -<% my $bgcolor1 = '#eeeeee'; - my $bgcolor2 = '#ffffff'; - my $bgcolor; -%> - - <% foreach my $region ( @regions ) { - - if ( $bgcolor eq $bgcolor1 ) { - $bgcolor = $bgcolor2; - } else { - $bgcolor = $bgcolor1; - } - - my $link = ''; - if ( $region->{'label'} ne 'Total' ) { - if ( $region->{'label'} eq $out ) { - $link = ';out=1'; - } else { - $link = ';'. $region->{'url_param'}; - } - } - - - - - %> - - - <%= $region->{'label'} %> - - <%= $money_char %><%= sprintf('%.2f', $region->{'total'} ) %> - - - - - <%= $money_char %><%= sprintf('%.2f', $region->{'exempt_cust'} ) %> - - - - - <%= $money_char %><%= sprintf('%.2f', $region->{'exempt_pkg'} ) %> - - - - - <%= $money_char %><%= sprintf('%.2f', $region->{'exempt_monthly'} ) %> - - = - - <%= $money_char %><%= sprintf('%.2f', $region->{'taxable'} ) %> - - <%= $region->{'label'} eq 'Total' ? '' : ' X ' %> - <%= $region->{'rate'} %> - <%= $region->{'label'} eq 'Total' ? '' : ' = ' %> - - <%= $money_char %><%= sprintf('%.2f', $region->{'owed'} ) %> - - <% unless ( $cgi->param('show_taxclasses') ) { %> - - <%= $money_char %><%= sprintf('%.2f', $region->{'tax'} ) %> - - <% } %> - - - <% } %> - - - - -<% if ( $cgi->param('show_taxclasses') ) { %> - -
- <%= include('/elements/table-grid.html') %> - - - Tax invoiced - - - <% #some false laziness w/above - $bgcolor1 = '#eeeeee'; - $bgcolor2 = '#ffffff'; - foreach my $region ( @base_regions ) { - - if ( $bgcolor eq $bgcolor1 ) { - $bgcolor = $bgcolor2; - } else { - $bgcolor = $bgcolor1; - } - - my $link = ''; - #if ( $region->{'label'} ne 'Total' ) { - if ( $region->{'label'} eq $out ) { - $link = ';out=1'; - } else { - $link = ';'. $region->{'url_param'}; - } - #} - %> - - - <%= $region->{'label'} %> - - <%= $money_char %><%= sprintf('%.2f', $region->{'tax'} ) %> - - - - <% } %> - - <% - if ( $bgcolor eq $bgcolor1 ) { - $bgcolor = $bgcolor2; - } else { - $bgcolor = $bgcolor1; - } - %> - - - Total - - <%= $money_char %><%= sprintf('%.2f', $tax ) %> - - - - - -<% } %> - - - - +