Repository navigation
fix(vendor): block invoice edits after approval or payment - #614
Open
prince-shakyaa wants to merge 1 commit into
Open
prince-shakyaa wants to merge 1 commit into
prince-shakyaa wants to merge 1 commit into
Conversation
Vendors could change the amount and other fields of an invoice that was already approved or paid, and the status stayed the same. The update endpoint now returns 409 for approved and paid invoices, and the Edit button is hidden for them. Rejected invoices stay editable so they can be fixed and re-processed. Fixes GenAI-Security-Project#613
prince-shakyaa
force-pushed
the
fix/invoice-edit-after-decision
branch
from
October 28, 2026 20:27
c16254b to
160466c
Compare
Author
|
Hi @saikishu @e2hln, this fixes #613. I left rejected invoices editable on purpose so vendors can fix them and hit Re-process. If you'd rather lock those too, it's a one-line change and I can update it. Tests are in |
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #613
What was wrong
PUT /vendor/api/v1/invoices/{id}let a vendor change the amount, number, dates and attachments of an invoice in any status. An invoice approved for $100 could be changed to $45,000 and stay approved, and paid invoices could be changed after the money had gone out.What changed
finbot/apps/vendor/routes/api.py: the update endpoint now returns 409 if the invoice isapprovedorpaid. The ownership check is unchanged and still runs first.finbot/static/js/vendor/invoice.js: the Edit button is hidden for approved and paid invoices, both in the table and in the invoice details sidecar.Rejected invoices can still be edited, since nothing gets paid and the vendor can fix them and hit Re-process to get them reviewed again.
Testing
tests/unit/vendor/test_invoice_edit_lock.py:tests/unit/agents/test_specialized_agents.py, which fail on main as well.