@@ -45,7 +45,7 @@ |
||
| 45 | 45 | ->andWhere('pe IN (:companies)') |
| 46 | 46 | ->groupBy('p.id, p.product, p.description, p.sku, pe.id, pe.name, pe.alias') |
| 47 | 47 | ->having('needed > 0') |
| 48 | - ->setParameter('excludedTypes', ['custom', 'component']) |
|
| 48 | + ->setParameter('excludedTypes', [ 'custom', 'component' ]) |
|
| 49 | 49 | ->setParameter( |
| 50 | 50 | 'companies', |
| 51 | 51 | $this->peopleService->getMyCompanies() |
@@ -51,8 +51,9 @@ |
||
| 51 | 51 | $this->peopleService->getMyCompanies() |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | - if ($company) |
|
| 55 | - $qb->andWhere('pe = :company')->setParameter('company', $company); |
|
| 54 | + if ($company) { |
|
| 55 | + $qb->andWhere('pe = :company')->setParameter('company', $company); |
|
| 56 | + } |
|
| 56 | 57 | |
| 57 | 58 | return $qb->getQuery()->getResult(); |
| 58 | 59 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function getPurchasingSuggestion(Request $request): JsonResponse |
| 26 | 26 | { |
| 27 | - $company = $this->entityManager->getRepository(People::class)->find($request->get('company')); |
|
| 27 | + $company = $this->entityManager->getRepository(People::class)->find($request->get('company')); |
|
| 28 | 28 | $data = $this->productService->getPurchasingSuggestion($company); |
| 29 | 29 | return new JsonResponse($data); |
| 30 | 30 | } |