fix(dashboard): 修正儀表板待處理數字邏輯與依賴更新
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 54s

This commit is contained in:
2026-02-13 14:29:21 +08:00
parent e141a45eb9
commit 77a7d31dc1
4 changed files with 405 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ use App\Modules\Inventory\Contracts\InventoryServiceInterface;
use App\Modules\Inventory\Models\Inventory;
use App\Modules\Inventory\Models\Warehouse;
use App\Modules\Inventory\Models\Product;
use App\Modules\Inventory\Models\InventoryTransferOrder;
use Illuminate\Support\Facades\DB;
class InventoryService implements InventoryServiceInterface
@@ -584,6 +585,8 @@ class InventoryService implements InventoryServiceInterface
'negativeCount' => $negativeCount,
'expiringCount' => $expiringCount,
'totalInventoryQuantity' => Inventory::sum('quantity'),
'totalInventoryValue' => Inventory::sum('total_value'),
'pendingTransferCount' => InventoryTransferOrder::whereIn('status', ['draft', 'dispatched'])->count(), // 新增:待處理調撥單
'abnormalItems' => $abnormalItems,
];
}

View File

@@ -26,7 +26,7 @@ class ProcurementService implements ProcurementServiceInterface
return [
'vendorsCount' => \App\Modules\Procurement\Models\Vendor::count(),
'purchaseOrdersCount' => PurchaseOrder::count(),
'pendingOrdersCount' => PurchaseOrder::where('status', 'pending')->count(),
'pendingOrdersCount' => PurchaseOrder::whereIn('status', ['approved', 'partial'])->count(), // 改為真正待進貨的狀態
];
}