- <?php
-
-
-
- use dosamigos\chartjs\ChartJs;
- use yii\helpers\Html;
-
- $this->setTitle('Statistiques - Chiffre d\'affaire');
- $this->addBreadcrumb('Statistiques (chiffre d\'affaire)');
-
- ?>
-
- Affichage :
- <?php
- echo Html::a('Mois',
- ['stats/index', 'year' => $yearCurrent, 'displayBy' => 'month'],
- ['class' => 'btn btn-xs ' . (($displayBy == 'month') ? 'btn-primary' : 'btn-default')]) . ' ';
- echo Html::a('Semaine',
- ['stats/index', 'year' => $yearCurrent, 'displayBy' => 'week'],
- ['class' => 'btn btn-xs ' . (($displayBy == 'week') ? 'btn-primary' : 'btn-default')]) . ' ';
-
- ?>
-
- <br><br>
-
- <?php
- foreach ($yearsWithTurnoverArray as $year) {
- $classBtn = 'btn-default';
- if ($yearCurrent == $year) {
- $classBtn = 'btn-primary';
- }
- echo Html::a($year, ['stats/index', 'year' => $year, 'displayBy' => $displayBy], ['class' => 'btn ' . $classBtn]) . ' ';
- }
-
- if($isVatNotApplicable) {
- $datasets = [
- [
- 'label' => 'Recettes commandes',
- 'borderColor' => "#F39C12",
- 'data' => $data,
- ]
- ];
- }
- else {
- $datasets = [
- [
- 'label' => 'Recettes commandes (HT)',
- 'borderColor' => "#b4b4b4",
- 'data' => $data,
- ],
- [
- 'label' => 'Recettes commandes (TTC)',
- 'borderColor' => "#F39C12",
- 'data' => $dataWithTax
- ]
- ];
- }
-
- ?>
-
- <?= ChartJs::widget([
- 'type' => 'line',
- 'options' => [
- 'height' => 400,
- 'width' => 1100,
- ],
- 'clientOptions' => [
- 'scales' => [
- 'yAxes' => [[
- 'ticks' => [
- 'beginAtZero' => true
- ]
- ]],
- ],
- ],
- 'data' => [
- 'labels' => $dataLabels,
- 'datasets' => $datasets
- ]
- ]);
-
- ?>
|