Commit 3e7b61a4 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V0.8: Add summary line to the EU Sales report

parent 8466a160
...@@ -71,4 +71,7 @@ VMEXT_EU_RECAP_ORDERS="Orders" ...@@ -71,4 +71,7 @@ VMEXT_EU_RECAP_ORDERS="Orders"
VMEXT_EU_RECAP_ORDERTOTALS="Total revenue" VMEXT_EU_RECAP_ORDERTOTALS="Total revenue"
VMEXT_EU_RECAP_ORDERTAXES="Taxes" VMEXT_EU_RECAP_ORDERTAXES="Taxes"
VMEXT_EU_RECAP_CANCELLED="EU Sales Report settings cancelled." VMEXT_EU_RECAP_CANCELLED="EU Sales Report settings cancelled."
\ No newline at end of file
VMEXT_EU_RECAP_SUMMARY="Total"
VMEXT_EU_RECAP_ORDERCOUNT="%d Order(s)"
\ No newline at end of file
...@@ -71,4 +71,7 @@ VMEXT_EU_RECAP_ORDERS="Orders" ...@@ -71,4 +71,7 @@ VMEXT_EU_RECAP_ORDERS="Orders"
VMEXT_EU_RECAP_ORDERTOTALS="Total revenue" VMEXT_EU_RECAP_ORDERTOTALS="Total revenue"
VMEXT_EU_RECAP_ORDERTAXES="Taxes" VMEXT_EU_RECAP_ORDERTAXES="Taxes"
VMEXT_EU_RECAP_CANCELLED="EU Sales Report settings cancelled." VMEXT_EU_RECAP_CANCELLED="EU Sales Report settings cancelled."
\ No newline at end of file
VMEXT_EU_RECAP_SUMMARY="Total"
VMEXT_EU_RECAP_ORDERCOUNT="%d Order(s)"
\ No newline at end of file
...@@ -22,6 +22,9 @@ if (!class_exists('CurrencyDisplay')) ...@@ -22,6 +22,9 @@ if (!class_exists('CurrencyDisplay'))
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php'); require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
$myCurrencyDisplay = CurrencyDisplay::getInstance(); $myCurrencyDisplay = CurrencyDisplay::getInstance();
$totalOrders = 0;
$totalRevenue = 0;
$totalTax = 0;
?> ?>
...@@ -134,6 +137,7 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance(); ...@@ -134,6 +137,7 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance();
$orders = array_combine($oids, $onrs); $orders = array_combine($oids, $onrs);
$links = array(); $links = array();
foreach ($orders as $oid=>$onr) { foreach ($orders as $oid=>$onr) {
$totalOrders += 1;
$orderlink = JROUTE::_ ('index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=' . $oid, FALSE); $orderlink = JROUTE::_ ('index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=' . $oid, FALSE);
$links[] = JHtml::_ ('link', JRoute::_ ($orderlink, FALSE), $onr, array('title' => $onr)); $links[] = JHtml::_ ('link', JRoute::_ ($orderlink, FALSE), $onr, array('title' => $onr));
} }
...@@ -141,11 +145,15 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance(); ...@@ -141,11 +145,15 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance();
?> ?>
</td> </td>
<td align="right"> <td align="right">
<?php echo $myCurrencyDisplay->priceDisplay($r['sum_order_total']); ?> <?php
$totalRevenue += $r['sum_order_total'];
echo $myCurrencyDisplay->priceDisplay($r['sum_order_total']); ?>
</td> </td>
<?php if ($this->include_taxed_orders) { ?> <?php if ($this->include_taxed_orders) { ?>
<td align="right"> <td align="right">
<?php echo $myCurrencyDisplay->priceDisplay($r['sum_order_tax']); ?> <?php
$totalTax += $r['sum_order_tax'];
echo $myCurrencyDisplay->priceDisplay($r['sum_order_tax']); ?>
</td> </td>
<?php } ?> <?php } ?>
</tr> </tr>
...@@ -155,6 +163,22 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance(); ...@@ -155,6 +163,22 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance();
?> ?>
</tbody> </tbody>
<tfoot> <tfoot>
<tr style="border-top: 2px solid;">
<th align="center"></th>
<th align="center" ></th>
<th align="left"><?php echo vmText::_('VMEXT_EU_RECAP_SUMMARY'); ?></th>
<th align="left"></th>
<th align="left"><?php echo vmText::sprintf('VMEXT_EU_RECAP_ORDERCOUNT', $totalOrders); ?></th>
<th align="right">
<?php echo $myCurrencyDisplay->priceDisplay($totalRevenue); ?>
</th>
<?php if ($this->include_taxed_orders) { ?>
<th align="right">
<?php echo $myCurrencyDisplay->priceDisplay($totalTax); ?>
</th>
<?php } ?>
</tr>
<tr> <tr>
<td colspan="10"> <td colspan="10">
<?php if ($this->pagination) echo $this->pagination->getListFooter(); ?> <?php if ($this->pagination) echo $this->pagination->getListFooter(); ?>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment