Fix error with spec of product under limit

This commit is contained in:
2026-05-26 10:25:05 +01:00
parent 3cb619cfa6
commit 57646a1417
@@ -8,7 +8,7 @@ public sealed class GetProductsUnderLimitSpec : Specification<Product>
public GetProductsUnderLimitSpec() public GetProductsUnderLimitSpec()
{ {
Query Query
.Include(p => p.QuotationProducts) .Include(x => x.WarehouseProducts)
.Where(p => p.QuotationProducts != null && p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity)); .Where(x => x.WarehouseProducts != null && x.WarehouseProducts.Sum(p => p.Quantity) < x.MinimalQuantity);
} }
} }