diff --git a/app/Services/System/AnalysisService.php b/app/Services/System/AnalysisService.php index c329c55..74cb8c8 100644 --- a/app/Services/System/AnalysisService.php +++ b/app/Services/System/AnalysisService.php @@ -3,6 +3,7 @@ namespace App\Services\System; use App\Enums\OrderStatus; +use App\Enums\PriceType; use App\Enums\Role; use App\Models\Attendance; use App\Models\CashAccount; @@ -553,6 +554,9 @@ public function getProductStock(): array $totalValue = \DB::table('product_prices') ->join('product_variants', 'product_prices.variant_id', '=', 'product_variants.id') + ->where('product_prices.type', PriceType::HARGA_MODAL->value) + ->whereNull('product_variants.deleted_at') + ->whereNull('product_prices.deleted_at') ->selectRaw('SUM(product_variants.stock * product_prices.price) as total') ->value('total');