fix double slack notification

This commit is contained in:
Marko
2024-03-22 14:21:13 +01:00
parent 0bc2024494
commit fb293a6b9a

View File

@@ -110,6 +110,8 @@ class SlackNotifySubscriber implements EventSubscriberInterface
if ($stock) { if ($stock) {
$prio = 0; $prio = 0;
foreach ($stock as $item) { foreach ($stock as $item) {
//Nur wenn Bestand vorhanden
if ($item->getInstock() > 0) {
$w = $this->warehouseRepository->findOneBy(['id' => $item->getWarehouse()->getId()]); $w = $this->warehouseRepository->findOneBy(['id' => $item->getWarehouse()->getId()]);
if ($w->getPrio() > $prio) { if ($w->getPrio() > $prio) {
@@ -119,6 +121,7 @@ class SlackNotifySubscriber implements EventSubscriberInterface
} }
} }
} }
}
return $warehouse; return $warehouse;