Koha-clms/pos
Martin Renvoize 78f7abc855
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

Signed-off-by: Jackie Usher <jackie.usher@westsussex.gov.uk>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
2026-03-21 17:26:44 +00:00
..
pay.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
printreceipt.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
register.pl Bug 41585: Fix cash refund payouts not appearing in register transactions 2026-03-21 17:26:44 +00:00
registers.pl Bug 38728: (follow-up) Fix cashup modal triggering after POST/REDIRECT/GET implementation 2026-01-22 09:25:59 -07:00