# Automation 7: Smart Leave Management & BCEA Dashboard
## Pitch, Handover & Technical Blueprint

---

## 1. Executive Pitch & Key Selling Points

Untaken leave liability is a hidden financial landmine for South African businesses. Under **BCEA Section 40**, accrued annual leave must be paid out in cash upon resignation or termination. Most CFOs only discover the true Rand cost when a senior employee unexpectedly resigns.

Use these pitch angles to close **R2,500 - R4,000 / month retainers**:

* **The CFO Hook (Rand Liability):** We translate "days of leave" into **hard Rands on the balance sheet**. Showing the CEO that they have R487,200 of leave debt sitting on their books changes leave from an administrative task into a board-level financial priority.
* **The BCEA S23 Pay Deduction Safeguard:** If an employee takes a sick day on a Monday or Friday (or >2 consecutive days) without a valid medical certificate, **BCEA Section 23** legally allows the employer to convert it to **Unpaid Leave**. Our engine automatically calculates the exact Rand amount (e.g. R3,560) and batches the payroll deduction.
* **The Sick Leave Pattern Scanner:** No standard payroll software alerts HR when an employee takes 6 of 8 sick days specifically on Mondays or Fridays. Our engine detects this pattern automatically and creates a formal incapacity review file.
* **BCEA Compliance Shield:** Automates monitoring across BCEA Sections 20 (Annual), 22 (Sick), 23 (Medical Certs), 25 (Maternity), and 27 (Family Responsibility), protecting the firm against CCMA disputes.

---

## 2. South African Labour Law Alignment (BCEA)

- **BCEA Section 20 (Annual Leave):** Minimum 21 consecutive days per 12-month cycle. The dashboard flags any employee exceeding 30 days balance.
- **BCEA Section 22 (Sick Leave):** 30 days per 36-month cycle. Our engine tracks cycle consumption rate to prevent Year 1 exhaustion.
- **BCEA Section 23 (Proof of Incapacity):** Requires doctor certificates for >2 days or Monday/Friday absences. Enables legal conversion to unpaid leave.
- **BCEA Section 40 (Payment on Termination):** Mandates exact payout formulas. Daily rate calculation: `(Gross Annual Salary / 260) * Accrued Days`.

---

## 3. Automation Architecture (n8n Blueprint)

Driven by `leave_workflow.json`:
1. **Weekly Anomaly & S23 Scan (Mondays 06:00):** Evaluates pattern rules and uncertificated absences.
2. **Slack & WhatsApp Alerts:** Fires instant notifications for high-risk pattern detections and S23 deductions.
3. **Monthly Financial Exposure Report:** Emails an updated liability breakdown & S23 cash recovery summary to the CFO on the 1st of every month.

---

## 4. Implementation Checklist
1. Deploy `leave_dashboard.html` to internal HR portal.
2. Import `leave_workflow.json` into n8n and bind Sage/Xero API tokens.
3. Set company financial year-end and daily salary rate multipliers.
