fix: 수주 선택 모달 필터링 조건 수정
- Order 모델에 workOrders 관계 추가 - OrderService에 for_work_order 파라미터 처리 추가 - DRAFT 상태 & 작업지시 미생성 수주만 조회 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Models\Orders;
|
||||
|
||||
use App\Models\Items\Item;
|
||||
use App\Models\Production\WorkOrder;
|
||||
use App\Models\Quote\Quote;
|
||||
use App\Traits\BelongsToTenant;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -132,6 +133,14 @@ public function item(): BelongsTo
|
||||
return $this->belongsTo(Item::class, 'item_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 작업지시 목록
|
||||
*/
|
||||
public function workOrders(): HasMany
|
||||
{
|
||||
return $this->hasMany(WorkOrder::class, 'sales_order_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 품목들로부터 금액 합계 재계산
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user