Fixes for inventory notifications

This commit is contained in:
David Bomba 2022-09-02 21:26:59 +10:00
parent a963fe1aee
commit 6a60c89b38

View File

@ -80,9 +80,9 @@ class AdjustProductInventory implements ShouldQueue
$p->in_stock_quantity -= $item->quantity;
$p->saveQuietly();
if ($p->stock_notification_threshold && $p->in_stock_quantity <= $p->stock_notification_threshold) {
if ($this->company->stock_notification && $p->stock_notification && $p->stock_notification_threshold && $p->in_stock_quantity <= $p->stock_notification_threshold) {
$this->notifyStockLevels($p, 'product');
} elseif ($this->company->stock_notification_threshold && $p->in_stock_quantity <= $this->company->stock_notification_threshold) {
} elseif ($this->company->stock_notification && $p->stock_notification && $this->company->inventory_notification_threshold && $p->in_stock_quantity <= $this->company->inventory_notification_threshold) {
$this->notifyStocklevels($p, 'company');
}
}