feat: remove global scope for ordered in raw material and product stock queries
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (8.3) (push) Waiting to run
tests / ci (8.4) (push) Waiting to run
tests / ci (8.5) (push) Waiting to run

This commit is contained in:
Yoga Pangestu 2026-07-30 15:57:30 +07:00
parent 636508c5c0
commit 11557d0b85

View File

@ -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('