Skip to content
Snippets Groups Projects
Commit 6445c2a4 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V0.2: Show a summary line of all taxes summed

parent b6cf82ba
No related branches found
No related tags found
No related merge requests found
......@@ -13,3 +13,5 @@ VMEXT_TAXREPORT_TAXRATE="Tax Rate"
VMEXT_TAXREPORT_ORDERS="Orders"
VMEXT_TAXREPORT_ORDERREVENUENET="Net revenue"
VMEXT_TAXREPORT_ORDERTAXES="Taxes"
VMEXT_TAXREPORT_SUMMARY="Tax Total"
......@@ -13,3 +13,5 @@ VMEXT_TAXREPORT_TAXRATE="Tax Rate"
VMEXT_TAXREPORT_ORDERS="Orders"
VMEXT_TAXREPORT_ORDERREVENUENET="Net revenue"
VMEXT_TAXREPORT_ORDERTAXES="Taxes"
VMEXT_TAXREPORT_SUMMARY="Tax Total"
No preview for this file type
......@@ -48,20 +48,37 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance();
<tbody>
<?php
$i = 0;
$nr_taxes = 0;
$nr_orders = 0;
$sum_revenue = 0.0;
$sum_tax = 0.0;
$tax_rate = 0;
foreach ($this->report as $r) { ?>
<tr class="row<?php echo $i;?>">
<td align="center"><?php echo $r['country']; ?></td>
<td align="left"><?php echo $r['taxrule']; ?></td>
<td align="center"><?php echo round($r['taxrate'], 4) . " %"; ?></td>
<td align="center"><?php echo round($r['taxrate'], 2) . " %"; ?></td>
<td align="center"><?php echo $r['ordercount']; ?></td>
<td align="right"><?php echo $myCurrencyDisplay->priceDisplay($r['sum_revenue_net']); ?></td>
<td align="right"><?php echo $myCurrencyDisplay->priceDisplay($r['sum_order_tax']); ?></td>
</tr>
<?php
++$nr_taxes;
$nr_orders += $r['ordercount'];
$sum_revenue += $r['sum_revenue_net'];
$sum_tax += $r['sum_order_tax'];
$i = 1-$i;
} ?>
</tbody>
<tfoot>
<tr>
<th align="center"></th>
<th align="left"><?php echo vmText::_('VMEXT_TAXREPORT_SUMMARY'); ?></th>
<th align="center"><?php echo round($sum_tax/$sum_revenue*100, 4) . " %"; ?></th>
<th align="center"><?php echo $nr_orders; ?></th>
<th align="right"><?php echo $myCurrencyDisplay->priceDisplay($sum_revenue); ?></th>
<th align="right"><?php echo $myCurrencyDisplay->priceDisplay($sum_tax); ?></th>
</tr>
<tr>
<td colspan="10">
<?php if ($this->pagination) echo $this->pagination->getListFooter(); ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment