fix: [production-orders,order] 생산지시 목록 최적화 + 진행률 컬럼 수정 + 중복체크 취소 건 제외

This commit is contained in:
2026-03-18 09:22:41 +09:00
parent 783a41dc82
commit 26e33fdc13
2 changed files with 62 additions and 28 deletions

View File

@@ -1286,9 +1286,10 @@ public function createProductionOrder(int $orderId, array $data)
throw new BadRequestHttpException(__('error.order.must_be_confirmed_for_production'));
}
// 이미 생산지시가 존재하는지 확인
// 이미 활성 생산지시가 존재하는지 확인 (취소된 건 제외)
$existingWorkOrder = WorkOrder::where('tenant_id', $tenantId)
->where('sales_order_id', $orderId)
->where('status', '!=', WorkOrder::STATUS_CANCELLED)
->first();
if ($existingWorkOrder) {