Skip to content

test: add void payment entry workflow test#387

Merged
agritheory merged 3 commits intoversion-15from
test/void_pe_workflow
Jan 14, 2026
Merged

test: add void payment entry workflow test#387
agritheory merged 3 commits intoversion-15from
test/void_pe_workflow

Conversation

@HKuz
Copy link
Copy Markdown
Collaborator

@HKuz HKuz commented Jan 5, 2026

Closes #382

  • includes checking the outstanding amount in the source document
  • includes T accounts with before/ after in the tests and add these to the documentation as well
  • adds a dialog in the Payment Entry UI when "Void" workflow is selected to choose the as/of date, with validation the chosen date isn't before the PE's posting date
voidable_pe_as_of_date_dialog
  • Should we be manipulating the Payment Ledger Entries? When a PE is voided, the Payment Ledger Entry is reversed and de-linked (same as Cancel), so the invoice will show up again in the A/P Report as still outstanding, with aging calculated based on the original PI's due date. So if you pay an invoice on time, then find out 30 days later the check never arrived and Void the PE as of that day, the A/P Report still shows Invoice is 30 days late. We'll need to decide what behavior we want if this isn't it. UPDATE: see comment below

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 5, 2026

📝 Draft Changelog Entry

Changelog: Enhanced Void Payment Entry Workflow

This update adds a new dialog when voiding payment entries that allows users to select an "as of" date for the void transaction. When selecting the "Void" workflow option in the Payment Entry interface, users will now be prompted to choose a specific date for when the void should take effect. The system validates that the selected date is not before the payment entry's original posting date, ensuring proper accounting records.

The documentation has been expanded to include more detailed information about permissions related to payment entry workflows, helping administrators better understand and configure access controls for these processes.

GitHub-flavoured markdown version of this changelog is ready for inclusion in release notes.

This changelog entry was automatically generated by the Changelog Generator Action.

@HKuz
Copy link
Copy Markdown
Collaborator Author

HKuz commented Jan 9, 2026

For Payment Ledger Entries (PLE), I ran a test to see what the Accounts Payable report showed for a Voided Payment Entry - if I used a date prior to the Void date, did it remove the Invoice from results, presuming it was paid? Unfortunately, no - it applied the same behavior as a Cancel - it created an offsetting PLE, then DELINKED both that and the original payment one. All PLE queries for reports ignore delinked entries, so it effectively made it as if the payment never existed.

ERPNext has slightly different behavior for PLE if the immutable ledger feature is enabled - it creates the offsetting PLE using current date, but keeps them linked. So the A/P report shows the Invoice is paid with report date between the original payment date up to cancellation date, then outstanding afterwards. So I created an override here that's similar to that - Voided Payment Entries will create an offsetting PLE using the void date, but the PLEs are still linked. (Note that if the immutable ledger feature is enabled, then that behavior persists - it will use the cancellation date for the PLE's posting date).

For testing (in a new reinstall since there were some light changes to fixtures):

  • got to Workflow, click "is active" in the Void Payment Entry" one, (may need to do a hard reload of the page)
  • grab an o/s PI and duplicate it, using Nov-01 posting date, Net 30 terms (I've been using Coop Ag ones)
  • create a payment entry against it with MOP of Check, Dec-01 posting date and check ref date. Save/submit
  • void payment entry and use Dec-31 date
  • go to ledger (make sure 'show cancelled' is checked), confirm GL entries use Dec-31 (not today's date - there was an async bug that wasn't capturing the void date - I think I squashed it)
  • go to A/P report, report date of today's date should show that invoice overdue. Change the report date to Dec-30, should remove the Invoice from results

@agritheory agritheory merged commit 2986beb into version-15 Jan 14, 2026
6 checks passed
@agritheory agritheory deleted the test/void_pe_workflow branch January 14, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants