fix:지급대상 개발비 계산 및 명칭 변경

- "총 개발비" → "지급대상 개발비"로 명칭 변경
- 지급대상 개발비 = 개발 진행 중 + 인계완료 중 지급 미완료
- 지급 완료된 건의 개발비는 제외
- $stats['target_development_fee'] 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-03 16:31:07 +09:00
parent 6fadb3f095
commit 5a7bfc2f46
2 changed files with 17 additions and 3 deletions

View File

@@ -273,6 +273,20 @@ private function getDashboardData(Request $request): array
// 총 예상 수당 (지급 완료 제외)
$totalExpectedCommission = $expectedFromDevInProgress + $expectedFromHandover;
// 지급대상 개발비 총액 (개발 진행 중 + 인계 완료 중 지급 미완료)
// 지급 완료된 건의 개발비는 제외
$paidManagementIds = $myCommissionsAsPartner
->where('status', SalesCommission::STATUS_PAID)
->pluck('management_id')
->toArray();
$unpaidHandoverRegFee = SalesContractProduct::whereIn('management_id', $handoverManagementIds)
->whereNotIn('management_id', $paidManagementIds)
->sum('registration_fee');
$targetDevelopmentFee = $devInProgressRegFee + $unpaidHandoverRegFee;
// stats 업데이트
$stats['target_development_fee'] = $targetDevelopmentFee;
// 1차/2차 수당 지급 현황 계산 (예상 수당 기반)
$commissionSummary = $this->calculateExpectedCommissionSummary(
$myCommissionsAsPartner,