diff --git a/app/Services/System/AnalysisService.php b/app/Services/System/AnalysisService.php index c229a1e..abf8b4e 100644 --- a/app/Services/System/AnalysisService.php +++ b/app/Services/System/AnalysisService.php @@ -709,6 +709,7 @@ public function getProfitMetrics(?Carbon $startDate = null, ?Carbon $endDate = n public function getRawMaterialStock(): array { $prices = RawMaterialPrice::query() + ->withoutGlobalScope('ordered') ->join('raw_materials', 'raw_material_prices.raw_material_id', '=', 'raw_materials.id') ->selectRaw(' raw_materials.unit, @@ -736,6 +737,7 @@ public function getRawMaterialStock(): array public function getProductStock(): array { $variants = ProductVariant::query() + ->withoutGlobalScope('ordered') ->join('products', 'product_variants.product_id', '=', 'products.id') ->where('products.status', ProductStatus::ACTIVE) ->selectRaw('