general fixes and tpl additions

This commit is contained in:
Dennis Eichhorn 2021-05-28 20:28:40 +02:00
parent 50980cbc7e
commit f72fcdaad9
29 changed files with 2458 additions and 7 deletions

View File

@ -107,7 +107,7 @@ return [
],
'^.*/sales/analysis/bill(\?.*|$)$' => [
[
'dest' => '\Modules\ClientManagement\Controller\BackendController:viewBillAnalysis',
'dest' => '\Modules\Billing\Controller\BackendController:viewBillAnalysis',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
@ -116,4 +116,26 @@ return [
],
],
],
'^.*/sales/analysis/rep(\?.*|$)$' => [
[
'dest' => '\Modules\Billing\Controller\BackendController:viewSalesRepAnalysis',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::SALES_ANALYSIS,
],
],
],
'^.*/sales/analysis/region(\?.*|$)$' => [
[
'dest' => '\Modules\Billing\Controller\BackendController:viewRegionAnalysis',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::SALES_ANALYSIS,
],
],
],
];

View File

@ -22,6 +22,9 @@ use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
use phpOMS\Asset\AssetType;
use phpOMS\Localization\ISO3166CharEnum;
use phpOMS\Localization\ISO3166NameEnum;
/**
* Billing class.
@ -242,4 +245,303 @@ final class BackendController extends Controller
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewRegionAnalysis(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$head = $response->get('Content')->getData('head');
$head->addAsset(AssetType::CSS, 'Resources/chartjs/Chartjs/chart.css');
$head->addAsset(AssetType::JSLATE, 'Resources/chartjs/Chartjs/chart.js');
$head->addAsset(AssetType::JSLATE, 'Modules/ClientManagement/Controller.js', ['type' => 'module']);
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Billing/Theme/Backend/region-analysis');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response));
$monthlySalesCosts = [];
for ($i = 1; $i < 13; ++$i) {
$monthlySalesCosts[] = [
'net_sales' => $sales = \mt_rand(1200000000, 2000000000),
'net_costs' => (int) ($sales * \mt_rand(25, 55) / 100),
'year' => 2020,
'month' => $i,
];
}
$view->addData('monthlySalesCosts', $monthlySalesCosts);
/////
$currentCustomerRegion = [
'Europe' => (int) (\mt_rand(200, 400) / 4),
'America' => (int) (\mt_rand(200, 400) / 4),
'Asia' => (int) (\mt_rand(200, 400) / 4),
'Africa' => (int) (\mt_rand(200, 400) / 4),
'CIS' => (int) (\mt_rand(200, 400) / 4),
'Other' => (int) (\mt_rand(200, 400) / 4),
];
$view->addData('currentCustomerRegion', $currentCustomerRegion);
for ($i = 1; $i < 11; ++$i) {
$annualCustomerRegion[] = [
'year' => 2020 - 10 + $i,
'Europe' => $a = (int) (\mt_rand(200, 400) / 4),
'America' => $b = (int) (\mt_rand(200, 400) / 4),
'Asia' => $c = (int) (\mt_rand(200, 400) / 4),
'Africa' => $d = (int) (\mt_rand(200, 400) / 4),
'CIS' => $e = (int) (\mt_rand(200, 400) / 4),
'Other' => $f = (int) (\mt_rand(200, 400) / 4),
'Total' => $a + $b + $c + $d + $e + $f,
];
}
$view->addData('annualCustomerRegion', $annualCustomerRegion);
/////
$monthlySalesCustomer = [];
for ($i = 1; $i < 13; ++$i) {
$monthlySalesCustomer[] = [
'net_sales' => $sales = \mt_rand(1200000000, 2000000000),
'customers' => \mt_rand(200, 400),
'year' => 2020,
'month' => $i,
];
}
$view->addData('monthlySalesCustomer', $monthlySalesCustomer);
$annualSalesCustomer = [];
for ($i = 1; $i < 11; ++$i) {
$annualSalesCustomer[] = [
'net_sales' => $sales = \mt_rand(1200000000, 2000000000) * 12,
'customers' => \mt_rand(200, 400) * 6,
'year' => 2020 - 10 + $i,
];
}
$view->addData('annualSalesCustomer', $annualSalesCustomer);
/////
$monthlyCustomerRetention = [];
for ($i = 1; $i < 10; ++$i) {
$monthlyCustomerRetention[] = [
'customers' => \mt_rand(200, 400),
'year' => \date('y') - 9 + $i,
];
}
$view->addData('monthlyCustomerRetention', $monthlyCustomerRetention);
/////
$currentCustomerRegion = [
'Europe' => (int) (\mt_rand(200, 400) / 4),
'America' => (int) (\mt_rand(200, 400) / 4),
'Asia' => (int) (\mt_rand(200, 400) / 4),
'Africa' => (int) (\mt_rand(200, 400) / 4),
'CIS' => (int) (\mt_rand(200, 400) / 4),
'Other' => (int) (\mt_rand(200, 400) / 4),
];
$view->addData('currentCustomerRegion', $currentCustomerRegion);
for ($i = 1; $i < 11; ++$i) {
$annualCustomerRegion[] = [
'year' => 2020 - 10 + $i,
'Europe' => $a = (int) (\mt_rand(200, 400) / 4),
'America' => $b = (int) (\mt_rand(200, 400) / 4),
'Asia' => $c = (int) (\mt_rand(200, 400) / 4),
'Africa' => $d = (int) (\mt_rand(200, 400) / 4),
'CIS' => $e = (int) (\mt_rand(200, 400) / 4),
'Other' => $f = (int) (\mt_rand(200, 400) / 4),
'Total' => $a + $b + $c + $d + $e + $f,
];
}
$view->addData('annualCustomerRegion', $annualCustomerRegion);
/////
$currentCustomersRep = [];
for ($i = 1; $i < 13; ++$i) {
$currentCustomersRep['Rep ' . $i] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
];
}
\uasort($currentCustomersRep, function($a, $b) { return $b['customers'] <=> $a['customers']; });
$view->addData('currentCustomersRep', $currentCustomersRep);
$annualCustomersRep = [];
for ($i = 1; $i < 13; ++$i) {
$annualCustomersRep['Rep ' . $i] = [];
for ($j = 1; $j < 11; ++$j) {
$annualCustomersRep['Rep ' . $i][] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
'year' => 2020 - 10 + $j,
];
}
}
$view->addData('annualCustomersRep', $annualCustomersRep);
/////
$currentCustomersCountry = [];
for ($i = 1; $i < 51; ++$i) {
$country = ISO3166NameEnum::getRandom();
$currentCustomersCountry[\substr($country, 0, 20)] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
];
}
\uasort($currentCustomersCountry, function($a, $b) { return $b['customers'] <=> $a['customers']; });
$view->addData('currentCustomersCountry', $currentCustomersCountry);
$annualCustomersCountry = [];
for ($i = 1; $i < 51; ++$i) {
$countryCode = ISO3166CharEnum::getRandom();
$countryName = ISO3166NameEnum::getByName('_' . $countryCode);
$annualCustomersCountry[\substr($countryName, 0, 20)] = [];
for ($j = 1; $j < 11; ++$j) {
$annualCustomersCountry[\substr($countryName, 0, 20)][] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
'year' => 2020 - 10 + $j,
'name' => $countryName,
'code' => $countryCode,
];
}
}
$view->addData('annualCustomersCountry', $annualCustomersCountry);
/////
$customerGroups = [];
for ($i = 1; $i < 7; ++$i) {
$customerGroups['Group ' . $i] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
];
}
$view->addData('customerGroups', $customerGroups);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewBillAnalysis(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$head = $response->get('Content')->getData('head');
$head->addAsset(AssetType::CSS, 'Resources/chartjs/Chartjs/chart.css');
$head->addAsset(AssetType::JSLATE, 'Resources/chartjs/Chartjs/chart.js');
$head->addAsset(AssetType::JSLATE, 'Modules/ClientManagement/Controller.js', ['type' => 'module']);
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Billing/Theme/Backend/bill-analysis');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response));
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewSalesRepAnalysis(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$head = $response->get('Content')->getData('head');
$head->addAsset(AssetType::CSS, 'Resources/chartjs/Chartjs/chart.css');
$head->addAsset(AssetType::JSLATE, 'Resources/chartjs/Chartjs/chart.js');
$head->addAsset(AssetType::JSLATE, 'Modules/ClientManagement/Controller.js', ['type' => 'module']);
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Billing/Theme/Backend/rep-analysis');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response));
/////
$currentCustomerRegion = [
'Europe' => (int) (\mt_rand(200, 400) / 4),
'America' => (int) (\mt_rand(200, 400) / 4),
'Asia' => (int) (\mt_rand(200, 400) / 4),
'Africa' => (int) (\mt_rand(200, 400) / 4),
'CIS' => (int) (\mt_rand(200, 400) / 4),
'Other' => (int) (\mt_rand(200, 400) / 4),
];
$view->addData('currentCustomerRegion', $currentCustomerRegion);
for ($i = 1; $i < 11; ++$i) {
$annualCustomerRegion[] = [
'year' => 2020 - 10 + $i,
'Europe' => $a = (int) (\mt_rand(200, 400) / 4),
'America' => $b = (int) (\mt_rand(200, 400) / 4),
'Asia' => $c = (int) (\mt_rand(200, 400) / 4),
'Africa' => $d = (int) (\mt_rand(200, 400) / 4),
'CIS' => $e = (int) (\mt_rand(200, 400) / 4),
'Other' => $f = (int) (\mt_rand(200, 400) / 4),
'Total' => $a + $b + $c + $d + $e + $f,
];
}
$view->addData('annualCustomerRegion', $annualCustomerRegion);
/////
$currentCustomersRep = [];
for ($i = 1; $i < 13; ++$i) {
$currentCustomersRep['Rep ' . $i] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
];
}
\uasort($currentCustomersRep, function($a, $b) { return $b['customers'] <=> $a['customers']; });
$view->addData('currentCustomersRep', $currentCustomersRep);
$annualCustomersRep = [];
for ($i = 1; $i < 13; ++$i) {
$annualCustomersRep['Rep ' . $i] = [];
for ($j = 1; $j < 11; ++$j) {
$annualCustomersRep['Rep ' . $i][] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
'year' => 2020 - 10 + $j,
];
}
}
$view->addData('annualCustomersRep', $annualCustomersRep);
return $view;
}
}

View File

@ -99,13 +99,9 @@ class Bill implements \JsonSerializable
*/
public Account $createdBy;
public int |
public ?Client $client = null;
Client $client = 0;
public int |
Supplier $supplier = 0;
public ?Supplier $supplier = null;
/**
* Receiver.

View File

@ -29,4 +29,6 @@ abstract class PermissionState extends Enum
public const SALES_INVOICE = 1;
public const PURCHASE_INVOICE = 2;
public const SALES_ANALYSIS = 4;
}

0
Theme/Backend/Lang/ar.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/cs.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/da.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/de.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/el.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/en.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/es.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/fi.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/fr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/hu.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/it.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ja.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ko.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/no.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/pl.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/pt.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/ru.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/sv.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/th.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/tr.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/uk.lang.php Normal file → Executable file
View File

0
Theme/Backend/Lang/zh.lang.php Normal file → Executable file
View File

View File

@ -0,0 +1,25 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\ClientManagement
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Localization\Money;
use phpOMS\Utils\RnG\Name;
/* @todo: single month/quarter/fiscal year/calendar year */
/* @todo: time range (<= 12 month = monthly view; else annual view/comparison) */
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render();
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,347 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\ClientManagement
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Localization\Money;
use phpOMS\Utils\RnG\Name;
/* @todo: single month/quarter/fiscal year/calendar year */
/* @todo: time range (<= 12 month = monthly view; else annual view/comparison) */
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render();
?>
<div class="tabview tab-2">
<div class="box">
<ul class="tab-links">
<li><label for="c-tab-2"><?= $this->getHtml('General'); ?></label></li>
<li><label for="c-tab-1"><?= $this->getHtml('Filter'); ?></label></li>
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-lg-6">
<section class="portlet">
<form>
<div class="portlet-head"><?= $this->getHtml('Filter'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iId"><?= $this->getHtml('Client'); ?></label>
<input type="text" id="iName1" name="name1">
</div>
<div class="form-group">
<div class="input-control">
<label for="iDecimalPoint"><?= $this->getHtml('BaseTime'); ?></label>
<input id="iDecimalPoint" name="settings_decimal" type="text" value="" placeholder=".">
</div>
<div class="input-control">
<label for="iThousandSep"><?= $this->getHtml('ComparisonTime'); ?></label>
<input id="iThousandSep" name="settings_thousands" type="text" value="" placeholder=",">
</div>
</div>
<div class="form-group">
<div class="input-control">
<label for="iDecimalPoint"><?= $this->getHtml('Attribute'); ?></label>
<input id="iDecimalPoint" name="settings_decimal" type="text" value="" placeholder=".">
</div>
<div class="input-control">
<label for="iThousandSep"><?= $this->getHtml('Value'); ?></label>
<input id="iThousandSep" name="settings_thousands" type="text" value="" placeholder=",">
</div>
</div>
<div class="form-group">
<label for="iId"><?= $this->getHtml('Region'); ?></label>
<input type="text" id="iName1" name="name1">
</div>
<div class="form-group">
<label for="iId"><?= $this->getHtml('Country'); ?></label>
<input type="text" id="iName1" name="name1">
</div>
<div class="form-group">
<label for="iId"><?= $this->getHtml('Rep'); ?></label>
<input type="text" id="iName1" name="name1">
</div>
</div>
<div class="portlet-foot"><input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>"></div>
</form>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-lg-6">
<section class="portlet">
<div class="portlet-head">
Sales per Rep - Current
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div>
<?php $customersRep = $this->getData('currentCustomersRep'); ?>
<div class="portlet-body">
<canvas id="sales-region" data-chart='{
"type": "horizontalBar",
"data": {
"labels": [
<?php
$temp = [];
foreach ($customersRep as $name => $rep) {
$temp[] = $name;
}
?>
<?= '"' . \implode('", "', $temp) . '"'; ?>
],
"datasets": [
{
"label": "<?= $this->getHtml('Customers'); ?>",
"type": "horizontalBar",
"data": [
<?php
$temp = [];
foreach ($customersRep as $values) {
$temp[] = ((int) $values['customers']);
}
?>
<?= \implode(',', $temp); ?>
],
"fill": false,
"borderColor": "rgb(54, 162, 235)",
"backgroundColor": "rgb(54, 162, 235)",
"tension": 0.0
}
]
},
"options": {
"title": {
"display": false,
"text": "Customers per rep"
}
}
}'></canvas>
<div class="more-container">
<input id="more-customer-rep-current" type="checkbox">
<label for="more-customer-rep-current">
<span>Data</span>
<i class="fa fa-chevron-right expand"></i>
</label>
<div>
<table class="default">
<thead>
<tr>
<td>Rep
<td>Customer count
<tbody>
<?php
$sum = 0;
foreach ($customersRep as $rep => $values) : $sum += $values['customers']; ?>
<tr>
<td><?= $rep; ?>
<td><?= $values['customers']; ?>
<?php endforeach; ?>
<tr>
<td>Total
<td><?= $sum; ?>
</table>
</div>
</div>
</div>
</section>
</div>
<div class="col-xs-12 col-lg-6">
<section class="portlet">
<div class="portlet-head">
Sales per Rep - Annual
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div>
<?php $customersRep = $this->getData('annualCustomersRep'); ?>
<table class="default">
<thead>
<tr>
<td>Rep
<?php foreach ([2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020] as $year) : ?>
<td><?= $year; ?>
<?php endforeach; ?>
<tbody>
<?php
$sum = [];
foreach ($customersRep as $rep => $annual) : ?>
<tr>
<td><?= $rep; ?>
<?php foreach ($annual as $year => $values) :
$sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
<td><?= $values['customers']; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<tr>
<td>Total
<?php foreach ([2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020] as $year) : ?>
<td><?= $sum[$year]; ?>
<?php endforeach; ?>
</table>
</section>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-lg-6">
<section class="portlet">
<div class="portlet-head">
Profit per Rep - Current
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div>
<?php $customersRep = $this->getData('currentCustomersRep'); ?>
<div class="portlet-body">
<canvas id="sales-region" data-chart='{
"type": "horizontalBar",
"data": {
"labels": [
<?php
$temp = [];
foreach ($customersRep as $name => $rep) {
$temp[] = $name;
}
?>
<?= '"' . \implode('", "', $temp) . '"'; ?>
],
"datasets": [
{
"label": "<?= $this->getHtml('Customers'); ?>",
"type": "horizontalBar",
"data": [
<?php
$temp = [];
foreach ($customersRep as $values) {
$temp[] = ((int) $values['customers']);
}
?>
<?= \implode(',', $temp); ?>
],
"fill": false,
"borderColor": "rgb(54, 162, 235)",
"backgroundColor": "rgb(54, 162, 235)",
"tension": 0.0
}
]
},
"options": {
"title": {
"display": false,
"text": "Customers per rep"
}
}
}'></canvas>
<div class="more-container">
<input id="more-customer-rep-current" type="checkbox">
<label for="more-customer-rep-current">
<span>Data</span>
<i class="fa fa-chevron-right expand"></i>
</label>
<div>
<table class="default">
<thead>
<tr>
<td>Rep
<td>Customer count
<tbody>
<?php
$sum = 0;
foreach ($customersRep as $rep => $values) : $sum += $values['customers']; ?>
<tr>
<td><?= $rep; ?>
<td><?= $values['customers']; ?>
<?php endforeach; ?>
<tr>
<td>Total
<td><?= $sum; ?>
</table>
</div>
</div>
</div>
</section>
</div>
<div class="col-xs-12 col-lg-6">
<section class="portlet">
<div class="portlet-head">
Profit per Rep - Annual
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div>
<?php $customersRep = $this->getData('annualCustomersRep'); ?>
<table class="default">
<thead>
<tr>
<td>Rep
<?php foreach ([2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020] as $year) : ?>
<td><?= $year; ?>
<?php endforeach; ?>
<tbody>
<?php
$sum = [];
foreach ($customersRep as $rep => $annual) : ?>
<tr>
<td><?= $rep; ?>
<?php foreach ($annual as $year => $values) :
$sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
<td><?= $values['customers']; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<tr>
<td>Total
<?php foreach ([2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020] as $year) : ?>
<td><?= $sum[$year]; ?>
<?php endforeach; ?>
</table>
</section>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head">
Sales / Rep
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div>
<table class="default">
<thead>
<tr>
<td>Rep
<td>Sales PY
<td>Sales B
<td>Sales A
<td>Diff PY
<td>Diff B
<tbody>
</table>
</section>
</div>
</div>
</div>
</div>
</div>