refactor:영업파트너 고객관리 테이블 정리 + 정산관리에 수당지급일 관리 이동
- 고객관리 테이블: 1차수당/2차수당/매니저수당/협업지원금/등록일 열 제거, 계약일 열 추가 (16열→12열) - 정산관리 수당정산 테이블: 수당지급일/매니저지급일/협업지원금 인라인 편집 컬럼 추가 - SalesCommissionController에 updateCommissionDate 메서드 추가 - 불필요한 JS 함수 제거 (saveReferrerCommission, checkHandoverStatus) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -253,6 +253,29 @@ public function cancel(int $id): JsonResponse
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 수당지급일/협업지원금 인라인 수정
|
||||
*/
|
||||
public function updateCommissionDate(int $id, Request $request): JsonResponse
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'field' => 'required|in:first_partner_paid_at,second_partner_paid_at,manager_paid_at,referrer_commission',
|
||||
'value' => 'nullable',
|
||||
]);
|
||||
|
||||
$commission = SalesCommission::findOrFail($id);
|
||||
|
||||
// 수당지급일은 인계 상태일 때만 변경 가능
|
||||
$paidFields = ['first_partner_paid_at', 'second_partner_paid_at', 'manager_paid_at'];
|
||||
if (in_array($validated['field'], $paidFields) && $commission->management?->hq_status !== 'handover') {
|
||||
return response()->json(['success' => false, 'message' => '인계 상태일 때만 수당지급일 설정 가능'], 422);
|
||||
}
|
||||
|
||||
$commission->update([$validated['field'] => $validated['value'] ?: null]);
|
||||
|
||||
return response()->json(['success' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 정산 테이블 부분 새로고침 (HTMX)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user