@@ -87,13 +87,13 @@ |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * Gets the number of parts that are low in stock. |
|
| 91 | - * |
|
| 92 | - * That is, it's total amount is smaller than the minimal amount. |
|
| 93 | - * |
|
| 94 | - * @throws \Doctrine\ORM\NoResultException |
|
| 95 | - * @throws \Doctrine\ORM\NonUniqueResultException |
|
| 96 | - */ |
|
| 90 | + * Gets the number of parts that are low in stock. |
|
| 91 | + * |
|
| 92 | + * That is, it's total amount is smaller than the minimal amount. |
|
| 93 | + * |
|
| 94 | + * @throws \Doctrine\ORM\NoResultException |
|
| 95 | + * @throws \Doctrine\ORM\NonUniqueResultException |
|
| 96 | + */ |
|
| 97 | 97 | public function getPartCountWithLowStock(): int |
| 98 | 98 | { |
| 99 | 99 | /* Query to get total amount for every part. |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $optionsResolver->setAllowedTypes('search', ['null', 'string']); |
| 122 | 122 | |
| 123 | 123 | //Configure search options |
| 124 | - $optionsResolver->setDefault('search_options', static function (OptionsResolver $resolver): void { |
|
| 124 | + $optionsResolver->setDefault('search_options', static function(OptionsResolver $resolver): void { |
|
| 125 | 125 | $resolver->setDefaults([ |
| 126 | 126 | 'name' => true, |
| 127 | 127 | 'category' => true, |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $dataTable |
| 158 | 158 | ->add('picture', TextColumn::class, [ |
| 159 | 159 | 'label' => '', |
| 160 | - 'render' => function ($value, Part $context) { |
|
| 160 | + 'render' => function($value, Part $context) { |
|
| 161 | 161 | $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context); |
| 162 | 162 | if (null === $preview_attachment) { |
| 163 | 163 | return ''; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | ]) |
| 181 | 181 | ->add('name', TextColumn::class, [ |
| 182 | 182 | 'label' => $this->translator->trans('part.table.name'), |
| 183 | - 'render' => function ($value, Part $context) { |
|
| 183 | + 'render' => function($value, Part $context) { |
|
| 184 | 184 | return sprintf( |
| 185 | 185 | '<a href="%s">%s</a>', |
| 186 | 186 | $this->urlGenerator->infoURL($context), |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | ]) |
| 210 | 210 | ->add('storelocation', TextColumn::class, [ |
| 211 | 211 | 'label' => $this->translator->trans('part.table.storeLocations'), |
| 212 | - 'render' => function ($value, Part $context) { |
|
| 212 | + 'render' => function($value, Part $context) { |
|
| 213 | 213 | $tmp = []; |
| 214 | 214 | foreach ($context->getPartLots() as $lot) { |
| 215 | 215 | //Ignore lots without storelocation |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | ]) |
| 229 | 229 | ->add('amount', TextColumn::class, [ |
| 230 | 230 | 'label' => $this->translator->trans('part.table.amount'), |
| 231 | - 'render' => function ($value, Part $context) { |
|
| 231 | + 'render' => function($value, Part $context) { |
|
| 232 | 232 | $amount = $context->getAmountSum(); |
| 233 | 233 | |
| 234 | 234 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | ->add('minamount', TextColumn::class, [ |
| 238 | 238 | 'label' => $this->translator->trans('part.table.minamount'), |
| 239 | 239 | 'visible' => isset($options["lowstock"]), |
| 240 | - 'render' => function ($value, Part $context) { |
|
| 240 | + 'render' => function($value, Part $context) { |
|
| 241 | 241 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
| 242 | 242 | }, |
| 243 | 243 | ]) |
@@ -300,10 +300,10 @@ discard block |
||
| 300 | 300 | ->add('edit', IconLinkColumn::class, [ |
| 301 | 301 | 'label' => $this->translator->trans('part.table.edit'), |
| 302 | 302 | 'visible' => false, |
| 303 | - 'href' => function ($value, Part $context) { |
|
| 303 | + 'href' => function($value, Part $context) { |
|
| 304 | 304 | return $this->urlGenerator->editURL($context); |
| 305 | 305 | }, |
| 306 | - 'disabled' => function ($value, Part $context) { |
|
| 306 | + 'disabled' => function($value, Part $context) { |
|
| 307 | 307 | return !$this->security->isGranted('edit', $context); |
| 308 | 308 | }, |
| 309 | 309 | 'title' => $this->translator->trans('part.table.edit.title'), |
@@ -312,12 +312,12 @@ discard block |
||
| 312 | 312 | ->addOrderBy('name') |
| 313 | 313 | ->createAdapter(FetchJoinORMAdapter::class, [ |
| 314 | 314 | 'simple_total_query' => true, |
| 315 | - 'query' => function (QueryBuilder $builder): void { |
|
| 315 | + 'query' => function(QueryBuilder $builder): void { |
|
| 316 | 316 | $this->getQuery($builder); |
| 317 | 317 | }, |
| 318 | 318 | 'entity' => Part::class, |
| 319 | 319 | 'criteria' => [ |
| 320 | - function (QueryBuilder $builder) use ($options): void { |
|
| 320 | + function(QueryBuilder $builder) use ($options): void { |
|
| 321 | 321 | $this->buildCriteria($builder, $options); |
| 322 | 322 | }, |
| 323 | 323 | new SearchCriteriaProvider(), |