+% # Row label
+% # Special: If this report is showing all taxes, link the row label to
+% # the detailed tax report for that taxname/country.
+
+% if ( $all ) {
+% my $newcgi = CGI->new($cgi);
+% $newcgi->delete('all');
+% $newcgi->param('country', $row->{country});
+% $newcgi->param('taxname', $row->{taxname});
+% $newcgi->param('breakdown', qw(city district));
+
+
+ <% $row->{label} |h %>
+
+
+% } else { # on the per-taxname report, just show the label with no link
+
+ <% $row->{label} |h %>
+
+% }
+ |
- ">
- <% $sales %>
+% # Total sales
+
+ <% $money_sprintf->( $row->{sales} ) %>
|
-% # exemptions
-% foreach(qw(cust pkg)) {
+% # Exemptions: customer
- ">
- <% $money_sprintf->($values{"exempt_$_"}) %>
+
+ <% $money_sprintf->( $row->{exempt_cust} ) %>
|
-% }
+% # package
- ">
- <% $money_sprintf->($values{"exempt_monthly"}) %>
+
+ <% $money_sprintf->( $row->{exempt_pkg} ) %>
|
-% # taxable
+% # monthly (note this uses $exemptlink; it's a completely separate report)
- ">
- <% $money_sprintf->($values{taxable}) %>
+
+ <% $money_sprintf->( $row->{exempt_monthly} ) %>
+
+ |
+% # credited sales
+
+
+ <% $money_sprintf->( $row->{sales_credited} ) %>
+
+ |
+% # taxable sales
+
+ ">
+ <% $money_sprintf->( $row->{taxable} ) %>
|
-% # tax rate
-% my $rate;
-% foreach(split(',', $taxnums{tax})) {
-% $rate ||= $taxrates{$_};
-% if ($rate != $taxrates{$_}) {
-% $rate = 'variable';
-% last;
-% }
-% }
-% $rate = sprintf('%.2f', $rate) . '%' if ($rate and $rate ne 'variable');
× |
- <% $rate %> |
-% # estimated tax
+ <% $row->{rate} %> |
+% # estimated tax
= |
- <% $rate eq 'variable'
- ? ''
- : $money_sprintf->( $values{taxable} * $rate / 100 ) %>
+ |
+% if ( $row->{estimated} ) {
+ <% $money_sprintf->( $row->{estimated} ) %>
+% }
|
-% # invoiced tax
+% # invoiced tax
- ">
- <% $money_sprintf->( $values{tax} ) %>
+
+ <% $money_sprintf->( $row->{tax} ) %>
|
-% # credited tax
+% # credited tax
− |
- ">
- <% $money_sprintf->( $values{credited} ) %>
-
+%# currently broken
+ <% $money_sprintf->( $row->{tax_credited} ) %>
+%#
|
-% # net tax due
+% # net tax due
= |
- <% $money_sprintf->( $values{tax} - $values{credited} ) %> |
+ <% $money_sprintf->( $row->{tax} - $row->{tax_credited} ) %> |
+% # tax collected
+ |
+ <% $money_sprintf->( $row->{tax_paid} ) %> |
+% $rownum++;
+% $prev_row = $row;
+% } # foreach my $row
+% # at the end of everything
+