# 4. Commission Calculation

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*

---

## 4. Commission Calculation

### 4.1 Commission Calculation for Affiliates
**What it does:** Calculates the commissions for the affiliates: the commissions (the commission, the affiliate, the rate, the amount, the date) are calculated on the referrals (the referral, the purchase, the amount), so the commissions are computed (the calculation is the earning). The Super Administrator configures the commission calculation (the affiliate, the rate, the amount, the referral) so the calculation is structured and the commissions are explicit.

**Sub-features:**
- Commission: the commission (the commission, the affiliate, the rate, the amount)
- Commission rate: the rate (the rate of the commission, e.g., the 20%)
- Referral: the referral (the referral, the purchase, the amount)
- Commission calculation: the calculation (the commission is calculated on the referral, the amount)
- Calculation configuration: the configuration (the affiliate, the rate, the amount, the referral)
- Calculation record: the record (the commission, the affiliate, the rate, the amount, the date)
- Calculation view: the view (the commissions, the affiliates, the period)
- Audit logging of the commission calculation

**Super Administrator User Journey:**
1. Super Admin configures the commission calculation: the commission (the commission, the affiliate, the rate, the amount), the rate (the rate of the commission, e.g., the 20%), and the referral (the referral, the purchase, the amount); the calculation is explicit.
2. Sets the commission rate: the rate (the rate of the commission, e.g., the 20%); the rate is the percentage.
3. Sets the referral: the referral (the referral, the purchase, the amount); the referral is the trigger.
4. Saves; the commission calculation is live, and the commissions are calculated on the referrals.
5. A referral purchase is made; the commission is calculated (the commission is computed, the rate is applied, the amount is earned); the calculation is recorded.
6. The affiliate is credited: the credit (the commission is credited to the affiliate, the amount, the date); the credit is the earning.
7. For a calculation change (the rate updated), Super Admin changes the calculation (the new rate, the time); the change is recorded.
8. The commission calculation is audit-logged with the affiliate, the rate, and the timestamp.

**Rules & Edge Cases:**
- The commission is the earning (the commission, the affiliate, the rate, the amount); the commission is the value.
- The commission rate is the percentage (the rate of the commission, e.g., the 20%); the rate is the measure.
- The referral is the trigger (the referral, the purchase, the amount); the referral is the origin.
- A calculation change (the rate updated) is recorded (the new rate, the time); it is auditable.
- The commissions are visible (the commissions, the affiliates, the period); the calculation is managed.
- Commission calculation is audit-logged with the affiliate, rate, and timestamp.

### 4.2 Commission Accrual and Settlement Tracking
**What it does:** Tracks the commission accrual and settlement: the accrual of the commissions (the accrual, the affiliate, the amount, the date) and the settlement (the settlement, the affiliate, the amount, the date) are tracked, so the commissions are accrued and settled (the tracking is the record). The Super Administrator views the accrual and settlement tracking (the affiliate, the accrual, the settlement, the amount) so the tracking is structured and the commissions are explicit.

**Sub-features:**
- Commission accrual: the accrual (the accrual, the affiliate, the amount, the date)
- Commission settlement: the settlement (the settlement, the affiliate, the amount, the date)
- Accrual status: the status (the accrued, the settled, the pending)
- Settlement status: the status (the settled, the pending, the paid)
- Tracking record: the record (the affiliate, the accrual, the settlement, the amount, the date)
- Tracking view: the view (the accruals, the settlements, the affiliates, the period)
- Tracking export: the export (the tracking, the format, the period)
- Audit logging of the commission accrual and settlement tracking

**Super Administrator User Journey:**
1. Super Admin views the accrual and settlement tracking: the accruals (the accrual, the affiliate, the amount, the date), the settlements (the settlement, the affiliate, the amount, the date), and the period (the period of the tracking); the tracking is explicit.
2. Views the accrued commissions: the accrual (the accrual, the affiliate, the amount, the date); the accrual is the earning.
3. Views the settled commissions: the settlement (the settlement, the affiliate, the amount, the date); the settlement is the payment.
4. Views the accrual status: the status (the accrued, the settled, the pending); the status is the state.
5. Views the settlement status: the status (the settled, the pending, the paid); the status is the state.
6. The commissions are visible: the accruals, the settlements, the affiliates, the period, so the tracking is complete.
7. Exports the tracking (the tracking report, the period); the export is the record.
8. The commission accrual and settlement tracking is audit-logged with the affiliate, the accrual, and the timestamp.

**Rules & Edge Cases:**
- The commission accrual is the earning (the accrual, the affiliate, the amount, the date); the accrual is the accumulation.
- The commission settlement is the payment (the settlement, the affiliate, the amount, the date); the settlement is the completion.
- The accrual status is the state (the accrued, the settled, the pending); the status is the control.
- The settlement status is the state (the settled, the pending, the paid); the status is the control.
- The commissions are visible (the accruals, the settlements, the affiliates, the period); the tracking is managed.
- Commission accrual and settlement tracking is audit-logged with the affiliate, accrual, and timestamp.
