# Fusion Payroll Canada - QuickBooks-Like Enhancement Plan

## Overview

Transform the basic Canadian payroll module into a comprehensive, QuickBooks-like payroll solution for Odoo Enterprise.

**Status**: 📋 PLANNING PHASE - Collecting requirements before implementation

---

## Table of Contents

1. [Gap Analysis](#gap-analysis)
2. [Employee Profile](#phase-1-employee-profile)
3. [Employment Status & ROE](#phase-2-employment-status--roe)
4. [ROE Generation](#phase-2b-roe-generation--submission)
5. [Tax Withholdings](#phase-3-tax-withholdings)
6. [Base Pay & Compensation](#phase-4-base-pay--compensation)
7. [Additional Pay Types](#phase-5-additional-pay-types)
8. [Time Off & Vacation](#phase-6-time-off--vacation)
9. [Deductions & Contributions](#phase-7-deductions--contributions)
10. [Paycheque Entry Form](#phase-8-paycheque-entry-form)
11. [Pay Stub Report](#phase-9-pay-stub-report)
12. [Payroll Cheque Printing](#phase-9b-payroll-cheque-printing)
13. [Payroll Tax Centre](#phase-10-payroll-tax-centre)
14. [Reports](#phase-11-reports)
13. [Implementation Order](#implementation-order)

---

## Gap Analysis

### What QuickBooks Has (That Odoo Lacks)

| Feature | QuickBooks | Odoo Enterprise | Gap | Priority |
|---------|------------|-----------------|-----|----------|
| Employee Profile Tabs | Profile, Paycheque list, Documents, Notes, Permissions | Basic form | ❌ Missing | HIGH |
| Personal Info | SIN, Birth date, Gender, Full address | Partial | ⚠️ Partial | HIGH |
| Employment Status | Active/Terminated with ROE codes | Basic active/archive | ❌ Missing | HIGH |
| ROE Reason Codes | Full Service Canada codes | None | ❌ Missing | HIGH |
| Tax Withholdings | TD1 Fed/Prov, Exemptions | Basic | ❌ Missing | HIGH |
| Payment Method | Cheque/Direct deposit | Has bank | ⚠️ Partial | MEDIUM |
| Base Pay | Hourly/Salary/Commission | Has wage | ⚠️ Partial | HIGH |
| Additional Pay Types | Stat Holiday, Custom | Not structured | ❌ Missing | HIGH |
| Time Off | Vacation %, Sick pay | Separate module | ⚠️ Separate | MEDIUM |
| Deductions | Health, Retirement, T4 dental | Basic | ❌ Missing | MEDIUM |
| Workers' Comp | WCB tracking | None | ❌ Missing | LOW |
| CPP2 (Second CPP) | 2024+ additional pension | None | ❌ Missing | HIGH |
| Employer Tax Tracking | EI (1.4x), CPP (1:1) | Basic | ❌ Missing | HIGH |
| Paycheque Entry Form | Detailed editable form | Basic payslip | ❌ Missing | HIGH |
| Payroll Tax Centre | Remittances + Filings dashboard | None | ❌ Missing | HIGH |
| Tax Remittance Tracking | Monthly CPP/EI/Tax payments | None | ❌ Missing | HIGH |
| T4 Summary/Slips | Year-end tax forms | None | ❌ Missing | HIGH |
| Emergency Contact | Full details | Not in payroll | ❌ Missing | LOW |
| Pay Stub Report | Detailed with YTD | Basic payslip | ❌ Missing | HIGH |

---

## Phase 1: Employee Profile

### Personal Info Fields

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| Legal Name (First, M.I., Last) | Char | Yes | Already in Odoo |
| Preferred First Name | Char | No | Display name |
| Email | Char | Yes | Already in Odoo |
| Home Phone | Char | No | With extension |
| Work Phone | Char | No | With extension |
| Mobile Phone | Char | No | |
| Street Address | Char | Yes | |
| Address Line 2 | Char | No | |
| City | Char | Yes | |
| Province | Selection | Yes | All Canadian provinces |
| Postal Code | Char | Yes | Format: A1A 1A1 |
| Mailing Address Same as Home | Boolean | No | Checkbox |
| Birth Date | Date | Yes | |
| Gender | Selection | No | Male/Female/Other |
| Social Insurance Number | Char | Yes | 9 digits, masked |

### Canadian Provinces Selection

```python
PROVINCES = [
    ('AB', 'Alberta'),
    ('BC', 'British Columbia'),
    ('MB', 'Manitoba'),
    ('NB', 'New Brunswick'),
    ('NL', 'Newfoundland and Labrador'),
    ('NS', 'Nova Scotia'),
    ('NT', 'Northwest Territories'),
    ('NU', 'Nunavut'),
    ('ON', 'Ontario'),
    ('PE', 'Prince Edward Island'),
    ('QC', 'Quebec'),
    ('SK', 'Saskatchewan'),
    ('YT', 'Yukon'),
]
```

---

## Phase 2: Employment Status & ROE

### Employment Status

| Status | Description | Triggers |
|--------|-------------|----------|
| Active | Actively working and receiving pay | Default for new employees |
| On Leave | Temporary leave (maternity, sick, etc.) | Manual change |
| Terminated | Employment has ended | Requires ROE code |

### ROE (Record of Employment) Reason Codes

These are **official Service Canada codes** required for EI claims:

#### A - Shortage of Work
| Code | Description |
|------|-------------|
| A00 | Shortage of work/End of contract or season |
| A01 | Employer bankruptcy or receivership |

#### B - Strike/Lockout
| Code | Description |
|------|-------------|
| B00 | Strike or lockout |

#### D - Illness
| Code | Description |
|------|-------------|
| D00 | Illness or injury |

#### E - Quit (Voluntary)
| Code | Description |
|------|-------------|
| E00 | Quit |
| E02 | Quit/Follow spouse |
| E03 | Quit/Return to school |
| E04 | Quit/Health Reasons |
| E05 | Quit/Voluntary retirement |
| E06 | Quit/Take another job |
| E09 | Quit/Employer relocation |
| E10 | Quit/Care for a dependent |
| E11 | Quit/To become self-employed |

#### F - Maternity
| Code | Description |
|------|-------------|
| F00 | Maternity |

#### G - Retirement
| Code | Description |
|------|-------------|
| G00 | Mandatory retirement |
| G07 | Retirement/Approved workforce reduction |

#### H - Work-Sharing
| Code | Description |
|------|-------------|
| H00 | Work-Sharing |

#### J - Apprentice
| Code | Description |
|------|-------------|
| J00 | Apprentice training |

#### K - Other
| Code | Description |
|------|-------------|
| K00 | Other |
| K12 | Other/Change of payroll frequency |
| K13 | Other/Change of ownership |
| K14 | Other/Requested by Employment Insurance |
| K15 | Other/Canadian Forces - Queen's Regulations/Orders |
| K16 | Other/At the employee's request |
| K17 | Other/Change of Service Provider |

#### M - Dismissal
| Code | Description |
|------|-------------|
| M00 | Dismissal |
| M08 | Dismissal/Terminated within probationary period |

#### N - Leave
| Code | Description |
|------|-------------|
| N00 | Leave of absence |

#### P - Parental
| Code | Description |
|------|-------------|
| P00 | Parental |

#### Z - Compassionate Care
| Code | Description |
|------|-------------|
| Z00 | Compassionate Care/Family Caregiver |

### Employment Details Fields

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| Status | Selection | Yes | Active/On Leave/Terminated |
| Last Day of Work | Date | When terminated | Required for ROE |
| Show in Employee Lists Only | Boolean | No | Keep terminated visible |
| Reason for Status Change | Selection | When terminated | ROE codes above |
| Hire Date | Date | Yes | |
| Pay Schedule | Selection | Yes | Weekly/Bi-Weekly/Semi-Monthly/Monthly |
| Work Location | Many2one | Yes | Link to work address |
| Manager | Many2one | No | |
| Department | Many2one | No | |
| Job Title | Char | No | |
| Employee ID | Char | No | Internal employee number |
| Billing Rate (per hour) | Float | No | For billable employees |
| Billable by Default | Boolean | No | |

### ROE Tracking Fields

| Field | Type | Notes |
|-------|------|-------|
| ROE Issued | Boolean | Checkbox when issued |
| ROE Issue Date | Date | When ROE was created |
| ROE Serial Number | Char | Service Canada serial |

---

## Phase 2B: ROE Generation & Submission

### ROE Workflow (from QuickBooks)

When an employee is terminated or goes on leave:

1. **Prompt Dialog**: 
   - "Do you want to create [Employee]'s Record of Employment?"
   - Reminder: "Make sure you send a Record of Employment (ROE) to Service Canada within [5 days] of the interruption in earnings."
   - Buttons: "Do it later" | "Continue"

2. **ROE Review Screen**:
   - Shows official ROE form preview
   - Warning: "This isn't the official ROE"
   - "Review the info and download the ROE in the next step as a BLK file to submit it through ROE Web"
   - Displays deadline: "Make sure to submit this ROE by [Date]"

3. **ROE Ready Screen**:
   - **Download ROE**: "Download it in a BLK format for ROE Web. You can also view a PDF version."
     - Button: "Download BLK" (dropdown with PDF option)
   - **Go to ROE Web**: "Submit it through ROE Web by [deadline date]"
   - **Archive ROE**: "After submitting the ROE, archive the ROE for employee. You can view the ROE later in the archive section."

### Official ROE Form Fields

| Box | Field Name | Description | Source |
|-----|------------|-------------|--------|
| 1 | Serial No. | Assigned by Service Canada | N/A for electronic |
| 2 | Serial No. of ROE Amended/Replaced | If amending previous ROE | Manual entry |
| 3 | Employer's Payroll Reference No. | Internal reference | System generated |
| 4 | Employer's Name and Address | Company info | Company settings |
| 5 | CRA Business Number (BN) | 15-char format: 808902308RP0001 | Company settings |
| 6 | Pay Period Type | W=Weekly, B=Bi-Weekly, S=Semi-Monthly, M=Monthly | Employee pay schedule |
| 7 | Postal Code | Employer postal code | Company settings |
| 8 | Social Insurance No. | Employee SIN (9 digits) | Employee record |
| 9 | Employee's Name and Address | Full name + address | Employee record |
| 10 | First Day Worked | Hire date | Employee record |
| 11 | Last Day for Which Paid | Last day of pay | Termination wizard |
| 12 | Final Pay Period Ending Date | End date of final pay period | Calculated |
| 13 | Occupation | Job title | Employee record |
| 14 | Expected Date of Recall | If temporary layoff | Manual entry |
| 15A | Total Insurable Hours | Hours worked in insurable period | Calculated from payslips |
| 15B | Total Insurable Earnings | Earnings in insurable period | Calculated from payslips |
| 15C | Insurable Earnings by Pay Period | Up to 53 pay periods | Calculated from payslips |
| 16 | Reason for Issuing this ROE | ROE reason code (A-Z) | Termination wizard |
| 17 | Other Payments/Benefits | Other than regular pay | Manual entry |
| 18 | Comments | Additional notes | Manual entry |
| 19 | Sick/Maternity/Parental Leave | Special payments after last day | Manual entry |
| 20 | Communication Preferred In | English/French | Employee preference |
| 21 | Telephone No. | Contact phone | Employee/Company |
| 22 | Certification | Issuer name and date | Current user + date |

### Pay Period Type Codes

| Code | Type | Pay Periods/Year |
|------|------|------------------|
| W | Weekly | 52 |
| B | Bi-Weekly | 26 |
| S | Semi-Monthly | 24 |
| M | Monthly | 12 |

### BLK File Format (ROE Web XML)

QuickBooks exports ROE as a `.blk` file (XML format) for upload to Service Canada's ROE Web:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<ROEHEADER FileVersion="W-2.0" ProductName="Fusion Payroll" SoftwareVendor="Your Company">
  <ROE Issue="D" PrintingLanguage="E">
    <!-- Box 5: CRA Business Number -->
    <B5>808902308RP0001</B5>
    
    <!-- Box 6: Pay Period Type (B=Bi-Weekly) -->
    <B6>B</B6>
    
    <!-- Box 8: Social Insurance Number (no dashes) -->
    <B8>145112736</B8>
    
    <!-- Box 9: Employee Name and Address -->
    <B9>
      <FN>Gurmeet</FN>
      <LN>Kaur</LN>
      <A1>4304 Brandon Gate Drive</A1>
      <A2>Mississauga</A2>
      <A3>ON, CA</A3>
      <PC>L4T3K4</PC>
    </B9>
    
    <!-- Box 10: First Day Worked (YYYY-MM-DD) -->
    <B10>2025-08-04</B10>
    
    <!-- Box 11: Last Day For Which Paid -->
    <B11>2025-12-05</B11>
    
    <!-- Box 12: Final Pay Period Ending Date -->
    <B12>2025-12-05</B12>
    
    <!-- Box 14: Expected Date of Recall -->
    <B14>
      <CD>U</CD>  <!-- U = Unknown/Not applicable -->
    </B14>
    
    <!-- Box 15A: Total Insurable Hours -->
    <B15A>720</B15A>
    
    <!-- Box 15C: Insurable Earnings by Pay Period -->
    <B15C>
      <PP nbr="1"><AMT>1664.00</AMT></PP>
      <PP nbr="2"><AMT>1664.00</AMT></PP>
      <PP nbr="3"><AMT>1664.00</AMT></PP>
      <PP nbr="4"><AMT>1664.00</AMT></PP>
      <PP nbr="5"><AMT>1664.00</AMT></PP>
      <PP nbr="6"><AMT>1664.00</AMT></PP>
      <PP nbr="7"><AMT>1664.00</AMT></PP>
      <PP nbr="8"><AMT>1664.00</AMT></PP>
      <PP nbr="9"><AMT>1664.00</AMT></PP>
      <!-- Up to 53 pay periods -->
    </B15C>
    
    <!-- Box 16: Reason for Issuing ROE -->
    <B16>
      <CD>F</CD>  <!-- F = Maternity -->
      <FN>Gurpreet</FN>  <!-- Contact First Name -->
      <LN>Singh</LN>     <!-- Contact Last Name -->
      <AC>905</AC>       <!-- Area Code -->
      <TEL>4517743</TEL> <!-- Phone Number -->
    </B16>
    
    <!-- Box 20: Language Preference (E=English, F=French) -->
    <B20>E</B20>
  </ROE>
</ROEHEADER>
```

### ROE File Naming Convention

`ROEForm_[LastName]_[FirstName]_[Date]_[Sequence].blk`

Example: `ROEForm_Gurmeet_Kaur_2026-01-01_011.blk`

### ROE Archive Model

| Field | Type | Notes |
|-------|------|-------|
| employee_id | Many2one | Employee |
| roe_date | Date | Date ROE created |
| reason_code | Selection | A-Z codes |
| first_day_worked | Date | Box 10 |
| last_day_paid | Date | Box 11 |
| final_period_end | Date | Box 12 |
| total_insurable_hours | Float | Box 15A |
| total_insurable_earnings | Float | Box 15B |
| pay_period_earnings | Text | JSON of pay period amounts |
| blk_file | Binary | Downloaded BLK file |
| pdf_file | Binary | PDF version |
| submitted_to_roe_web | Boolean | Has been submitted |
| submission_date | Date | When submitted |
| service_canada_serial | Char | Serial after submission |
| state | Selection | draft/ready/submitted/archived |

### 5-Day Deadline Rule

ROE must be submitted to Service Canada within **5 calendar days** of:
- Interruption of earnings (termination, layoff)
- Employee request
- First day of leave (maternity, parental, sick)

---

## Phase 3: Tax Withholdings

### Federal Withholding

| Field | Type | Default | Notes |
|-------|------|---------|-------|
| Federal TD1 Amount | Float | $15,705 (2024) | Basic personal amount |
| Additional Federal Tax | Float | $0 | Extra tax per pay |

### Provincial Withholding

| Field | Type | Notes |
|-------|------|-------|
| Province | Selection | Employee's tax province |
| Provincial Claim Amount | Float | Provincial TD1 amount |

### Tax Exemptions

| Field | Type | Notes |
|-------|------|-------|
| Exempt from CPP | Boolean | Age 70+, or other exemption |
| Exempt from EI | Boolean | Specific exemptions |
| Exempt from Federal Tax | Boolean | Non-resident, treaty, etc. |

---

## Phase 4: Base Pay & Compensation

### Compensation Type

| Type | Description | Fields |
|------|-------------|--------|
| Hourly | Paid by the hour | Rate per hour |
| Salary | Fixed amount per period | Annual/period salary |
| Commission Only | Commission-based | Commission structure |

### Base Pay Fields

| Field | Type | Notes |
|-------|------|-------|
| Compensation Type | Selection | Hourly/Salary/Commission |
| Rate | Float | $/hour or annual salary |
| Account Mapping | Many2one | GL account for wages |
| Hours per Day | Float | Default working hours |
| Days per Week | Float | Default working days |
| Effective Date | Date | When rate takes effect |

---

## Phase 5: Additional Pay Types

### Pay Type Categories

| Category | Examples |
|----------|----------|
| Earnings | Regular, Overtime, Stat Holiday, Vacation, Bonus |
| Deductions | Garnishment, Union dues, Advances |
| Employer Contributions | Health benefits, RRSP match |

### Default Pay Types (QuickBooks)

| Pay Type | Code | Calculation | Taxable |
|----------|------|-------------|---------|
| Regular Pay | REG | Hourly × Hours | Yes |
| Overtime Pay | OT | 1.5× Hourly × Hours | Yes |
| Stat Holiday Pay | STAT | 1.0× Base pay | Yes |
| Stat Pay - Average Daily Wage | STAT_AVG | Calculated average | Yes |
| Vacation Pay | VAC | % of earnings | Yes |
| Sick Pay | SICK | Based on policy | Yes |
| Bonus | BONUS | Fixed or % | Yes |

### Pay Type Model

| Field | Type | Notes |
|-------|------|-------|
| Name | Char | Display name |
| Code | Char | Unique code |
| Category | Selection | Earnings/Deduction/Contribution |
| Calculation Type | Selection | Fixed/Percentage/Multiplier/Hourly |
| Rate/Amount | Float | Value based on calc type |
| Taxable | Boolean | Subject to income tax |
| Subject to CPP | Boolean | |
| Subject to EI | Boolean | |
| Account | Many2one | GL account |

---

## Phase 6: Time Off & Vacation

### Vacation Policy

| Policy Type | Description |
|-------------|-------------|
| Paid Out Each Pay Period | % of earnings added to each pay |
| Accrued | Hours/days banked for later use |

### Vacation Fields

| Field | Type | Notes |
|-------|------|-------|
| Vacation Policy | Selection | Payout/Accrued |
| Vacation Rate | Float | Default: 4.00% |
| Vacation Earnings Types | Many2many | Which pay types earn vacation |

### Sick Pay

| Policy | Description |
|--------|-------------|
| No Sick Pay Policy | |
| X Days per Year | Fixed days |
| Unlimited | |

### Unpaid Time Off

| Policy | Description |
|--------|-------------|
| No Unpaid Time Off Policy | |
| Track Hours | |

---

## Phase 7: Deductions & Contributions

### Deduction/Contribution Types

| Category | Examples |
|----------|----------|
| Health Insurance | Medical, Dental, Vision |
| Retirement Plans | RRSP, Pension |
| Taxable Benefits (non-cash) | Company car, housing |
| Other Deductions | Garnishment, loans, union dues |

### T4 Dental Benefits Code (CRA Required)

| Code | Description |
|------|-------------|
| 1 | No dental benefits |
| 2 | Payee only covered |
| 3 | Payee, spouse, and dependents |
| 4 | Payee and spouse |
| 5 | Payee and dependents |

### Deduction Model

| Field | Type | Notes |
|-------|------|-------|
| Name | Char | |
| Code | Char | |
| Category | Selection | Health/Retirement/Taxable/Other |
| Calculation | Selection | Fixed/% of Gross |
| Amount/Rate | Float | |
| Pre-Tax | Boolean | Deducted before tax calc |
| Has Employer Match | Boolean | |
| Employer Match Rate | Float | % of employee contribution |
| Max Annual Amount | Float | Cap per year |

---

## Phase 8: Paycheque Entry Form

### Paycheque Entry Layout (QuickBooks Style)

This is the detailed view when creating/editing a paycheque:

```
┌────────────────────────────────────────────────────────────────────────────┐
│  PAY TO                                                       NET PAY      │
│  Gurmeet Kaur                                                 $1,353.47    │
│                                                              Cheque Number │
│  Employee address           Pay date         Pay period       [_________]  │
│  4304 Brandon Gate Drive    12.13.2025       11.22.2025 to 12.05.2025      │
│  Mississauga, ON L4T 3K4                                                   │
│                             Paid from                 Paid by              │
│                             Chequing XXXXX-9595       Cheque ($1,353.47)   │
├────────────────────────────────────────────────────────────────────────────┤
│  ▼ Pay                                                                     │
│  ───────────────────────────────────────────────────────────────────────   │
│  TYPE                           Hours      Rate      Current      YTD      │
│  Regular Pay                    [80.00]    [$20.00]  $1,600.00   $14,080.00│
│  Vacation Pay                                        $64.00      $576.00   │
│  Stat Holiday Pay               [0.00]     $20.00    $0.00       $320.00   │
│  Stat pay - average daily wage                       [$0.00]     $0.00     │
│  ───────────────────────────────────────────────────────────────────────   │
│  Total                                               $1,664.00   $14,976.00│
├────────────────────────────────────────────────────────────────────────────┤
│  ▼ Employee taxes                                                          │
│  ───────────────────────────────────────────────────────────────────────   │
│  TYPE                                                Current      YTD      │
│  Income Tax                                          [$192.24]   $1,730.16 │
│  Employment Insurance                                [$27.29]    $245.61   │
│  Canada Pension Plan                                 [$91.00]    $819.00   │
│  Second Canada Pension Plan                          [$0.00]     $0.00     │
│  ───────────────────────────────────────────────────────────────────────   │
│  Total                                               $310.53     $2,794.77 │
├────────────────────────────────────────────────────────────────────────────┤
│  ▼ Employer taxes                                                          │
│  ───────────────────────────────────────────────────────────────────────   │
│  TYPE                                                Current      YTD      │
│  Employment Insurance Employer                       [$38.21]    $343.89   │
│  Canada Pension Plan Employer                        [$91.00]    $819.00   │
│  Second Canada Pension Plan Employer                 [$0.00]     $0.00     │
│  ───────────────────────────────────────────────────────────────────────   │
│  Total                                               $129.21     $1,162.89 │
├────────────────────────────────────────────────────────────────────────────┤
│  ▼ Time off                                                                │
│  ───────────────────────────────────────────────────────────────────────   │
│         Hours accrued  Hours used  Hours available  Amt accrued  Amt used  │
│  Vacation   0.00         0.00         0.00           $0.00        $0.00    │
├────────────────────────────────────────────────────────────────────────────┤
│  Memo                                                                      │
│  ┌──────────────────────────────────────────────────────────────────────┐  │
│  │                                                                      │  │
│  │                                                                      │  │
│  └──────────────────────────────────────────────────────────────────────┘  │
└────────────────────────────────────────────────────────────────────────────┘
```

### Paycheque Header Fields

| Field | Type | Notes |
|-------|------|-------|
| Employee | Many2one | Pay To |
| Net Pay | Float | Calculated (readonly) |
| Pay Date | Date | When payment issued |
| Pay Period Start | Date | Period beginning |
| Pay Period End | Date | Period ending |
| Paid From | Many2one | Bank account |
| Paid By | Selection | Cheque/Direct Deposit |
| Cheque Number | Char | Optional, for cheques |

### Pay Section (Earnings Lines)

| Field | Type | Notes |
|-------|------|-------|
| Pay Type | Many2one | Regular, Vacation, Stat, etc. |
| Hours | Float | Editable for hourly pay types |
| Rate | Float | $/hour, usually from contract |
| Current | Float | Calculated: Hours × Rate |
| YTD | Float | Year-to-date running total |

### Default Pay Types in QuickBooks

| Pay Type | Editable Hours | Editable Rate | Calculation |
|----------|----------------|---------------|-------------|
| Regular Pay | ✅ Yes | ✅ Yes | Hours × Rate |
| Vacation Pay | ❌ No | ❌ No | % of earnings |
| Stat Holiday Pay | ✅ Yes (default 0) | ❌ No (from contract) | Hours × Rate |
| Stat pay - average daily wage | ❌ No | ❌ No | Calculated average |

### Employee Taxes Section

| Tax Type | Calculation | Notes |
|----------|-------------|-------|
| Income Tax | Complex formula | Federal + Provincial |
| Employment Insurance | 1.64% of insurable earnings | Max $1,077.48/year (2025) |
| Canada Pension Plan | 5.95% above exemption | Max $4,034.10/year (2025) |
| Second Canada Pension Plan (CPP2) | 4% on earnings above first ceiling | NEW for 2024+ |

### Employer Taxes Section

| Tax Type | Calculation | Notes |
|----------|-------------|-------|
| Employment Insurance Employer | **1.4× employee EI** | $38.21 vs $27.29 = 1.4x |
| Canada Pension Plan Employer | **1:1 match** | Same as employee |
| Second CPP Employer | **1:1 match** | Same as employee CPP2 |

**Key Insight**: Employer EI is 1.4× the employee contribution!

### Time Off Section

| Field | Type | Notes |
|-------|------|-------|
| Time Off Type | Char | Vacation, Sick, etc. |
| Hours Accrued | Float | Hours earned this period |
| Hours Used | Float | Hours taken this period |
| Hours Available | Float | Balance |
| Amount Accrued | Float | $ earned |
| Amount Used | Float | $ taken |
| Amount Available | Float | $ balance |

### Memo Field

| Field | Type | Notes |
|-------|------|-------|
| Memo | Text | Internal notes for this paycheque |

### Calculated Totals

| Section | Total Field | Calculation |
|---------|-------------|-------------|
| Pay | Total Current | Sum of all earnings |
| Pay | Total YTD | Sum of all YTD earnings |
| Employee Taxes | Total Current | Sum of all employee taxes |
| Employee Taxes | Total YTD | Sum of all YTD employee taxes |
| Employer Taxes | Total Current | Sum of all employer taxes |
| Employer Taxes | Total YTD | Sum of all YTD employer taxes |

### Net Pay Calculation

```
Net Pay = Total Pay - Employee Taxes - Employee Deductions
```

Where:
- Total Pay = Regular Pay + Vacation Pay + Stat Pay + Other Earnings
- Employee Taxes = Income Tax + EI + CPP + CPP2
- Employee Deductions = Health, RRSP, etc.

Note: Employer taxes are NOT deducted from employee pay (they are employer expense)

---

## Phase 9: Pay Stub Report

### Pay Stub Layout (QuickBooks Style)

```
┌─────────────────────────────────────────────────────────────────┐
│  [EMPLOYER INFO]                              Cheque No.: 677   │
│  Mobility Specialties Inc                                       │
│  Unit 16B, 106 Humber College Blvd                             │
│  Toronto ON M9V 4E4                                             │
│                                                                 │
│                                    Pay Stub Detail              │
│                                    PAY DATE: 12-12-2025         │
│                                    NET PAY: $1,407.15           │
│                                                                 │
│  [EMPLOYEE INFO]                                                │
│  Amandeep Kaur                                                  │
│  3540 Laddie Crescent                                          │
│  Mississauga ON L4T 1N1                                        │
├─────────────────────────────────────────────────────────────────┤
│  EMPLOYER                              PAY PERIOD               │
│  Mobility Specialties Inc              Period Beginning: 24-11-2025
│  Unit 16B, 106 Humber College Blvd     Period Ending: 07-12-2025
│  Toronto ON M9V 4E4                    Pay Date: 12-12-2025     │
│                                        Total Hours: 83.45       │
│  EMPLOYEE                                                       │
│  Amandeep Kaur                                                  │
│  3540 Laddie Crescent                                          │
│  Mississauga ON L4T 1N1                                        │
├─────────────────────────────────────────────────────────────────┤
│  BENEFITS          Accrued    Used    Available                 │
│  Vacation          0.00       0.00    0.00       NET PAY: $1,407.15
├─────────────────────────────────────────────────────────────────┤
│  PAY               Hours   Rate    Current      YTD             │
│  ─────────────────────────────────────────────────────────      │
│  Regular Pay       83.45   20.00   1,669.00     29,624.00       │
│  Vacation Pay      -       -       66.76        1,216.96        │
│  Stat Holiday Pay  -       20.00   0.00         800.00          │
├─────────────────────────────────────────────────────────────────┤
│  DEDUCTIONS                          Current      YTD           │
│  ─────────────────────────────────────────────────────────      │
│  (none in this example)                                         │
├─────────────────────────────────────────────────────────────────┤
│  TAXES                               Current      YTD           │
│  ─────────────────────────────────────────────────────────      │
│  Income Tax                          204.87       3,815.84      │
│  Employment Insurance                28.47        518.93        │
│  Canada Pension Plan                 95.27        1,754.48      │
│  Second Canada Pension Plan          0.00         0.00          │
├─────────────────────────────────────────────────────────────────┤
│  SUMMARY                             Current      YTD           │
│  ─────────────────────────────────────────────────────────      │
│  Total Pay                           $1,735.76    $31,640.96    │
│  Taxes                               $328.61      $6,089.25     │
│  Deductions                          $0.00        $0.00         │
│  ─────────────────────────────────────────────────────────      │
│  Net Pay                             $1,407.15                  │
└─────────────────────────────────────────────────────────────────┘
```

### Pay Stub Data Structure

| Section | Fields |
|---------|--------|
| Header | Employer name/address, Cheque #, Pay date, Net pay |
| Employee | Name, Address |
| Pay Period | Start date, End date, Pay date, Total hours |
| Benefits | Vacation (Accrued, Used, Available) |
| Pay | Type, Hours, Rate, Current, YTD |
| Deductions | Type, Current, YTD |
| Taxes | Income Tax, EI, CPP, CPP2, Current, YTD |
| Summary | Total Pay, Taxes, Deductions, Net Pay |

---

## Phase 9B: Payroll Cheque Printing

### Cheque Format

**Paper Size**: Letter (8.5" × 11")

**Layout**: Typically 3-part format:
1. **Top Stub** - Employee copy (pay stub details)
2. **Middle Cheque** - The actual negotiable cheque
3. **Bottom Stub** - Employer record copy

### Integration with Odoo Enterprise

Odoo Enterprise has base cheque printing functionality in the `account` module. We need to:
1. Extend the cheque template for payroll-specific fields
2. Add pay stub information to the stub portions
3. Use Odoo's existing cheque number sequence

### Cheque Stub Information (to document)

| Section | Fields |
|---------|--------|
| Employee Info | Name, Address, Employee ID |
| Pay Period | Start date, End date, Pay date |
| Earnings | Pay types with Hours, Rate, Current, YTD |
| Deductions | Type, Current, YTD |
| Taxes | Federal, Provincial, EI, CPP, CPP2 |
| Summary | Gross Pay, Total Deductions, Net Pay |
| Time Off | Vacation balance |

### Payment Methods

| Method | Notes |
|--------|-------|
| Cheque | Physical cheque with stub |
| Direct Deposit | Electronic transfer, still need pay stub |

*(Awaiting cheque image from user for detailed layout)*

---

## Phase 10: Payroll Tax Centre

### Overview

The Payroll Tax Centre is a centralized dashboard for managing tax remittances and government filings.

**Navigation**: Payroll → Payroll Tax

**Sub-tabs**:
1. **Payments** - Tax remittances to CRA
2. **Filings** - T4 Summary, T4 Slips, ROEs

---

### 10A: Payments Tab (Tax Remittances)

#### Remittance List Layout

```
┌────────────────────────────────────────────────────────────────────────────┐
│  Payroll Tax Centre                                                         │
│  [Payments]  [Filings]                                                      │
├────────────────────────────────────────────────────────────────────────────┤
│  ⚠️ There's an urgent problem with your account                            │
│  Please refer to the email we've sent you for more detail.                 │
├────────────────────────────────────────────────────────────────────────────┤
│  [Filter]                                    🖨️ Print  📄 Resources  📋 Payment history
├────────────────────────────────────────────────────────────────────────────┤
│  ACTION NEEDED [35]                                                         │
│                                                                             │
│  ┌─ Federal Taxes ────────────────────────────────────────────────────────┐│
│  │ 01.01.2023 – 01.31.2023 (Q1)  🔴 Past due   Due 02.15.2023             ││
│  │                                              > $3,188.64  [Pay & file ▼]││
│  │  ─────────────────────────────────────────────────────────────────────  ││
│  │  Canada Pension Plan Employer     $655.90                               ││
│  │  Canada Pension Plan              $655.90                               ││
│  │  Employment Insurance Employer    $276.11                               ││
│  │  Employment Insurance             $197.22                               ││
│  │  Income Tax                       $1,403.51                             ││
│  │  ─────────────────────────────────────────────────────────────────────  ││
│  │  Total                            $3,188.64                             ││
│  └────────────────────────────────────────────────────────────────────────┘│
└────────────────────────────────────────────────────────────────────────────┘
```

#### Remittance Model

| Field | Type | Notes |
|-------|------|-------|
| Period Start | Date | Beginning of remittance period |
| Period End | Date | End of remittance period |
| Quarter | Char | Q1/Q2/Q3/Q4 |
| Due Date | Date | CRA due date (15th of following month) |
| Status | Selection | pending/due/past_due/paid |
| CPP Employee | Float | Sum of employee CPP |
| CPP Employer | Float | Sum of employer CPP |
| CPP2 Employee | Float | Sum of employee CPP2 |
| CPP2 Employer | Float | Sum of employer CPP2 |
| EI Employee | Float | Sum of employee EI |
| EI Employer | Float | Sum of employer EI (1.4x) |
| Income Tax | Float | Sum of income tax withheld |
| Total | Float | All amounts combined |
| Payment Date | Date | When paid |
| Payment Reference | Char | Bank reference |

#### Remittance Breakdown (Expandable)

| Line Item | Description |
|-----------|-------------|
| Canada Pension Plan Employer | Employer portion of CPP |
| Canada Pension Plan | Employee portion of CPP |
| Employment Insurance Employer | Employer EI (1.4× employee) |
| Employment Insurance | Employee EI |
| Income Tax | Federal + Provincial withheld |
| **Total** | Sum to remit to CRA |

#### Pay & File Actions

| Action | Description |
|--------|-------------|
| Pay & file | Process payment to CRA |
| Mark as paid | Manual payment recorded |

#### Remittance Due Dates (CRA Rules)

| Remitter Type | Due Date |
|---------------|----------|
| Regular (< $25K annual) | 15th of month following pay |
| Threshold 1 ($25K-$99K) | 15th of month following pay |
| Threshold 2 (≥ $100K) | 3rd working day after pay |
| Quarterly | 15th of month after quarter |

---

### 10B: Filings Tab

#### Filings Dashboard

```
┌────────────────────────────────────────────────────────────────────────────┐
│  [Payments]  [Filings]                                                      │
├────────────────────────────────────────────────────────────────────────────┤
│  ℹ️ Be sure to select a dental benefits code for each employee             │
│  The CRA needs to know who has access to any dental benefits you offer.    │
│  This info is required to file T4 slips.                                   │
├────────────────────────────────────────────────────────────────────────────┤
│  [Filter]                                    🖨️ Print  📄 Resources  📁 Archive
├────────────────────────────────────────────────────────────────────────────┤
│  ACTION NEEDED                                                              │
│  ┌──────────────────────────────────────────────────────────────────────┐  │
│  │  Woohoo! All caught up.                                              │  │
│  └──────────────────────────────────────────────────────────────────────┘  │
│                                                                             │
│  COMING UP                                                                  │
│  ┌──────────────────────────────────────────────────────────────────────┐  │
│  │ T4 Summary                    ℹ️ Not Due Yet   Due 03.02.2026        │  │
│  │ T4 Summary                                     Manually file [Preview]│  │
│  │ 01.01.2025 - 12.31.2025                                              │  │
│  ├──────────────────────────────────────────────────────────────────────┤  │
│  │ T4 Employer Slips             ℹ️ Not Due Yet   Due 03.02.2026        │  │
│  │ Employer copy of T4 slip(s)                    Manually file with XML│  │
│  │ 01.01.2025 - 12.31.2025                                   [Preview]  │  │
│  └──────────────────────────────────────────────────────────────────────┘  │
│                                                                             │
│  DONE                                                                       │
│  ┌──────────────────────────────────────────────────────────────────────┐  │
│  │  Nothing to see here (yet)!                                          │  │
│  └──────────────────────────────────────────────────────────────────────┘  │
│                                                                             │
│  Filing resources                                                           │
│  📄 Record of employment - These are the ROEs you've created               │
│  📁 Archived forms and filings - Completed tax filings and forms           │
│  📚 All filings resources - Tax filings, Federal tax forms, compliance     │
└────────────────────────────────────────────────────────────────────────────┘
```

#### Filing Types

| Filing | Description | Due Date | Format |
|--------|-------------|----------|--------|
| T4 Summary | Employer summary of all T4s | Last day of February | PDF/XML |
| T4 Employer Slips | Individual T4 for each employee | Last day of February | PDF/XML |
| ROE | Record of Employment | 5 days after interruption | BLK/PDF |

#### Filing Status

| Status | Icon | Description |
|--------|------|-------------|
| Not Due Yet | ℹ️ Blue | Future filing, preview available |
| Due Soon | ⚠️ Yellow | Coming up soon |
| Past Due | 🔴 Red | Overdue, action needed |
| Completed | ✅ Green | Filed and archived |

---

### 10C: T4 Summary Form

#### Official CRA T4 Summary (Form T4 SUM)

| Box | Field Name | Description | Source |
|-----|------------|-------------|--------|
| - | Year | Tax year (e.g., 2025) | System |
| - | Employer Account | 15-char BN (808902308RP0001) | Company settings |
| - | Employer Name/Address | Company info | Company settings |
| 88 | Total T4 slips filed | Count of employees | Calculated |
| 14 | Employment income | Total of all Box 14 on T4s | Sum from payslips |
| 16 | Employees' CPP contributions | Total employee CPP | Sum from payslips |
| 16A | Employees' second CPP (CPP2) | Total employee CPP2 | Sum from payslips |
| 17 | Employees' QPP contributions | Quebec only | Sum from payslips |
| 17A | Employees' second QPP | Quebec only | Sum from payslips |
| 18 | Employees' EI premiums | Total employee EI | Sum from payslips |
| 19 | Employer's EI premiums | Total employer EI (1.4x) | Sum from payslips |
| 20 | RPP contributions | Registered Pension Plan | Sum from payslips |
| 22 | Income tax deducted | Federal + Provincial tax | Sum from payslips |
| 27 | Employer's CPP contributions | Total employer CPP | Sum from payslips |
| 27A | Employer's second CPP | Total employer CPP2 | Sum from payslips |
| 52 | Pension adjustment | If applicable | Sum from payslips |
| 80 | Total deductions | 16+16A+27+27A+18+19+22 | Calculated |
| 82 | Minus: remittances | Payments made during year | Sum of remittances |
| - | Difference | Box 80 - Box 82 | Calculated |
| 84 | Overpayment | If remittances > deductions | Calculated |
| 86 | Balance due | If deductions > remittances | Calculated |
| 74 | SIN of proprietor | For sole proprietors | Company settings |
| 76 | Person to contact | Contact name | User |
| 78 | Telephone | Contact phone | User |

#### T4 Summary Example Values (from screenshot)

| Box | Value |
|-----|-------|
| 88 | 5 employees |
| 14 | $124,011.68 |
| 16 | $6,810.02 |
| 27 | $6,810.02 |
| 18 | $2,033.81 |
| 19 | $2,847.35 |
| 22 | $15,053.84 |
| 80 | $33,555.04 |
| 86 | $33,555.04 (balance due) |

#### Electronic Filing Requirement

> **Mandatory electronic filing** if you have more than 5 information returns of the same type.

Filing formats:
- Internet file transfer (XML)
- Web Forms (online)

---

### 10D: T4 Individual Slips

Each employee receives a T4 slip with their individual amounts.

| Box | Field |
|-----|-------|
| 14 | Employment income |
| 16 | Employee's CPP contributions |
| 16A | Employee's CPP2 contributions |
| 17 | Employee's QPP (Quebec) |
| 18 | Employee's EI premiums |
| 22 | Income tax deducted |
| 24 | EI insurable earnings |
| 26 | CPP/QPP pensionable earnings |
| 44 | Union dues |
| 46 | Charitable donations |
| 50 | RPP or DPSP registration number |
| 52 | Pension adjustment |
| 55 | Employee's PPIP premiums (Quebec) |
| 56 | PPIP insurable earnings |

---

## Phase 11: Reports

### Employee Reports

| Report | Description | Priority |
|--------|-------------|----------|
| Pay Stub | Individual employee pay stub (PDF) | HIGH |
| Paycheque List | List of all paycheques for employee | HIGH |
| YTD Summary | Year-to-date earnings and deductions | MEDIUM |
| T4 Slip | Individual year-end tax slip | HIGH |

### Employer/Accountant Reports

| Report | Description | Priority |
|--------|-------------|----------|
| Payroll Register | All employees for pay period | HIGH |
| Payroll Summary | Summary by department/location | MEDIUM |
| Remittance Summary | CPP, EI, Tax amounts to remit | HIGH |
| T4 Summary | Year-end employer summary | HIGH |
| T4 Slips (All) | All employee T4s | HIGH |
| RL-1 (Quebec) | Quebec year-end slip | LOW |
| ROE Report | Pending ROE to issue | MEDIUM |

---

## Implementation Order

### Priority 1 - Foundation (Must Have)
1. [ ] Employee Profile Enhancement (Personal Info)
2. [ ] Employment Status & ROE Codes
3. [ ] **ROE Generation & BLK File Export** ⭐ NEW
4. [ ] Tax Withholdings (TD1)
5. [ ] Base Pay Configuration

### Priority 2 - Core Payroll (Must Have)
5. [ ] Pay Schedules (Weekly, Bi-Weekly, Semi-Monthly, Monthly)
6. [ ] Additional Pay Types (Stat Holiday, Overtime)
7. [ ] Vacation Pay (% payout)
8. [ ] CPP2 (Second Canada Pension Plan)

### Priority 3 - Reporting (Must Have)
9. [ ] Enhanced Pay Stub Report
10. [ ] Paycheque Entry Form (detailed view)
11. [ ] Payroll Cheque Printing

### Priority 4 - Tax Centre & Compliance (Must Have)
12. [ ] **Payroll Tax Centre Dashboard** ⭐ NEW
13. [ ] Tax Remittance Tracking (Payments tab)
14. [x] **T4 Summary Generation** ✅ (with PDF field positioning system)
15. [x] **T4 Individual Slips** ✅ (with PDF field positioning system)
16. [ ] Remittance Due Date Alerts
17. [x] **PDF Field Positioning System** ✅ - Dynamic configuration for T4/T4A PDF text overlay (see `docs/PDF_FIELD_POSITIONING.md`)

### Priority 5 - Advanced Features (Nice to Have)
17. [ ] Deductions & Contributions
18. [ ] RL-1 Reports (Quebec)
19. [ ] Workers' Comp Integration
20. [ ] Direct Deposit Files

---

## Questions & Decisions Needed

### Answered ✅
- [ ] 

### Pending ❓
1. **Pay Schedules**: Which ones do you need? (Weekly/Bi-Weekly/Semi-Monthly/Monthly)
2. **Provinces**: Just Ontario or all provinces?
3. **Vacation**: Payout each period (4%) or accrued?
4. **Deductions**: What specific deductions do you offer?
5. **Reports**: Which reports are most critical?
6. **Multi-company**: Do you have multiple employers?
7. **Integration**: Need bank file export? Which banks?

---

## Notes from User

*(Add notes from discussions here)*

- QuickBooks screenshots provided for reference
- ROE codes from QuickBooks captured (all Service Canada codes)
- Pay stub format from QuickBooks captured
- User wants comprehensive implementation like QuickBooks
- **ROE Generation**: QuickBooks generates official ROE form, exports as BLK file for ROE Web submission
- **5-day deadline**: System should remind about 5-day submission deadline
- **ROE Archive**: Keep historical ROE records with BLK and PDF files
- **Paycheque Entry**: Detailed form with collapsible sections (Pay, Employee taxes, Employer taxes, Time off)
- **CPP2**: Second Canada Pension Plan introduced 2024, separate line item
- **Employer EI**: 1.4× employee contribution (key calculation!)
- **Employer CPP/CPP2**: 1:1 match with employee
- **Time Off Tracking**: Tracks both hours AND dollar amounts (accrued/used/available)
- **Cheque Printing**: Letter size payroll cheques - Odoo Enterprise has base cheque printing to extend
- **Payroll Tax Centre**: Central dashboard for tax remittances and government filings
- **Remittance Breakdown**: CPP (employee+employer), EI (employee+employer 1.4x), Income Tax
- **Due Dates**: Remittances due 15th of following month (regular remitters)
- **T4 Summary**: All CRA boxes documented (88, 14, 16, 16A, 18, 19, 22, 27, 27A, 80, 82, 84, 86)
- **T4 Filing Deadline**: Last day of February following tax year
- **Electronic Filing**: Mandatory if >5 returns (XML or Web Forms)
- **Dental Benefits Alert**: CRA requires T4 dental code for each employee
- **PDF Field Positioning**: ✅ Implemented dynamic field positioning system for T4/T4A PDF generation using flattened templates and ReportLab text overlay. Users can configure field positions, font sizes, and font names through UI. See `docs/PDF_FIELD_POSITIONING.md` for full documentation.

---

## Version History

| Date | Changes |
|------|---------|
| 2024-12-31 | Initial plan created |
| 2024-12-31 | Added ROE codes from QuickBooks screenshots |
| 2024-12-31 | Added Pay Stub layout from QuickBooks |
| 2024-12-31 | Added Employment Details fields |
| 2024-12-31 | **Added ROE Generation workflow & BLK file format** (Phase 2B) |
| 2024-12-31 | Added ROE form fields (all 22 boxes) |
| 2024-12-31 | Added ROE Archive model structure |
| 2024-12-31 | **Added Paycheque Entry Form** (Phase 8) - detailed layout |
| 2024-12-31 | Added Employee Taxes breakdown (Income Tax, EI, CPP, CPP2) |
| 2024-12-31 | Added Employer Taxes (EI=1.4x employee, CPP=1:1 match) |
| 2024-12-31 | Added Time Off tracking (hours + amounts) |
| 2024-12-31 | Added Payroll Cheque Printing section (Phase 9B) - extends Odoo Enterprise base |
| 2024-12-31 | **Added Payroll Tax Centre** (Phase 10) - Payments & Filings tabs |
| 2024-12-31 | Added Tax Remittance tracking with CPP/EI/Income Tax breakdown |
| 2024-12-31 | Added T4 Summary form with all CRA box numbers (88, 14, 16, 18, 19, 22, etc.) |
| 2024-12-31 | Added T4 Individual Slips structure |
| 2024-12-31 | Added Filing deadlines and electronic filing requirements |
| 2025-01-XX | **✅ IMPLEMENTED: PDF Field Positioning System** - Dynamic configuration interface for T4/T4A PDF text overlay positions. See `docs/PDF_FIELD_POSITIONING.md` for details |
