Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mpysiak committed Jun 27, 2024
1 parent 9019631 commit 62ae1d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/vendor
/var/cache/
/var/logs/
/var/data/*.sqlite
!/var/data/.gitkeep
/var
/composer.lock
/.phpunit.cache
6 changes: 3 additions & 3 deletions src/Provider/GmvProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ private function calculateGmvForPeriodAndCurrency(\DateTimeInterface $periodStar
$queryBuilder->andWhere('o.currencyCode = :currencyCode')
->setParameter('currencyCode', $currencyCode);

$totalItemsQuery = (int) $queryBuilder
$totalItems = (int) $queryBuilder
->select('SUM(o.itemsTotal) as totalItems')
->getQuery()
->getSingleScalarResult();

$totalTaxQuery = (int) $queryBuilder
$totalTax = (int) $queryBuilder
->select('SUM(adjustment.amount) as totalTaxes')
->leftJoin('o.items', 'items')
->leftJoin('items.units', 'units')
Expand All @@ -81,7 +81,7 @@ private function calculateGmvForPeriodAndCurrency(\DateTimeInterface $periodStar
->getQuery()
->getSingleScalarResult();

return $totalItemsQuery - $totalTaxQuery;
return $totalItems - $totalTax;
}

private function createCommonQueryBuilder(\DateTimeInterface $periodStart, \DateTimeInterface $periodEnd): QueryBuilder
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ framework:
doctrine:
dbal:
driver: pdo_sqlite
path: '%kernel.project_dir%/var/data/test.sqlite'
path: '%kernel.project_dir%/var/test.sqlite'

0 comments on commit 62ae1d4

Please sign in to comment.