Skip to content

fix(payroll): filter submitted records in get_payroll_entries_for_jv - #4997

Open
pratheep-bit wants to merge 1 commit into
frappe:developfrom
pratheep-bit:fix/payroll-entries-for-jv-docstatus-filter
Open

fix(payroll): filter submitted records in get_payroll_entries_for_jv#4997
pratheep-bit wants to merge 1 commit into
frappe:developfrom
pratheep-bit:fix/payroll-entries-for-jv-docstatus-filter

Conversation

@pratheep-bit

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Filter Submitted Records: Added .where(PayrollEntry.docstatus == 1) condition to the QueryBuilder query in get_payroll_entries_for_jv().
  • Reason: Payroll Entry is a submittable Doctype. Previously, Draft (docstatus=0) and Cancelled (docstatus=2) records were returned in Journal Entry selection dialogs. Adding docstatus = 1 ensures only submitted payroll entries are available for linking in Journal Entries.
  • Unit Test: Added test_get_payroll_entries_for_jv_filters_docstatus in test_payroll_entry.py.

@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is a single targeted filter addition with no side effects on other query paths.

The fix is minimal and correct: adding docstatus == 1 to a QueryBuilder chain only affects this one function, and the test confirms draft entries are excluded from results.

Files Needing Attention: No files require special attention.

Reviews (2): Last reviewed commit: "fix(payroll): filter submitted records i..." | Re-trigger Greptile

Comment thread hrms/payroll/doctype/payroll_entry/test_payroll_entry.py Outdated
@mergify

mergify Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@pratheep-bit
pratheep-bit force-pushed the fix/payroll-entries-for-jv-docstatus-filter branch from 9ff2e68 to d22b2e3 Compare July 29, 2026 08:41
@pratheep-bit

Copy link
Copy Markdown
Contributor Author

Hi @iamkhanraheel,

Updated in PR #4997 to create a Draft Payroll Entry and assert that it is excluded () from the query results.

Force-pushed clean commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants