X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_tax.cgi;h=93e5b51c9fcd278386ff191bab530d6388264def;hb=2888eb3dd278260b3ed6ad4a2d4ae3ba656f6a57;hp=bb9c8f433fbada2cf28330a6d65255e49339bbb2;hpb=4b5c6ba830fe2845a0055e1fcf5af0c7e8b8cd0c;p=freeside.git
diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi
index bb9c8f433..93e5b51c9 100755
--- a/httemplate/search/report_tax.cgi
+++ b/httemplate/search/report_tax.cgi
@@ -1,4 +1,4 @@
-<% include("/elements/header.html", "$agentname Sales Tax Report - ".
+<% include("/elements/header.html", "$agentname Tax Report - ".
( $beginning
? time2str('%h %o %Y ', $beginning )
: ''
@@ -7,219 +7,261 @@
( $ending == 4294967295
? 'now'
: time2str('%h %o %Y', $ending )
- ),
- menubar( 'Main Menu'=>$p, )
+ )
)
%>
+
+Download full results
+as Excel spreadsheet
+ |
<% include('/elements/table-grid.html') %>
- |
+ |
Sales |
- |
- Rate |
- |
- Tax owed |
+ |
+ Rate |
+ |
+ Tax owed |
% unless ( $cgi->param('show_taxclasses') ) {
-
- Tax invoiced |
+ Tax invoiced |
+ |
+ Tax credited |
+ |
+ Tax collected |
% }
+
+
+ Total |
+ |
+ Non-taxable |
+ |
+ Non-taxable |
+ |
+ Non-taxable |
+ |
+ Taxable |
+
- Total |
- |
- Non-taxable (tax-exempt customer) |
- |
- Non-taxable (tax-exempt package) |
- |
- Non-taxable (monthly exemption) |
- |
- Taxable |
+ (tax-exempt customer) |
+ (tax-exempt package) |
+ (monthly exemption) |
+
% my $bgcolor1 = '#eeeeee';
-% my $bgcolor2 = '#ffffff';
-% my $bgcolor;
+% 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'};
-% }
-% }
+% my $link = '';
+% if ( $region->{'label'} eq $out ) {
+% $link = ';out=1';
+% } else {
+% $link = ';'. $region->{'url_param'}
+% if $region->{'url_param'};
+% }
%
+% if ( $bgcolor eq $bgcolor1 ) {
+% $bgcolor = $bgcolor2;
+% } else {
+% $bgcolor = $bgcolor1;
+% }
%
+% #my $diff = 0;
+% my $hicolor = $bgcolor;
+% unless ( $cgi->param('show_taxclasses') ) {
+% my $diff = abs( sprintf( '%.2f', $region->{'owed'} )
+% - sprintf( '%.2f', $region->{'tax'} )
+% );
+% if ( $diff > 0.02 ) {
+% # $hicolor = $hicolor eq '#eeeeee' ? '#eeee66' : '#ffff99';
+% #} elsif ( $diff ) {
+% $hicolor = $hicolor eq '#eeeeee' ? '#eeee99' : '#ffffcc';
+% }
+% }
%
%
-%
-
+% my $td = qq(TD CLASS="grid" BGCOLOR="$bgcolor");
+% my $tdh = qq(TD CLASS="grid" BGCOLOR="$hicolor");
+% my $bigmath = '';
+% my $bme = '';
- <% $region->{'label'} %> |
-
- <% $money_char %><% sprintf('%.2f', $region->{'total'} ) %>
+ <<%$td%>><% $region->{'label'} %> |
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $region->{'total'} ) %>
- - |
-
- <% $money_char %><% sprintf('%.2f', $region->{'exempt_cust'} ) %>
+ <<%$td%>> - |
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $region->{'exempt_cust'} ) %>
- - |
-
- <% $money_char %><% sprintf('%.2f', $region->{'exempt_pkg'} ) %>
+ <<%$td%>> - |
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $region->{'exempt_pkg'} ) %>
- - |
-
- <% $money_char %><% sprintf('%.2f', $region->{'exempt_monthly'} ) %>
+ <<%$td%>> - |
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $region->{'exempt_monthly'} ) %>
- = |
-
- <% $money_char %><% sprintf('%.2f', $region->{'taxable'} ) %>
+ <<%$td%>> = |
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $region->{'taxable'} ) %>
- <% $region->{'label'} eq 'Total' ? '' : ' X ' %> |
- <% $region->{'rate'} %> |
- <% $region->{'label'} eq 'Total' ? '' : ' = ' %> |
-
- <% $money_char %><% sprintf('%.2f', $region->{'owed'} ) %>
+ <<%$td%>><% $region->{'label'} eq 'Total' ? '' : "$bigmath X $bme" %> |
+ <<%$td%> ALIGN="right"><% $region->{'rate'} %>
+ <<%$td%>><% $region->{'label'} eq 'Total' ? '' : "$bigmath = $bme" %>
+ <<%$tdh%> ALIGN="right">
+ <% &$money_sprintf( $region->{'owed'} ) %>
+
% unless ( $cgi->param('show_taxclasses') ) {
+% my $invlink = $region->{'url_param_inv'}
+% ? ';'. $region->{'url_param_inv'}
+% : $link;
-
- <% $money_char %><% sprintf('%.2f', $region->{'tax'} ) %>
+ <<%$tdh%> ALIGN="right">
+ <% &$money_sprintf( $region->{'tax'} ) %>
+ |
+ <<%$tdh%>> -
+ <<%$tdh%> ALIGN="right">
+ <% &$money_sprintf( $region->{'credit'} ) %>
+
+ <<%$tdh%>> =
+ <<%$tdh%> ALIGN="right">
+ <% &$money_sprintf( $region->{'tax'} - $region->{'credit'} ) %>
% }
% }
-
-% 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'};
-% }
-% #}
-%
+% if ( $cgi->param('show_taxclasses') ) {
+
+ <% include('/elements/table-grid.html') %>
- <% $region->{'label'} %> |
-
- <% $money_char %><% sprintf('%.2f', $region->{'tax'} ) %>
- |
+ |
+ Tax invoiced |
+ |
+ Tax credited |
+ |
+ Tax collected |
-% }
+
+% #some false laziness w/above
+% $bgcolor1 = '#eeeeee';
+% $bgcolor2 = '#ffffff';
+%
+% foreach my $region ( @base_regions ) {
+%
+% my $link = '';
+% if ( $region->{'label'} eq $out ) {
+% $link = ';out=1';
+% } else {
+% $link = ';'. $region->{'url_param'}
+% if $region->{'url_param'};
+% }
%
% if ( $bgcolor eq $bgcolor1 ) {
% $bgcolor = $bgcolor2;
% } else {
% $bgcolor = $bgcolor1;
% }
-%
+% my $td = qq(TD CLASS="grid" BGCOLOR="$bgcolor");
+% my $tdh = qq(TD CLASS="grid" BGCOLOR="$bgcolor");
+%
+% #?
+% my $invlink = $region->{'url_param_inv'}
+% ? ';'. $region->{'url_param_inv'}
+% : $link;
+
+
+ <<%$td%>><% $region->{'label'} %>
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $region->{'tax'} ) %>
+
+ <<%$td%>> -
+ <<%$tdh%> ALIGN="right">
+ <% &$money_sprintf( $region->{'credit'} ) %>
+
+ <<%$td%>> =
+ <<%$tdh%> ALIGN="right">
+ <% &$money_sprintf( $region->{'tax'} - $region->{'credit'} ) %>
+
+
+% }
+
+% if ( $bgcolor eq $bgcolor1 ) {
+% $bgcolor = $bgcolor2;
+% } else {
+% $bgcolor = $bgcolor1;
+% }
+% my $td = qq(TD CLASS="grid" BGCOLOR="$bgcolor");
- Total |
-
- <% $money_char %><% sprintf('%.2f', $tax ) %>
- |
+ <<%$td%>>Total
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $tot_tax ) %>
+
+ <<%$td%>> -
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $tot_credit ) %>
+
+ <<%$td%>> =
+ <<%$td%> ALIGN="right">
+ <% &$money_sprintf( $tot_tax - $tot_credit ) %>
+
+
% }
+<% include('/elements/footer.html') %>
-