diff --git a/app/Http/Requests/Order/UpdateOrderRequest.php b/app/Http/Requests/Order/UpdateOrderRequest.php index ae9db234..2a2b17be 100644 --- a/app/Http/Requests/Order/UpdateOrderRequest.php +++ b/app/Http/Requests/Order/UpdateOrderRequest.php @@ -66,7 +66,7 @@ public function rules(): array 'items' => 'nullable|array', 'items.*.item_id' => 'nullable|integer|exists:items,id', 'items.*.item_code' => 'nullable|string|max:50', - 'items.*.item_name' => 'required|string|max:200', + 'items.*.item_name' => 'sometimes|required|string|max:200', 'items.*.specification' => 'nullable|string|max:500', 'items.*.quantity' => 'required|numeric|min:0', 'items.*.unit' => 'nullable|string|max:20', diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index 79411dc2..4cf71153 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -135,6 +135,8 @@ public function stats(?string $orderType = null): array 'draft' => $counts[Order::STATUS_DRAFT] ?? 0, 'confirmed' => $counts[Order::STATUS_CONFIRMED] ?? 0, 'in_progress' => $counts[Order::STATUS_IN_PROGRESS] ?? 0, + 'in_production' => $counts[Order::STATUS_IN_PRODUCTION] ?? 0, + 'produced' => $counts[Order::STATUS_PRODUCED] ?? 0, 'completed' => $counts[Order::STATUS_COMPLETED] ?? 0, 'cancelled' => $counts[Order::STATUS_CANCELLED] ?? 0, 'total_amount' => array_sum($amounts),