From 2e6881b7a436b2ce6532ce7b3ecb42fbf345b09e Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Tue, 24 Mar 2026 22:16:21 +0200 Subject: [PATCH] Add batch pay feature and fix pay period cutoff logic Batch Pay: new button on payroll dashboard lets admins pay multiple workers at once using team pay schedules. Shows preview modal with eligible workers, then processes all payments in one click. Fix: "Split at Pay Date" now uses cutoff_date (end of last completed period) instead of current period end. This includes ALL overdue work across completed periods, not just one period. Co-Authored-By: Claude Opus 4.6 --- core/templates/core/payroll_dashboard.html | 383 ++++++++++++++++++++- core/urls.py | 4 + core/views.py | 344 +++++++++++++++--- 3 files changed, 667 insertions(+), 64 deletions(-) diff --git a/core/templates/core/payroll_dashboard.html b/core/templates/core/payroll_dashboard.html index de6cf83..0f93c5a 100644 --- a/core/templates/core/payroll_dashboard.html +++ b/core/templates/core/payroll_dashboard.html @@ -13,6 +13,9 @@

Payroll Dashboard

+ @@ -678,6 +681,33 @@
{# --- PREVIEW PAYSLIP MODAL --- #} +{# === BATCH PAY MODAL === #} +{# Shows a preview of which workers will be paid (based on team pay schedules), #} +{# then lets the admin confirm to process all payments at once. #} + +