diff --git a/core/templates/core/payroll_dashboard.html b/core/templates/core/payroll_dashboard.html index 4f16c6b..9e0525e 100644 --- a/core/templates/core/payroll_dashboard.html +++ b/core/templates/core/payroll_dashboard.html @@ -1079,12 +1079,17 @@ {% endfor %} + Select All Clear
{% for w in all_workers %} -
+
@@ -1998,6 +2003,24 @@ document.addEventListener('DOMContentLoaded', function() { }); } + // Pay-type filter: show/hide picker rows by data-pay-type. + // Display-only — selection state still lives on the checkboxes; + // hidden rows keep whatever checked state they had. "All" (empty + // value) reveals every row again. Same pattern as the pending-table + // team/loan client-side filters. + var addAdjPayTypeFilter = document.getElementById('addAdjPayTypeFilter'); + if (addAdjPayTypeFilter) { + addAdjPayTypeFilter.addEventListener('change', function() { + var want = this.value; // '', 'daily', or 'fixed' + addAdjWorkerCheckboxes.forEach(function(cb) { + var row = cb.closest('.form-check'); + if (!row) return; + var rowType = row.getAttribute('data-pay-type') || ''; + row.style.display = (!want || rowType === want) ? '' : 'none'; + }); + }); + } + // === QUICK ADJUST BUTTON === // Opens the Add Adjustment modal with one worker pre-checked // and their most recent project pre-selected. diff --git a/core/tests.py b/core/tests.py index 2e92f1d..86d5b07 100644 --- a/core/tests.py +++ b/core/tests.py @@ -3826,6 +3826,24 @@ class ManagerSalariedPayUITests(TestCase): self.assertContains(resp, 'Manager / Salaried') self.assertContains(resp, '>Daily') + def test_add_adjustment_modal_has_pay_type_scaffolding(self): + # The Add-Adjustment modal must (a) still include a manager in + # the picker (the must-stay-payable invariant), (b) tag that + # row with data-pay-type="fixed", and (c) render the client-side + # "pay type" filter