Finalize commission display: Remove educator 3% and replace with menu collaborator
This commit is contained in:
@@ -188,9 +188,9 @@
|
||||
const educatorContracts = generateContracts(Math.floor(Math.random() * 5) + 1); // 2차 하위
|
||||
|
||||
// 역할 구분 추가
|
||||
directContracts.forEach(c => c.role = 'direct'); // 직접 판매 20%
|
||||
managerContracts.forEach(c => c.role = 'manager'); // 관리자 5%
|
||||
educatorContracts.forEach(c => c.role = 'educator'); // 교육자 3%
|
||||
directContracts.forEach(c => c.role = 'direct'); // 판매자
|
||||
managerContracts.forEach(c => c.role = 'manager'); // 관리자
|
||||
educatorContracts.forEach(c => c.role = 'educator'); // 메뉴제작 협업자
|
||||
|
||||
const allContracts = [...directContracts, ...managerContracts, ...educatorContracts];
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
// 역할별 수당
|
||||
const directCommission = directSales * 0.20;
|
||||
const managerCommission = managerSales * 0.05;
|
||||
const educatorCommission = educatorSales * 0.03;
|
||||
const educatorCommission = 0; // 메뉴제작 협업수당: 운영팀 별도 산정
|
||||
const totalCommission = directCommission + managerCommission + educatorCommission;
|
||||
|
||||
// 당월 필터링
|
||||
@@ -219,7 +219,7 @@
|
||||
const monthlyManagerSales = currentMonthContracts.filter(c => c.role === 'manager').reduce((sum, c) => sum + c.amount, 0);
|
||||
const monthlyEducatorSales = currentMonthContracts.filter(c => c.role === 'educator').reduce((sum, c) => sum + c.amount, 0);
|
||||
const monthlySales = monthlyDirectSales + monthlyManagerSales + monthlyEducatorSales;
|
||||
const monthlyCommission = (monthlyDirectSales * 0.20) + (monthlyManagerSales * 0.05) + (monthlyEducatorSales * 0.03);
|
||||
const monthlyCommission = (monthlyDirectSales * 0.20) + (monthlyManagerSales * 0.05); // 메뉴제작 협업수당 제외
|
||||
|
||||
// 지난달 필터링
|
||||
const lastMonth = currentMonth === 0 ? 11 : currentMonth - 1;
|
||||
@@ -233,7 +233,7 @@
|
||||
const lastMonthManagerSales = lastMonthContracts.filter(c => c.role === 'manager').reduce((sum, c) => sum + c.amount, 0);
|
||||
const lastMonthEducatorSales = lastMonthContracts.filter(c => c.role === 'educator').reduce((sum, c) => sum + c.amount, 0);
|
||||
const lastMonthSales = lastMonthDirectSales + lastMonthManagerSales + lastMonthEducatorSales;
|
||||
const lastMonthCommission = (lastMonthDirectSales * 0.20) + (lastMonthManagerSales * 0.05) + (lastMonthEducatorSales * 0.03);
|
||||
const lastMonthCommission = (lastMonthDirectSales * 0.20) + (lastMonthManagerSales * 0.05); // 메뉴제작 협업수당 제외
|
||||
|
||||
return {
|
||||
id: idx + 1,
|
||||
@@ -393,11 +393,11 @@
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div className="bg-gradient-to-br from-green-50 to-emerald-50 rounded-lg p-4 border border-green-200">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<span className="text-sm font-medium text-green-900">직접 판매</span>
|
||||
<span className="text-sm font-medium text-green-900">판매자</span>
|
||||
<span className="text-xs font-bold text-green-700 bg-green-100 px-2 py-1 rounded">20%</span>
|
||||
</div>
|
||||
<div className="text-lg font-bold text-green-900">{formatCurrency(selectedManager.directCommission)}</div>
|
||||
<div className="text-xs text-green-600 mt-1">{formatCurrency(selectedManager.directSales)} × 20%</div>
|
||||
<div className="text-xs text-green-600 mt-1"></div>
|
||||
</div>
|
||||
<div className="bg-gradient-to-br from-purple-50 to-violet-50 rounded-lg p-4 border border-purple-200">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
@@ -405,15 +405,15 @@
|
||||
<span className="text-xs font-bold text-purple-700 bg-purple-100 px-2 py-1 rounded">5%</span>
|
||||
</div>
|
||||
<div className="text-lg font-bold text-purple-900">{formatCurrency(selectedManager.managerCommission)}</div>
|
||||
<div className="text-xs text-purple-600 mt-1">{formatCurrency(selectedManager.managerSales)} × 5%</div>
|
||||
<div className="text-xs text-purple-600 mt-1"></div>
|
||||
</div>
|
||||
<div className="bg-gradient-to-br from-orange-50 to-amber-50 rounded-lg p-4 border border-orange-200">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<span className="text-sm font-medium text-orange-900">교육자 수당</span>
|
||||
<span className="text-xs font-bold text-orange-700 bg-orange-100 px-2 py-1 rounded">3%</span>
|
||||
<span className="text-sm font-medium text-orange-900">메뉴제작 협업수당</span>
|
||||
<span className="text-xs font-bold text-orange-700 bg-orange-100 px-2 py-1 rounded">별도</span>
|
||||
</div>
|
||||
<div className="text-lg font-bold text-orange-900">{formatCurrency(selectedManager.educatorCommission)}</div>
|
||||
<div className="text-xs text-orange-600 mt-1">{formatCurrency(selectedManager.educatorSales)} × 3%</div>
|
||||
<div className="text-lg font-bold text-orange-900">운영팀 산정</div>
|
||||
<div className="text-xs text-orange-600 mt-1"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -434,9 +434,9 @@
|
||||
<tbody className="divide-y divide-slate-100">
|
||||
{selectedManager.contracts && selectedManager.contracts.map((contract, idx) => {
|
||||
const getRoleName = (role) => {
|
||||
if (role === 'direct') return '직접 판매';
|
||||
if (role === 'direct') return '판매자';
|
||||
if (role === 'manager') return '관리자';
|
||||
if (role === 'educator') return '교육자';
|
||||
if (role === 'educator') return '메뉴제작 협업자';
|
||||
return '-';
|
||||
};
|
||||
|
||||
@@ -450,7 +450,7 @@
|
||||
const getCommissionRate = (role) => {
|
||||
if (role === 'direct') return 0.20;
|
||||
if (role === 'manager') return 0.05;
|
||||
if (role === 'educator') return 0.03;
|
||||
if (role === 'educator') return 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
@@ -467,7 +467,9 @@
|
||||
</span>
|
||||
</td>
|
||||
<td className="px-6 py-4 text-right font-medium text-slate-900">{formatCurrency(contract.amount)}</td>
|
||||
<td className="px-6 py-4 text-right font-bold text-blue-600">{formatCurrency(commission)}</td>
|
||||
<td className="px-6 py-4 text-right font-bold text-blue-600">
|
||||
{contract.role === 'educator' ? '운영팀 산정' : formatCurrency(commission)}
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
@@ -513,8 +515,8 @@
|
||||
<span className="text-slate-500">총 가입비</span>
|
||||
<span className="font-medium text-slate-900">{formatCurrency(manager.totalSales)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between text-xs">
|
||||
<span className="text-green-600">└ 직접 판매 (20%)</span>
|
||||
<div className="flex justify-between text-xs">
|
||||
<span className="text-green-600">└ 판매자 (20%)</span>
|
||||
<span className="font-medium text-green-700">{formatCurrency(manager.directCommission)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between text-xs">
|
||||
@@ -522,7 +524,7 @@
|
||||
<span className="font-medium text-purple-700">{formatCurrency(manager.managerCommission)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between text-xs pb-2 border-b border-slate-200">
|
||||
<span className="text-orange-600">└ 교육자 (3%)</span>
|
||||
<span className="text-orange-600">└ 메뉴제작 협업자 (별도)</span>
|
||||
<span className="font-medium text-orange-700">{formatCurrency(manager.educatorCommission)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between text-sm font-bold">
|
||||
@@ -969,8 +971,8 @@
|
||||
const totalSales = contractsData.reduce((sum, c) => sum + c.amount, 0);
|
||||
const contractCount = contractsData.length;
|
||||
|
||||
// 내 조직(Depth 0) 입장에서 Depth 2는 교육자 수당 3%
|
||||
const commission = totalSales * 0.03;
|
||||
// 내 조직(Depth 0) 입장에서 Depth 2는 메뉴제작 협업수당 (별도 산정)
|
||||
const commission = 0;
|
||||
|
||||
return {
|
||||
id: `l2-${Date.now()}-${i}`,
|
||||
@@ -1027,7 +1029,7 @@
|
||||
id: 'root-direct',
|
||||
name: '내 직접 판매',
|
||||
depth: 0,
|
||||
role: '직접 판매',
|
||||
role: '판매자',
|
||||
isDirect: true,
|
||||
totalSales: ownSales,
|
||||
contractCount: ownContracts,
|
||||
@@ -1041,15 +1043,15 @@
|
||||
// 1차 하위의 직접 판매 (관리자 수당 5%)
|
||||
const level1DirectSales = level1Children.reduce((sum, c) => sum + c.totalSales, 0);
|
||||
|
||||
// 2차 하위의 판매 (교육자 수당 3%)
|
||||
// 2차 하위의 판매 (메뉴제작 협업수당 별도)
|
||||
const level2Sales = level1Children.reduce((sum, c) =>
|
||||
c.children.reduce((s, gc) => s + gc.totalSales, 0), 0);
|
||||
|
||||
const totalSales = ownSales + level1DirectSales;
|
||||
const contractCount = ownContracts + level1Children.reduce((sum, c) => sum + c.contractCount, 0);
|
||||
|
||||
// 내 조직의 총 수당: 직접 판매 20% + 1차 하위 5% + 2차 하위 3%
|
||||
const commission = (ownSales * 0.20) + (level1DirectSales * 0.05) + (level2Sales * 0.03);
|
||||
// 내 조직의 총 수당: 직접 판매 20% + 1차 하위 5% (메뉴제작 협업수당 별도)
|
||||
const commission = (ownSales * 0.20) + (level1DirectSales * 0.05);
|
||||
|
||||
const orgData = {
|
||||
id: 'root',
|
||||
@@ -1096,19 +1098,19 @@
|
||||
educatorCommission: 0
|
||||
};
|
||||
|
||||
// 직접 판매 (20%)
|
||||
// 판매자 (20%)
|
||||
const myDirectSales = orgData.children.find(c => c.isDirect);
|
||||
const sellerCommission = myDirectSales ? myDirectSales.totalSales * 0.20 : 0;
|
||||
|
||||
// 1차 하위 (5%)
|
||||
// 관리자 (5%)
|
||||
const level1Children = orgData.children.filter(c => !c.isDirect && c.depth === 1);
|
||||
const level1Sales = level1Children.reduce((sum, c) => sum + c.totalSales, 0);
|
||||
const managerCommission = level1Sales * 0.05;
|
||||
|
||||
// 2차 하위 (3%)
|
||||
// 메뉴제작 협업자 (별도)
|
||||
const level2Sales = level1Children.reduce((sum, c) =>
|
||||
c.children.reduce((s, gc) => s + gc.totalSales, 0), 0);
|
||||
const educatorCommission = level2Sales * 0.03;
|
||||
const educatorCommission = 0; // 메뉴제작 협업수당 별도
|
||||
|
||||
return {
|
||||
totalRevenue: orgData.totalSales,
|
||||
@@ -1234,7 +1236,7 @@
|
||||
|
||||
const level2Sales = level1Children.reduce((sum, c) =>
|
||||
c.children.reduce((s, gc) => s + gc.totalSales, 0), 0);
|
||||
const educatorCommission = level2Sales * 0.03;
|
||||
const educatorCommission = 0; // 메뉴제작 협업수당: 운영팀 별도 산정
|
||||
|
||||
const totalCommission = sellerCommission + managerCommission + educatorCommission;
|
||||
|
||||
@@ -1291,21 +1293,21 @@
|
||||
// 직접 판매
|
||||
if (node.depth === 0) commission = ownSales * 0.20;
|
||||
else if (node.depth === 1) commission = ownSales * 0.05;
|
||||
else if (node.depth === 2) commission = ownSales * 0.03;
|
||||
else if (node.depth === 2) commission = 0; // 메뉴제작 협업수당: 운영팀 별도 산정
|
||||
} else {
|
||||
// 영업관리
|
||||
if (node.depth === 0) {
|
||||
// 내 조직: 직접 20% + 1차 하위 5% + 2차 하위 3%
|
||||
// 내 조직: 직접 20% + 1차 하위 5% (메뉴제작 협업수당 별도)
|
||||
const myDirect = filteredChildren.find(c => c.isDirect);
|
||||
const level1 = filteredChildren.filter(c => !c.isDirect && c.depth === 1);
|
||||
const level1Sales = level1.reduce((sum, c) => sum + c.totalSales, 0);
|
||||
const level2Sales = level1.reduce((sum, c) =>
|
||||
c.children.reduce((s, gc) => s + gc.totalSales, 0), 0);
|
||||
commission = (myDirect ? myDirect.totalSales * 0.20 : 0) + (level1Sales * 0.05) + (level2Sales * 0.03);
|
||||
commission = (myDirect ? myDirect.totalSales * 0.20 : 0) + (level1Sales * 0.05); // 메뉴제작 협업수당 제외
|
||||
} else if (node.depth === 1) {
|
||||
commission = totalSales * 0.05;
|
||||
} else if (node.depth === 2) {
|
||||
commission = totalSales * 0.03;
|
||||
commission = 0; // 메뉴제작 협업수당: 운영팀 별도 산정
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1490,12 +1492,12 @@
|
||||
<div className="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center">
|
||||
<LucideIcon name="user" className="w-4 h-4 text-green-600" />
|
||||
</div>
|
||||
<span className="text-sm font-medium text-green-900">판매자 수당</span>
|
||||
<span className="text-sm font-medium text-green-900">판매자</span>
|
||||
</div>
|
||||
<span className="text-xs font-bold text-green-700 bg-green-100 px-2 py-1 rounded">20%</span>
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-green-900">{formatCurrency(periodStats.sellerCommission)}</div>
|
||||
<div className="text-xs text-green-600 mt-1">직접 판매 수당</div>
|
||||
<div className="text-xs text-green-600 mt-1"></div>
|
||||
</div>
|
||||
|
||||
<div className="p-4 bg-gradient-to-br from-purple-50 to-violet-50 rounded-lg border border-purple-200">
|
||||
@@ -1504,43 +1506,37 @@
|
||||
<div className="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center">
|
||||
<LucideIcon name="users" className="w-4 h-4 text-purple-600" />
|
||||
</div>
|
||||
<span className="text-sm font-medium text-purple-900">관리자 수당</span>
|
||||
<span className="text-sm font-medium text-purple-900">관리자</span>
|
||||
</div>
|
||||
<span className="text-xs font-bold text-purple-700 bg-purple-100 px-2 py-1 rounded">5%</span>
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-purple-900">{formatCurrency(periodStats.managerCommission)}</div>
|
||||
<div className="text-xs text-purple-600 mt-1">1차 하위 관리 수당</div>
|
||||
<div className="text-xs text-purple-600 mt-1"></div>
|
||||
</div>
|
||||
|
||||
<div className="p-4 bg-gradient-to-br from-orange-50 to-amber-50 rounded-lg border border-orange-200">
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="w-8 h-8 rounded-full bg-orange-100 flex items-center justify-center">
|
||||
<LucideIcon name="graduation-cap" className="w-4 h-4 text-orange-600" />
|
||||
<LucideIcon name="users" className="w-4 h-4 text-orange-600" />
|
||||
</div>
|
||||
<span className="text-sm font-medium text-orange-900">교육자 수당</span>
|
||||
<span className="text-sm font-medium text-orange-900">메뉴제작 협업수당</span>
|
||||
</div>
|
||||
<span className="text-xs font-bold text-orange-700 bg-orange-100 px-2 py-1 rounded">3%</span>
|
||||
<span className="text-xs font-bold text-orange-700 bg-orange-100 px-2 py-1 rounded">별도</span>
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-orange-900">{formatCurrency(periodStats.educatorCommission)}</div>
|
||||
<div className="text-xs text-orange-600 mt-1">2차 하위 교육 수당</div>
|
||||
<div className="text-2xl font-bold text-orange-900">운영팀 산정</div>
|
||||
<div className="text-xs text-orange-600 mt-1"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 p-4 bg-blue-50 rounded-lg border border-blue-200">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<i data-lucide="info" className="w-4 h-4 text-blue-600"></i>
|
||||
<span className="text-sm text-blue-800">
|
||||
<strong>판매자</strong>는 직접 판매, <strong>관리자</strong>는 하위 1단계, <strong>교육자</strong>는 하위 2단계 실적에서 수당 지급
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-end">
|
||||
<div className="text-right">
|
||||
<div className="text-sm font-bold text-blue-900">{formatCurrency(periodStats.totalCommission)}</div>
|
||||
<div className="text-xs text-blue-600">총 가입비의 {periodStats.commissionRate}%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-xs text-blue-600">총 가입비 대비 수당</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* 기간별 조직 트리 */}
|
||||
@@ -1639,7 +1635,7 @@
|
||||
{node.depth === 0 && !isDirect ? (
|
||||
<span>내 총 수당: <strong className="text-blue-600">{formatCurrency(node.commission)}</strong></span>
|
||||
) : (
|
||||
<span title={`내가 받는 ${isDirect ? (node.depth === 0 ? '직접판매(20%)' : node.depth === 1 ? '관리자(5%)' : '교육자(3%)') : (node.depth === 1 ? '관리자(5%)' : '교육자(3%)')} 수당`}>
|
||||
<span title={`내가 받는 ${isDirect ? (node.depth === 0 ? '판매자 (20%)' : node.depth === 1 ? '관리자 (5%)' : '메뉴제작 협업자') : (node.depth === 1 ? '관리자 (5%)' : '메뉴제작 협업자')} 수당`}>
|
||||
내 수당: <strong className="text-blue-600">{formatCurrency(node.commission)}</strong>
|
||||
</span>
|
||||
)}
|
||||
@@ -1710,13 +1706,13 @@
|
||||
|
||||
<div className="flex gap-2 text-xs">
|
||||
<div className="px-3 py-1.5 bg-blue-100 text-blue-800 rounded-full font-medium">
|
||||
직접 판매: 내 수당 20%
|
||||
판매자 (20%)
|
||||
</div>
|
||||
<div className="px-3 py-1.5 bg-green-100 text-green-800 rounded-full font-medium">
|
||||
직속 하위: 내 수당 5%
|
||||
관리자 (5%)
|
||||
</div>
|
||||
<div className="px-3 py-1.5 bg-purple-100 text-purple-800 rounded-full font-medium">
|
||||
2차 하위: 내 수당 3%
|
||||
메뉴제작 협업자 (별도)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1902,7 +1898,7 @@
|
||||
<section>
|
||||
<h4 className="text-base font-bold text-slate-900 mb-2">1. 수당 체계 개요</h4>
|
||||
<p className="mb-3">영업 수당은 <strong>가입비</strong>에 대해서만 지급됩니다.</p>
|
||||
<p>수당은 판매자와 그 상위 관리자, 교육자에게 차등 지급됩니다.</p>
|
||||
<p>수당은 판매자와 그 상위 관리자, 메뉴제작 협업자에게 지급됩니다.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -1911,7 +1907,7 @@
|
||||
<ul className="list-disc pl-5 space-y-2">
|
||||
<li><strong>판매자 (Seller)</strong>: 직접 영업을 성사시킨 담당자 - <span className="text-blue-600 font-semibold">가입비의 20%</span></li>
|
||||
<li><strong>관리자 (Manager)</strong>: 판매자를 데려온 상위 담당자 - <span className="text-green-600 font-semibold">가입비의 5%</span></li>
|
||||
<li><strong>교육자 (Educator)</strong>: 관리자를 데려온 상위 담당자 - <span className="text-purple-600 font-semibold">가입비의 3%</span></li>
|
||||
<li><strong>메뉴제작 협업자 (Collaborator)</strong>: 관리자를 데려온 상위 담당자 - <span className="text-purple-600 font-semibold">운영팀 별도 산정</span></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
@@ -1935,8 +1931,8 @@
|
||||
<td className="py-2 text-green-600 font-bold">5%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="py-2 font-medium">교육자</td>
|
||||
<td className="py-2 text-purple-600 font-bold">3%</td>
|
||||
<td className="py-2 font-medium">메뉴제작 협업자</td>
|
||||
<td className="py-2 text-purple-600 font-bold">별도 산정</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1953,7 +1949,7 @@
|
||||
<ul className="list-disc pl-5 mt-2 space-y-1">
|
||||
<li><strong>C (판매자)</strong>: 가입비의 20% 수당</li>
|
||||
<li><strong>B (관리자)</strong>: 가입비의 5% 수당</li>
|
||||
<li><strong>A (교육자)</strong>: 가입비의 3% 수당</li>
|
||||
<li><strong>A (메뉴제작 협업자)</strong>: 운영팀 별도 산정</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1971,7 +1967,7 @@
|
||||
|
||||
<section>
|
||||
<h4 className="text-base font-bold text-slate-900 mb-2">6. 회사 마진</h4>
|
||||
<p>가입비에서 총 수당(최대 28%)을 제외한 금액이 회사 마진으로 귀속됩니다.</p>
|
||||
<p>가입비에서 영업 수당(총 25%)을 제외한 금액이 회사 마진으로 귀속됩니다. (메뉴제작 협업수당은 별도)</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -2056,11 +2052,11 @@
|
||||
const price = getItemPrice('model', modelId, model.join_fee, model.subscription_fee);
|
||||
totalJoinFee += price.join_fee || 0;
|
||||
|
||||
// 가입비에 대한 수당만 계산: 판매자 20%, 관리자 5%, 교육자 3%
|
||||
const rates = model.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0.03 } };
|
||||
// 가입비에 대한 수당만 계산: 판매자 20%, 관리자 5%, 메뉴제작 협업수당 별도
|
||||
const rates = model.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0 } };
|
||||
totalSellerCommission += (price.join_fee * (rates.seller.join || 0.20));
|
||||
totalManagerCommission += (price.join_fee * (rates.manager.join || 0.05));
|
||||
totalEducatorCommission += (price.join_fee * (rates.educator?.join || 0.03));
|
||||
totalEducatorCommission += 0; // 운영팀 별도 산정
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2070,10 +2066,10 @@
|
||||
const price = getItemPrice('package', 'construction_management', constructionPackage.join_fee, constructionPackage.subscription_fee);
|
||||
totalJoinFee += price.join_fee || 0;
|
||||
|
||||
const rates = constructionPackage.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0.03 } };
|
||||
const rates = constructionPackage.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0 } };
|
||||
totalSellerCommission += (price.join_fee * (rates.seller.join || 0.20));
|
||||
totalManagerCommission += (price.join_fee * (rates.manager.join || 0.05));
|
||||
totalEducatorCommission += (price.join_fee * (rates.educator?.join || 0.03));
|
||||
totalEducatorCommission += 0;
|
||||
}
|
||||
|
||||
// 공정/정부지원사업 패키지
|
||||
@@ -2081,10 +2077,10 @@
|
||||
const price = getItemPrice('package', 'process_government', processGovPackage.join_fee, processGovPackage.subscription_fee);
|
||||
totalJoinFee += price.join_fee || 0;
|
||||
|
||||
const rates = processGovPackage.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0.03 } };
|
||||
const rates = processGovPackage.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0 } };
|
||||
totalSellerCommission += (price.join_fee * (rates.seller.join || 0.20));
|
||||
totalManagerCommission += (price.join_fee * (rates.manager.join || 0.05));
|
||||
totalEducatorCommission += (price.join_fee * (rates.educator?.join || 0.03));
|
||||
totalEducatorCommission += 0;
|
||||
}
|
||||
|
||||
const totalCommission = totalSellerCommission + totalManagerCommission + totalEducatorCommission;
|
||||
@@ -2350,8 +2346,8 @@
|
||||
<span className="font-bold text-slate-900">{formatCurrency(totalManagerCommission)}</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center p-3 bg-slate-50 rounded-lg">
|
||||
<span className="text-slate-600">교육자 수당 (3%)</span>
|
||||
<span className="font-bold text-slate-900">{formatCurrency(totalEducatorCommission)}</span>
|
||||
<span className="text-slate-600">메뉴제작 협업수당</span>
|
||||
<span className="font-bold text-slate-900">운영팀 별도 산정</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2522,8 +2518,8 @@
|
||||
</div>
|
||||
|
||||
<div className="border-l-4 border-purple-500 pl-3">
|
||||
<h5 className="font-semibold text-slate-900 mb-1">교육자 수당 (3%)</h5>
|
||||
<p className="text-xs text-slate-600">가입비 × 3%</p>
|
||||
<h5 className="font-semibold text-slate-900 mb-1">메뉴제작 협업수당</h5>
|
||||
<p className="text-xs text-slate-600">운영팀 별도 산정</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2533,8 +2529,8 @@
|
||||
<ul className="list-disc pl-5 space-y-1 text-xs text-blue-800">
|
||||
<li>판매자 수당: 100만원 × 20% = 20만원</li>
|
||||
<li>관리자 수당: 100만원 × 5% = 5만원</li>
|
||||
<li>교육자 수당: 100만원 × 3% = 3만원</li>
|
||||
<li>총 수당: 28만원 (가입비의 28%)</li>
|
||||
<li>메뉴제작 협업수당: 운영팀 별도 산정</li>
|
||||
<li>총 수당: 25만원 + 메뉴제작 협업수당</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2550,7 +2546,7 @@
|
||||
<ul className="list-disc pl-5 space-y-1 text-sm text-blue-900">
|
||||
<li><strong>판매자:</strong> 직접 영업을 성사시킨 담당자</li>
|
||||
<li><strong>관리자:</strong> 판매자를 데려온 상위 담당자</li>
|
||||
<li><strong>교육자:</strong> 관리자를 데려온 상위 담당자</li>
|
||||
<li><strong>메뉴제작 협업자:</strong> 관리자를 데려온 상위 담당자</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
@@ -2647,7 +2643,7 @@
|
||||
if (!record) return null;
|
||||
|
||||
const program = programs.find(p => p.id === record.program_id);
|
||||
const rates = program?.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0.03 } };
|
||||
const rates = program?.commission_rates || { seller: { join: 0.20 }, manager: { join: 0.05 }, educator: { join: 0 } };
|
||||
|
||||
// Calculations (구독료 제거, 가입비에 대한 수당만 계산)
|
||||
const joinFee = record.join_fee;
|
||||
@@ -2662,12 +2658,12 @@
|
||||
const managerJoin = calc(joinFee, rates.manager.join || 0.05);
|
||||
const managerTotal = managerJoin;
|
||||
|
||||
// 교육자: 가입비의 3%
|
||||
const educatorJoin = calc(joinFee, rates.educator?.join || 0.03);
|
||||
// 메뉴제작 협업자: 운영팀 별도 산정
|
||||
const educatorJoin = 0;
|
||||
const educatorTotal = educatorJoin;
|
||||
|
||||
const totalCommission = sellerTotal + managerTotal + educatorTotal;
|
||||
const companyMargin = joinFee - totalCommission; // 회사 마진 = 가입비 - 총 수당
|
||||
const companyMargin = joinFee - totalCommission; // 회사 마진 = 가입비 - 영업 수당
|
||||
|
||||
const formatCurrency = (val) => new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW' }).format(val);
|
||||
|
||||
@@ -2742,17 +2738,17 @@
|
||||
<td className="px-4 py-3 text-right font-bold text-slate-900">{formatCurrency(managerTotal)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="px-4 py-3 font-medium text-slate-900">교육자</td>
|
||||
<td className="px-4 py-3 font-medium text-slate-900">메뉴제작 협업자</td>
|
||||
<td className="px-4 py-3 text-slate-600">
|
||||
<span className="text-xs text-slate-400">3%</span>
|
||||
<span className="text-xs text-slate-400">별도</span>
|
||||
</td>
|
||||
<td className="px-4 py-3 text-right font-bold text-slate-900">{formatCurrency(educatorTotal)}</td>
|
||||
<td className="px-4 py-3 text-right font-bold text-slate-900">운영팀 산정</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot className="bg-slate-50 border-t border-slate-200">
|
||||
<tr>
|
||||
<td className="px-4 py-3 font-bold text-slate-900">회사 마진</td>
|
||||
<td className="px-4 py-3 text-slate-500">가입비 - 총 수당</td>
|
||||
<td className="px-4 py-3 text-slate-500">가입비 - 영업 수당</td>
|
||||
<td className="px-4 py-3 text-right font-bold text-slate-900">{formatCurrency(companyMargin)}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
Reference in New Issue
Block a user