diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php
index b31f6ad..5d74a6a 100755
--- a/Admin/Routes/Web/Backend.php
+++ b/Admin/Routes/Web/Backend.php
@@ -61,26 +61,4 @@ return [
],
],
],
- '^.*/sales/analysis/rep(\?.*|$)$' => [
- [
- 'dest' => '\Modules\ClientManagement\Controller\BackendController:viewSalesRepAnalysis',
- 'verb' => RouteVerb::GET,
- 'permission' => [
- 'module' => BackendController::MODULE_NAME,
- 'type' => PermissionType::READ,
- 'state' => PermissionState::ANALYSIS,
- ],
- ],
- ],
- '^.*/sales/analysis/region(\?.*|$)$' => [
- [
- 'dest' => '\Modules\ClientManagement\Controller\BackendController:viewRegionAnalysis',
- 'verb' => RouteVerb::GET,
- 'permission' => [
- 'module' => BackendController::MODULE_NAME,
- 'type' => PermissionType::READ,
- 'state' => PermissionState::ANALYSIS,
- ],
- ],
- ],
];
diff --git a/Controller/BackendController.php b/Controller/BackendController.php
index 169ca54..24e5576 100755
--- a/Controller/BackendController.php
+++ b/Controller/BackendController.php
@@ -21,6 +21,7 @@ use Modules\Media\Models\Media;
use phpOMS\Asset\AssetType;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Localization\ISO3166NameEnum;
+use phpOMS\Localization\ISO3166CharEnum;
use phpOMS\Localization\Money;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
@@ -199,9 +200,10 @@ final class BackendController extends Controller
$view->addData('monthlySalesCosts', $monthlySalesCosts);
- $salesCustomer = [];
+ /////
+ $monthlySalesCustomer = [];
for ($i = 1; $i < 13; ++$i) {
- $salesCustomer[] = [
+ $monthlySalesCustomer[] = [
'net_sales' => $sales = \mt_rand(1200000000, 2000000000),
'customers' => \mt_rand(200, 400),
'year' => 2020,
@@ -209,19 +211,32 @@ final class BackendController extends Controller
];
}
- $view->addData('salesCustomer', $salesCustomer);
+ $view->addData('monthlySalesCustomer', $monthlySalesCustomer);
- $customerRetention = [];
+ $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) {
- $customerRetention[] = [
+ $monthlyCustomerRetention[] = [
'customers' => \mt_rand(200, 400),
'year' => \date('y') - 9 + $i,
];
}
- $view->addData('customerRetention', $customerRetention);
+ $view->addData('monthlyCustomerRetention', $monthlyCustomerRetention);
- $customerRegion = [
+ /////
+ $currentCustomerRegion = [
'Europe' => (int) (\mt_rand(200, 400) / 4),
'America' => (int) (\mt_rand(200, 400) / 4),
'Asia' => (int) (\mt_rand(200, 400) / 4),
@@ -230,31 +245,81 @@ final class BackendController extends Controller
'Other' => (int) (\mt_rand(200, 400) / 4),
];
- $view->addData('customerRegion', $customerRegion);
+ $view->addData('currentCustomerRegion', $currentCustomerRegion);
- $customersRep = [];
+ 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) {
- $customersRep['Rep ' . $i] = [
+ $currentCustomersRep['Rep ' . $i] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
];
}
- \uasort($customersRep, function($a, $b) { return $b['customers'] <=> $a['customers']; });
+ \uasort($currentCustomersRep, function($a, $b) { return $b['customers'] <=> $a['customers']; });
- $view->addData('customersRep', $customersRep);
+ $view->addData('currentCustomersRep', $currentCustomersRep);
- $customersCountry = [];
+ $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();
- $customersCountry[\substr($country, 0, 20)] = [
+ $currentCustomersCountry[\substr($country, 0, 20)] = [
'customers' => (int) (\mt_rand(200, 400) / 12),
];
}
- \uasort($customersCountry, function($a, $b) { return $b['customers'] <=> $a['customers']; });
+ \uasort($currentCustomersCountry, function($a, $b) { return $b['customers'] <=> $a['customers']; });
- $view->addData('customersCountry', $customersCountry);
+ $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] = [
@@ -264,49 +329,6 @@ final class BackendController extends Controller
$view->addData('customerGroups', $customerGroups);
- $salesRegion = [
- 'Europe' => (int) (\mt_rand(1200000000, 2000000000) / 4),
- 'America' => (int) (\mt_rand(1200000000, 2000000000) / 4),
- 'Asia' => (int) (\mt_rand(1200000000, 2000000000) / 4),
- 'Africa' => (int) (\mt_rand(1200000000, 2000000000) / 4),
- 'CIS' => (int) (\mt_rand(1200000000, 2000000000) / 4),
- 'Other' => (int) (\mt_rand(1200000000, 2000000000) / 4),
- ];
-
- $view->addData('salesRegion', $salesRegion);
-
- $salesRep = [];
- for ($i = 1; $i < 13; ++$i) {
- $salesRep['Rep ' . $i] = [
- 'net_sales' => (int) (\mt_rand(1200000000, 2000000000) / 12),
- ];
- }
-
- \uasort($salesRep, function($a, $b) { return $b['net_sales'] <=> $a['net_sales']; });
-
- $view->addData('salesRep', $salesRep);
-
- $salesCountry = [];
- for ($i = 1; $i < 13; ++$i) {
- $country = ISO3166NameEnum::getRandom();
- $salesCountry[\substr($country, 0, 20)] = [
- 'net_sales' => (int) (\mt_rand(1200000000, 2000000000) / 12),
- ];
- }
-
- \uasort($salesCountry, function($a, $b) { return $b['net_sales'] <=> $a['net_sales']; });
-
- $view->addData('salesCountry', $salesCountry);
-
- $salesGroups = [];
- for ($i = 1; $i < 7; ++$i) {
- $salesGroups['Group ' . $i] = [
- 'net_sales' => (int) (\mt_rand(1200000000, 2000000000) / 12),
- ];
- }
-
- $view->addData('salesGroups', $salesGroups);
-
return $view;
}
}
diff --git a/Theme/Backend/Lang/ar.lang.php b/Theme/Backend/Lang/ar.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/cs.lang.php b/Theme/Backend/Lang/cs.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/da.lang.php b/Theme/Backend/Lang/da.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/el.lang.php b/Theme/Backend/Lang/el.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php
old mode 100644
new mode 100755
index fb449d8..1affbfe
--- a/Theme/Backend/Lang/en.lang.php
+++ b/Theme/Backend/Lang/en.lang.php
@@ -45,6 +45,7 @@ return ['ClientManagement' => [
'Email' => 'Email',
'Fax' => 'Fax',
'Files' => 'Files',
+ 'Filter' => 'Filter',
'Freightage' => 'Freightage',
'Group' => 'Group',
'ID' => 'ID',
diff --git a/Theme/Backend/Lang/es.lang.php b/Theme/Backend/Lang/es.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/fi.lang.php b/Theme/Backend/Lang/fi.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/fr.lang.php b/Theme/Backend/Lang/fr.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/hu.lang.php b/Theme/Backend/Lang/hu.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/it.lang.php b/Theme/Backend/Lang/it.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/ja.lang.php b/Theme/Backend/Lang/ja.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/ko.lang.php b/Theme/Backend/Lang/ko.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/no.lang.php b/Theme/Backend/Lang/no.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/pl.lang.php b/Theme/Backend/Lang/pl.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/pt.lang.php b/Theme/Backend/Lang/pt.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/ru.lang.php b/Theme/Backend/Lang/ru.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/sv.lang.php b/Theme/Backend/Lang/sv.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/th.lang.php b/Theme/Backend/Lang/th.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/tr.lang.php b/Theme/Backend/Lang/tr.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/uk.lang.php b/Theme/Backend/Lang/uk.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/Lang/zh.lang.php b/Theme/Backend/Lang/zh.lang.php
old mode 100644
new mode 100755
diff --git a/Theme/Backend/client-analysis.tpl.php b/Theme/Backend/client-analysis.tpl.php
index 226d0dc..b8f8fdb 100755
--- a/Theme/Backend/client-analysis.tpl.php
+++ b/Theme/Backend/client-analysis.tpl.php
@@ -13,6 +13,7 @@
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) */
@@ -26,11 +27,11 @@ echo $this->getData('nav')->render();
- = $this->getHtml('Analysis'); ?>
- = $this->getHtml('Customers'); ?>
+ = $this->getHtml('AllCustomers'); ?>
= $this->getHtml('NewCustomers'); ?>
= $this->getHtml('LostCustomers'); ?>
- = $this->getHtml('Margins'); ?>
+ = $this->getHtml('Client'); ?>
+ = $this->getHtml('Filter'); ?>
@@ -39,14 +40,54 @@ echo $this->getData('nav')->render();
- = $this->getHtml('Filter'); ?>
@@ -59,10 +100,10 @@ echo $this->getData('nav')->render();
- Sales / Customers
+ Sales / Customers - Monthly
- getData('salesCustomer'); ?>
+ getData('monthlySalesCustomer'); ?>
render();
-
+
- getData('customerRetention'); ?>
+
+ Sales / Customers - Annual
+
+
+ getData('annualSalesCustomer'); ?>
-
= '"' . \implode('", "', $temp) . '"'; ?>
],
"datasets": [
{
- "label": "= $this->getHtml('Retention'); ?>",
+ "label": "= $this->getHtml('Customers'); ?>",
"type": "line",
"data": [
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
= \implode(',', $temp); ?>
@@ -218,48 +281,69 @@ echo $this->getData('nav')->render();
]
},
"options": {
- "title": {
- "display": true,
- "text": "Customer retention"
- },
+ "title": {
+ "display": false,
+ "text": "Sales / Customers"
+ },
"scales": {
"yAxes": [
{
"id": "axis-1",
"display": true,
"position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Customers'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
}
]
}
}
}'>
-
-
-
-
- Year
- Retention
-
-
-
- = \substr((string) $values['year'], -2); ?>
- = ((int) $values['customers']); ?>
-
-
- Avg.
- = $sum1 / 12; ?>
-
+
+
+
+ Data
+
+
+
+
+
+
+ Year
+ Sales
+ Customer count
+
+
+
+ = (string) $values['year']; ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+
+
+
+
-
-
+
+
- getData('customerRegion'); ?>
+
+ Customers per Region - Current
+
+
+ getData('currentCustomerRegion'); ?>
render();
},
"options": {
"title": {
- "display": true,
- "text": "Customers per region"
+ "display": false,
+ "text": "Customers per Region - Currently"
}
}
}'>
-
-
-
- Region
- Customer count
-
- $values) : $sum += $values; ?>
-
- = $region; ?>
- = $values; ?>
-
-
- Total
- = $sum; ?>
-
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ Customer count
+
+ $values) : $sum += $values; ?>
+
+ = $region; ?>
+ = $values; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+ Customers per Region - Annual
+
+
+ getData('annualCustomerRegion'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
- getData('customersRep'); ?>
+
+ Customers per Rep - Current
+
+
+ getData('currentCustomersRep'); ?>
render();
},
"options": {
"title": {
- "display": true,
+ "display": false,
"text": "Customers per rep"
}
}
}'>
-
-
-
- Rep
- Customer count
-
- $values) : $sum += $values['customers']; ?>
-
- = $rep; ?>
- = $values['customers']; ?>
-
-
- Total
- = $sum; ?>
-
+
+
+
+
+ Data
+
+
+
+
+
+
+ Rep
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $rep; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+ Customers per Rep - Annual
+
+
+ getData('annualCustomersRep'); ?>
+
+
+
+ Rep
+
+ = $year; ?>
+
+
+ $annual) : ?>
+
+ = $rep; ?>
+ $values) :
+ $sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
+ = $values['customers']; ?>
+
+
+
+ Total
+
+ = $sum[$year]; ?>
+
+
+
+
+
- getData('customersCountry'); ?>
+
+ Customers per Country - Current
+
+
+ getData('currentCustomersCountry'); ?>
-
getData('nav')->render();
},
"options": {
"title": {
- "display": true,
+ "display": false,
"text": "Customers per country"
}
}
}'>
-
-
-
- Country
- Customer count
-
- $values) : $sum += $values['customers']; ?>
-
- = $country; ?>
- = $values['customers']; ?>
-
-
- Total
- = $sum; ?>
-
+
+
+
+ Data
+
+
+
+
+
+
+ Country
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $country; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+ Customers per Country - Annual
+
+
+ getData('annualCustomersCountry'); ?>
+
+
+
+ Code
+ Country
+
+ = $year; ?>
+
+
+ $annual) : ?>
+
+ = $annual[0]['code']; ?>
+ = $country; ?>
+ $values) :
+ $sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
+ = $values['customers']; ?>
+
+
+
+ Total
+
+ = $sum[$year]; ?>
+
+
+
+
+
+
+ Customer per Attribute - Current
+
+
getData('customerGroups'); ?>
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
render();
},
"options": {
"title": {
- "display": true,
+ "display": false,
"text": "Customers per group"
}
}
}'>
+
-
-
-
- Groups
- Customer count
-
- $values) : $sum += $values['customers']; ?>
-
- = $groups; ?>
- = $values['customers']; ?>
-
-
- Total
- = $sum; ?>
-
+
+
+
+ Data
+
+
+
+
+
+
+ Groups
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $groups; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
-
+
- getData('salesRegion'); ?>
-
-
,
- = (int) ($salesRegion['America'] ?? 0); ?>,
- = (int) ($salesRegion['Asia'] ?? 0); ?>,
- = (int) ($salesRegion['Africa'] ?? 0); ?>,
- = (int) ($salesRegion['CIS'] ?? 0); ?>,
- = (int) ($salesRegion['Other'] ?? 0); ?>
- ],
- "backgroundColor": [
- "rgb(255, 99, 132)",
- "rgb(255, 159, 64)",
- "rgb(255, 205, 86)",
- "rgb(75, 192, 192)",
- "rgb(54, 162, 235)",
- "rgb(153, 102, 255)"
- ]
- }]
- },
- "options": {
- "title": {
- "display": true,
- "text": "Sales per region"
- }
- }
- }'>
+
+ Customer per Attribute - Annual
+
-
-
-
-
-
- getData('salesCountry'); ?>
+ getData('annualCustomerRegion'); ?>
-
+
+ Attribute to Analyse
+
+
+
+
+
= '"' . \implode('", "', $temp) . '"'; ?>
],
"datasets": [
{
- "label": "= $this->getHtml('Sales'); ?>",
- "type": "horizontalBar",
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
"data": [
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
= \implode(',', $temp); ?>
@@ -581,67 +1048,172 @@ echo $this->getData('nav')->render();
"borderColor": "rgb(54, 162, 235)",
"backgroundColor": "rgb(54, 162, 235)",
"tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
}
]
},
"options": {
- "title": {
- "display": true,
- "text": "Sales per country"
- }
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
}
}'>
-
-
-
+
-
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
+
- getData('salesGroups'); ?>
+
+ Customer Retention - Annual
+
+
+ getData('monthlyCustomerRetention'); ?>
-
$groups) {
- $temp[] = $name;
+ foreach ($customerRetention as $monthly) {
+ $temp[] = (string) $monthly['year'];
}
?>
= '"' . \implode('", "', $temp) . '"'; ?>
],
- "datasets": [{
- "data": [
-
- = \implode(',', $temp); ?>
- ],
- "backgroundColor": [
- "rgb(255, 99, 132)",
- "rgb(255, 159, 64)",
- "rgb(255, 205, 86)",
- "rgb(75, 192, 192)",
- "rgb(54, 162, 235)",
- "rgb(153, 102, 255)"
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Retention'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
]
- }]
- },
- "options": {
- "title": {
- "display": true,
- "text": "Sales per group"
- }
- }
- }'>
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customer retention"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Year
+ Retention
+
+
+
+ = \substr((string) $values['year'], -2); ?>
+ = ((int) $values['customers']); ?>
+
+
+ Avg.
+ = $sum1 / 12; ?>
+
+
+
-
-
-
+
+
+
request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
@@ -649,123 +1221,19 @@ echo $this->getData('nav')->render();
- New customers
-
- Shows new customers and their sales
+
+ Sales / New Customers - Monthly
+
-
-
-
-
-
- New customers per region
+ getData('monthlySalesCustomer'); ?>
-
-
-
-
-
-
- New customers per sales rep
-
-
-
-
-
-
-
- New customers per sales group
-
-
-
-
-
-
-
- New customers per customer group
-
-
-
-
-
-
-
- New customers sales per customer group
-
-
-
-
-
-
-
- request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
-
-
-
-
- Lost customers
-
- Shows lost customers and their sales
-
-
-
-
-
-
- Lost customers per region
-
-
-
-
-
-
-
- Lost customers per sales rep
-
-
-
-
-
-
-
- Lost customers per sales group
-
-
-
-
-
-
-
- Lost customers per customer group
-
-
-
-
-
-
-
- Lost customers sales per customer group
-
-
-
-
-
-
-
- request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
-
-
-
-
- getData('monthlySalesCosts'); ?>
-
-
@@ -773,13 +1241,13 @@ echo $this->getData('nav')->render();
],
"datasets": [
{
- "label": "= $this->getHtml('Margin'); ?>",
+ "label": "= $this->getHtml('Customers'); ?>",
"type": "line",
"data": [
= \implode(',', $temp); ?>
@@ -796,22 +1264,25 @@ echo $this->getData('nav')->render();
"data": [
= \implode(',', $temp); ?>
],
"yAxisID": "axis-1",
- "backgroundColor": "rgb(54, 162, 235)"
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
}
]
},
"options": {
- "title": {
- "display": true,
- "text": "Sales / Margin"
- },
+ "title": {
+ "display": false,
+ "text": "Sales / Customers"
+ },
"scales": {
"yAxes": [
{
@@ -825,58 +1296,3150 @@ echo $this->getData('nav')->render();
"position": "right",
"scaleLabel": {
"display": true,
- "labelString": "= $this->getHtml('Margin'); ?> %"
+ "labelString": "= $this->getHtml('Customers'); ?>"
},
"gridLines": {
"display": false
- },
- "beginAtZero": true,
- "ticks": {
- "min": 0,
- "max": 100,
- "stepSize": 10
}
}
]
}
}
}'>
+
+
+
+ Data
+
+
+
+
+
+
+ Month
+ Sales
+ Customer count
+
+
+
+ = $values['month'] . '/' . \substr((string) $values['year'], -2); ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+
+
+ Total
+ = (new Money($sum1))->getCurrency(); ?>
+ = (int) ($sum2 / 12); ?>
+
+
+
-
-
+
+
-
+
- Margins per region
-
+
+ Sales / New Customers - Annual
+
-
-
+ getData('annualSalesCustomer'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Customers'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Sales / Customers"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Customers'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+ Data
+
+
+
+
+
+
+ Year
+ Sales
+ Customer count
+
+
+
+ = (string) $values['year']; ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+
+
+
+
+
+
+
-
+
- Margins per sales rep
-
+
+ New Customers per Region - Current
+
-
-
+ getData('currentCustomerRegion'); ?>
+
+
,
+ = (int) ($customerRegion['America'] ?? 0); ?>,
+ = (int) ($customerRegion['Asia'] ?? 0); ?>,
+ = (int) ($customerRegion['Africa'] ?? 0); ?>,
+ = (int) ($customerRegion['CIS'] ?? 0); ?>,
+ = (int) ($customerRegion['Other'] ?? 0); ?>
+ ],
+ "backgroundColor": [
+ "rgb(255, 99, 132)",
+ "rgb(255, 159, 64)",
+ "rgb(255, 205, 86)",
+ "rgb(75, 192, 192)",
+ "rgb(54, 162, 235)",
+ "rgb(153, 102, 255)"
+ ]
+ }]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Currently"
+ }
+ }
+ }'>
-
-
- Margins per sales group
-
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ Customer count
+
+ $values) : $sum += $values; ?>
+
+ = $region; ?>
+ = $values; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
-
-
+
+
-
+
- Margins per customer group
-
+
+ New Customers per Region - Annual
+
-
-
-
+ getData('annualCustomerRegion'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
+
+
+
+ New Customers per Rep - Current
+
+
+ getData('currentCustomersRep'); ?>
+
+
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Customers'); ?>",
+ "type": "horizontalBar",
+ "data": [
+
+ = \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"
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Rep
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $rep; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ New Customers per Rep - Annual
+
+
+ getData('annualCustomersRep'); ?>
+
+
+
+ Rep
+
+ = $year; ?>
+
+
+ $annual) : ?>
+
+ = $rep; ?>
+ $values) :
+ $sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
+ = $values['customers']; ?>
+
+
+
+ Total
+
+ = $sum[$year]; ?>
+
+
+
+
+
+
+
+
+ New Customers per Country - Current
+
+
+ getData('currentCustomersCountry'); ?>
+
+
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Customers'); ?>",
+ "type": "horizontalBar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per country"
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Country
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $country; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ New Customers per Country - Annual
+
+
+ getData('annualCustomersCountry'); ?>
+
+
+
+ Code
+ Country
+
+ = $year; ?>
+
+
+ $annual) : ?>
+
+ = $annual[0]['code']; ?>
+ = $country; ?>
+ $values) :
+ $sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
+ = $values['customers']; ?>
+
+
+
+ Total
+
+ = $sum[$year]; ?>
+
+
+
+
+
+
+
+
+ New Customer per Attribute - Current
+
+
+ getData('customerGroups'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ ],
+ "datasets": [{
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "backgroundColor": [
+ "rgb(255, 99, 132)",
+ "rgb(255, 159, 64)",
+ "rgb(255, 205, 86)",
+ "rgb(75, 192, 192)",
+ "rgb(54, 162, 235)",
+ "rgb(153, 102, 255)"
+ ]
+ }]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per group"
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Groups
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $groups; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ New Customer per Attribute - Annual
+
+
+ getData('annualCustomerRegion'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
+
+
+
+ New Customers
+
+
+
+
+
+ Code
+ Country
+ Rep
+ Name
+ Sales
+
+ $annual) : ++$i;
+ if ($i > $rnd) break;
+ ?>
+
+ = $annual[0]['code']; ?>
+ = $country; ?>
+ Rep = \mt_rand(1, 13); ?>
+ = Name::generateName(['family']); ?>
+ = (new Money(\mt_rand(10000, 1000000)))->getCurrency(); ?>
+
+
+
+
+
+
+
+
request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
+
+
+
+
+
+ Sales / Lost Customers - Monthly
+
+
+ getData('monthlySalesCustomer'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Customers'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Sales / Customers"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Customers'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+ Data
+
+
+
+
+
+
+ Month
+ Sales
+ Customer count
+
+
+
+ = $values['month'] . '/' . \substr((string) $values['year'], -2); ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+
+
+ Total
+ = (new Money($sum1))->getCurrency(); ?>
+ = (int) ($sum2 / 12); ?>
+
+
+
+
+
+
+
+
+
+
+ Sales / Sales Customers - Annual
+
+
+ getData('annualSalesCustomer'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Customers'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Sales / Customers"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Customers'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+ Data
+
+
+
+
+
+
+ Year
+ Sales
+ Customer count
+
+
+
+ = (string) $values['year']; ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+
+
+
+
+
+
+
+
+
+
+
+ Lost Customers per Region - Current
+
+
+ getData('currentCustomerRegion'); ?>
+
+
,
+ = (int) ($customerRegion['America'] ?? 0); ?>,
+ = (int) ($customerRegion['Asia'] ?? 0); ?>,
+ = (int) ($customerRegion['Africa'] ?? 0); ?>,
+ = (int) ($customerRegion['CIS'] ?? 0); ?>,
+ = (int) ($customerRegion['Other'] ?? 0); ?>
+ ],
+ "backgroundColor": [
+ "rgb(255, 99, 132)",
+ "rgb(255, 159, 64)",
+ "rgb(255, 205, 86)",
+ "rgb(75, 192, 192)",
+ "rgb(54, 162, 235)",
+ "rgb(153, 102, 255)"
+ ]
+ }]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Currently"
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ Customer count
+
+ $values) : $sum += $values; ?>
+
+ = $region; ?>
+ = $values; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ Lost Customers per Region - Annual
+
+
+ getData('annualCustomerRegion'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
+
+
+
+ Lost Customers per Rep - Current
+
+
+ getData('currentCustomersRep'); ?>
+
+
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Customers'); ?>",
+ "type": "horizontalBar",
+ "data": [
+
+ = \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"
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Rep
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $rep; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ Lost Customers per Rep - Annual
+
+
+ getData('annualCustomersRep'); ?>
+
+
+
+ Rep
+
+ = $year; ?>
+
+
+ $annual) : ?>
+
+ = $rep; ?>
+ $values) :
+ $sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
+ = $values['customers']; ?>
+
+
+
+ Total
+
+ = $sum[$year]; ?>
+
+
+
+
+
+
+
+
+ Lost Customers per Country - Current
+
+
+ getData('currentCustomersCountry'); ?>
+
+
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Customers'); ?>",
+ "type": "horizontalBar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per country"
+ }
+ }
+ }'>
+
+
+
+
+ Data
+
+
+
+
+
+
+ Country
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $country; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ Lost Customers per Country - Annual
+
+
+ getData('annualCustomersCountry'); ?>
+
+
+
+ Code
+ Country
+
+ = $year; ?>
+
+
+ $annual) : ?>
+
+ = $annual[0]['code']; ?>
+ = $country; ?>
+ $values) :
+ $sum[$values['year']] = ($sum[$values['year']] ?? 0) + $values['customers']; ?>
+ = $values['customers']; ?>
+
+
+
+ Total
+
+ = $sum[$year]; ?>
+
+
+
+
+
+
+
+
+ Lost Customer per Attribute - Current
+
+
+ getData('customerGroups'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ ],
+ "datasets": [{
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "backgroundColor": [
+ "rgb(255, 99, 132)",
+ "rgb(255, 159, 64)",
+ "rgb(255, 205, 86)",
+ "rgb(75, 192, 192)",
+ "rgb(54, 162, 235)",
+ "rgb(153, 102, 255)"
+ ]
+ }]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per group"
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Groups
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $groups; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ Lost Customer per Attribute - Annual
+
+
+ getData('annualCustomerRegion'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
+
+
+
+ Lost Customers
+
+
+
+
+
+ Code
+ Country
+ Rep
+ Name
+ 3 Year Avg. Sales
+
+ $annual) : ++$i;
+ if ($i > $rnd) break;
+ ?>
+
+ = $annual[0]['code']; ?>
+ = $country; ?>
+ Rep = \mt_rand(1, 13); ?>
+ = Name::generateName(['family']); ?>
+ = (new Money(\mt_rand(10000, 1000000)))->getCurrency(); ?>
+
+
+
+
+
+
+
request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
+
+
+
+
+
+
+
+ Sales / Profit - Monthly
+
+
+ getData('monthlySalesCustomer'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Profit'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Sales / Profit"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Profit'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+ Data
+
+
+
+
+
+
+ Month
+ Sales
+ Profit
+ Profit %
+
+
+
+ = $values['month'] . '/' . \substr((string) $values['year'], -2); ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+ = ((int) $values['customers']); ?>
+
+
+ Total
+ = (new Money($sum1))->getCurrency(); ?>
+ = (int) ($sum2 / 12); ?>
+ = (int) ($sum2 / 12); ?>
+
+
+
+
+
+
+
+
+
+
+ Sales / Profit - Annual
+
+
+ getData('annualSalesCustomer'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Profit'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Sales / Profit"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Profit'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+ Data
+
+
+
+
+
+
+ Year
+ Sales
+ Profit
+ Profit %
+
+
+
+ = (string) $values['year']; ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+ = ((int) $values['customers']); ?>
+
+
+
+
+
+
+
+
+
+
+
+ Sales per Attribute - Current
+
+
+ getData('customerGroups'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ ],
+ "datasets": [{
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "backgroundColor": [
+ "rgb(255, 99, 132)",
+ "rgb(255, 159, 64)",
+ "rgb(255, 205, 86)",
+ "rgb(75, 192, 192)",
+ "rgb(54, 162, 235)",
+ "rgb(153, 102, 255)"
+ ]
+ }]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per group"
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Groups
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $groups; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ Sales per Attribute - Annual
+
+
+ getData('annualCustomerRegion'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
+
+
+
+ Profit per Attribute - Current
+
+
+ getData('customerGroups'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ ],
+ "datasets": [{
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "backgroundColor": [
+ "rgb(255, 99, 132)",
+ "rgb(255, 159, 64)",
+ "rgb(255, 205, 86)",
+ "rgb(75, 192, 192)",
+ "rgb(54, 162, 235)",
+ "rgb(153, 102, 255)"
+ ]
+ }]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per group"
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Groups
+ Customer count
+
+ $values) : $sum += $values['customers']; ?>
+
+ = $groups; ?>
+ = $values['customers']; ?>
+
+
+ Total
+ = $sum; ?>
+
+
+
+
+
+
+
+
+
+
+ Profit per Attribute - Annual
+
+
+ getData('annualCustomerRegion'); ?>
+
+
+ = $this->getHtml('Attribute'); ?>
+
+ Attribute to Analyse
+
+
+
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Total'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(139, 139, 139)",
+ "backgroundColor": "rgb(139, 139, 139)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Europe'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('America'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 159, 64)",
+ "backgroundColor": "rgb(255, 159, 64)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Asia'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(255, 205, 86)",
+ "backgroundColor": "rgb(255, 205, 86)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Africa'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(75, 192, 192)",
+ "backgroundColor": "rgb(75, 192, 192)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('CIS'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Other'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "fill": false,
+ "borderColor": "rgb(153, 102, 255)",
+ "backgroundColor": "rgb(153, 102, 255)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Customers per Region - Annual"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+
+
+ Data
+
+
+
+
+
+
+ Region
+ $values) : ?>
+ = $values; ?>
+
+
+
+
+ = $region; ?>
+ $annual) : ?>
+ = $annual[$region] ?? 0; ?>
+
+
+
+
+
+
+
+
+
+
+
+ Invoices / Articles - Monthly
+
+
+ getData('monthlySalesCustomer'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Articles'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Sales / Articles"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Articles'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+ Data
+
+
+
+
+
+
+ Month
+ Sales
+ Articles
+
+
+
+ = $values['month'] . '/' . \substr((string) $values['year'], -2); ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+ = ((int) $values['customers']); ?>
+
+
+ Total
+ = (new Money($sum1))->getCurrency(); ?>
+ = (int) ($sum2 / 12); ?>
+ = (int) ($sum2 / 12); ?>
+
+
+
+
+
+
+
+
+
+
+ Invoices / Articles - Annual
+
+
+ getData('annualSalesCustomer'); ?>
+
+
+ = '"' . \implode('", "', $temp) . '"'; ?>
+ ],
+ "datasets": [
+ {
+ "label": "= $this->getHtml('Articles'); ?>",
+ "type": "line",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-2",
+ "fill": false,
+ "borderColor": "rgb(255, 99, 132)",
+ "backgroundColor": "rgb(255, 99, 132)",
+ "tension": 0.0
+ },
+ {
+ "label": "= $this->getHtml('Sales'); ?>",
+ "type": "bar",
+ "data": [
+
+ = \implode(',', $temp); ?>
+ ],
+ "yAxisID": "axis-1",
+ "fill": false,
+ "borderColor": "rgb(54, 162, 235)",
+ "backgroundColor": "rgb(54, 162, 235)",
+ "tension": 0.0
+ }
+ ]
+ },
+ "options": {
+ "title": {
+ "display": false,
+ "text": "Sales / Articles"
+ },
+ "scales": {
+ "yAxes": [
+ {
+ "id": "axis-1",
+ "display": true,
+ "position": "left"
+ },
+ {
+ "id": "axis-2",
+ "display": true,
+ "position": "right",
+ "scaleLabel": {
+ "display": true,
+ "labelString": "= $this->getHtml('Articles'); ?>"
+ },
+ "gridLines": {
+ "display": false
+ }
+ }
+ ]
+ }
+ }
+ }'>
+
+
+
+ Data
+
+
+
+
+
+
+ Year
+ Sales
+ Articles
+
+
+
+ = (string) $values['year']; ?>
+ = (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
+ = ((int) $values['customers']); ?>
+ = ((int) $values['customers']); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Theme/Backend/client-profile.tpl.php b/Theme/Backend/client-profile.tpl.php
index 8ae5a6d..a82ee10 100755
--- a/Theme/Backend/client-profile.tpl.php
+++ b/Theme/Backend/client-profile.tpl.php
@@ -137,7 +137,10 @@ echo $this->getData('nav')->render();
printHtml($code2 === $client->mainAddress->getCountry() ? ' selected' : ''); ?>>= $this->printHtml($countries[$code3]); ?>
-
+
+ mainAddress->getCountry()) . '.svg')) : ?>
+
+