# Automation 5: Payroll Discrepancy Alert System
## Pitch, Handover & Technical Blueprint

---

## 1. Pitch Strategy & Boardroom Key Selling Points

South African business owners and Finance Directors live in fear of payroll errors and fraud. The **Payroll Discrepancy Alert System** targets the single most expensive item on any company's P&L: **Salaries**.

Use these talking points to command a **R2,000–R4,000/month retainer** easily:

*   **The "Ghost Employee" Fraud Catch:** Ghost employees (terminated workers who are kept on payroll by a rogue administrator) are the most common source of corporate fraud. Finding just *one* ghost worker (e.g. R18,500/month) pays for this system’s entire annual retainer **in less than 30 days**.
*   **The "Bank Detail Modification" Safeguard:** Catching unauthorized bank details updates before pay runs. This blocks the #1 vector for internal finance fraud (replacing employee accounts with admin accounts).
*   **The BCEA "Unreasonable Deductions" Shield:** Under South African law, if you accidentally overpay an employee, recovering that money can be a legal nightmare. By catching variances *before* the bank release is authorized, you eliminate the risk of overpayment.
*   **The "Double-Sighted Approval" Governance:** Rather than trusting a single person to upload and approve a bank file, the dashboard forces the HR Manager and Finance Director to physically sign off on exceptions before the system unlocks the release webhook.
*   **Cryptographically-Sealed Release:** The system automatically seals the final verification with a SHA-256 hash stamp, verifying that no data was modified between sign-off and bank upload.

---

## 2. South African Legal & B-BBEE Alignment

### Basic Conditions of Employment Act (BCEA) — Section 34
*   **The Legal Trap:** Section 34 of the BCEA strictly prohibits an employer from making any deductions from an employee's remuneration unless they agree in writing, or the deduction is permitted by law/court order.
*   **Why catch it early:** If you pay an employee too much due to a payroll mistake, you cannot simply deduct it from their next salary without written consent. It must be recovered through negotiation or legal action. Catching the variance *pre-payment* avoids this legal bottleneck.

### BCEA Section 32 — Remuneration Rules
*   Employers must pay salaries within 7 days of the end of the pay period. Delaying a payroll run to fix errors can trigger labor disputes. The Integrity Engine guarantees errors are caught and resolved in minutes, preserving the payment schedule.

### Companies Act (No. 71 of 2008) — Section 76
*   Directors have a statutory **fiduciary duty of care** to maintain sound financial controls. Implementing an automated payroll integrity check provides a solid audit trail showing that the board has established strict internal governance.

---

## 3. Financial Case & ROI Analysis

Let’s lay out the financial argument for a standard SA mid-sized business (50–100 employees):

*   **Retail Cost of the System:** R3,000/month (R36,000/year)
*   **Average Cost of a Minor Payroll Error:** R8,500 (average administration cost and lost hours to correct/re-negotiate)
*   **Average Cost of a Terminated Employee Leak (Ghost Worker):** R20,000/month
*   **Total Year-1 Savings: Catching 1 critical error + 2 minor variances:**
    $$\text{Savings} = \text{R20,000} + (2 \times \text{R8,500}) = \text{R37,000}$$
    The system pays for itself with just **three catches per year**.

---

## 4. Technical Integration Architecture

The system sits passively between your Payroll Core and your Banking Portal:

```
[Payroll Engine (Sage/Xero)] ──(Webhook)──> [n8n Variance Check]
                                                   │
                                            (Anomalies Found)
                                                   │
                                                   ▼
                                         [PIR Dashboard Alerts]
                                                   │
                                            (Dual Approval)
                                                   │
                                                   ▼
[Corporate Banking (Nedbank/FNB)] <──(Unlock)── [Release Webhook]
```

### Supported integrations:
1.  **Sage VIP Premier / Sage 300:** Using automated CSV exports or native APIs to pull monthly pay sheets.
2.  **Xero Payroll:** Fully automated direct connection via API endpoint.
3.  **SimplePay / PaySpace:** Modern cloud payroll systems with native webhook support that run the checks instantly when a pay run is finalized.

---

*Handover document compiled by Punkit Creative | Powered by the n8n Payroll Integrity Engine*
