Browse Source

[Administration] Statistiques > Rapports : intégration des distributions non activées avec commandes

feature/souke
Guillaume Bourgeois 9 months ago
parent
commit
5fdd026ea5
3 changed files with 15 additions and 1 deletions
  1. +1
    -1
      backend/controllers/ReportController.php
  2. +8
    -0
      domain/Distribution/Distribution/DistributionRepository.php
  3. +6
    -0
      domain/Distribution/Distribution/DistributionRepositoryQuery.php

+ 1
- 1
backend/controllers/ReportController.php View File

} }


$distributionsByMonthArray = []; $distributionsByMonthArray = [];
$distributionsArray = $distributionModule->findDistributionsActive();
$distributionsArray = $distributionModule->findDistributionsWithOrders();
foreach ($distributionsArray as $distribution) { foreach ($distributionsArray as $distribution) {
$month = date('Y-m', strtotime($distribution->date)); $month = date('Y-m', strtotime($distribution->date));
if (!isset($distributionsByMonthArray[$month])) { if (!isset($distributionsByMonthArray[$month])) {

+ 8
- 0
domain/Distribution/Distribution/DistributionRepository.php View File

->find(); ->find();
} }


public function findDistributionsWithOrders()
{
return $this->createDefaultQuery()
->filterHasOrders()
->orderBy('date ASC')
->find();
}

/** /**
* Récupère les distributions futures. * Récupère les distributions futures.
*/ */

+ 6
- 0
domain/Distribution/Distribution/DistributionRepositoryQuery.php View File

return $this; return $this;
} }


public function filterHasOrders(): self
{
$this->innerJoinWith('order');
return $this;
}

public function filterByDateBetterThanToday(): self public function filterByDateBetterThanToday(): self
{ {
$this->query $this->query

Loading…
Cancel
Save