Bug 41585 - Refunds don't always appear on the register page
Summary: Refunds don't always appear on the register page
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Point of Sale (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-09 14:33 UTC by Martin Renvoize (ashimema)
Modified: 2026-01-12 13:19 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41585: Fix cash refund payouts not appearing in register transactions (4.58 KB, patch)
2026-01-10 10:53 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2026-01-09 14:33:04 UTC
We're not consistently recording cash registers for refund actions.. cash refunds in particular should require a cash register.
Comment 1 Martin Renvoize (ashimema) 2026-01-10 10:52:53 UTC
I was wrong.. we have been generally handling this correctly.. what we weren't doing properly was the redirect flow to reload the page and display the results of the refund action.
Comment 2 Martin Renvoize (ashimema) 2026-01-10 10:53:36 UTC
Created attachment 191238 [details] [review]
Bug 41585: Fix cash refund payouts not appearing in register transactions

This patch fixes two issues with cash refunds on the register page:

1. Payouts were not appearing in the transactions table after being
   created because accountlines were fetched before the refund
   operation completed.

2. Account credit (AC) refunds were incorrectly creating payout
   transactions when no cash should leave the register.

Changes:
- Only create payout for non-AC refund types
- Use explicit registerid from page context for payout
- Add POST/REDIRECT/GET pattern after refund to refresh page data
- Add client-side validation for cash register requirement on patron
  account page

Test plan:
1. Navigate to POS register page with transactions
2. Issue a cash refund on a transaction
3. Verify the payout appears in the transactions table
4. Issue an account credit (AC) refund
5. Verify no payout is created (only the refund credit)
6. On patron account page, attempt cash refund without register
7. Verify validation message appears