https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41592

--- Comment #7 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 193263
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193263&action=edit
Bug 41592: Refactor patron account page to use shared refund modal

This patch refactors the patron account page (boraccount.tt) to use the
new shared refund modal component created in the previous commit, removing
duplicate code and providing a consistent refund experience across both
the Point of Sale and patron account pages.

Changes:
- Replace inline refund modal with shared refund_modal.inc component
- Update modal population JavaScript to work with new modal structure:
  * Parse amount and amountoutstanding as floats for proper formatting
  * Populate transaction details fields (description, original charge, amount
paid)
  * Hide payment method and original register rows (not applicable in this
context)
  * Update form field IDs to match new modal structure
- Fix focus to use #refund_amount instead of deprecated #returned field
- Update cash register validation to use #refund_registerid_select
- Add html_helpers.inc for proper formatting support

The shared modal intelligently adapts to different contexts, showing only
relevant information based on available data. For patron account refunds,
payment method and original register information are hidden since debits
can be paid by multiple credits with different payment methods.

Test plan:
1. Apply patch and rebuild: yarn build
2. Navigate to a patron's account page with paid charges
3. Click "Issue refund" on a debit that has been partially or fully paid
4. Verify refund modal displays:
   - Transaction description (properly formatted)
   - Original charge amount (properly formatted with currency)
   - Amount paid (properly formatted)
   - No payment method row (hidden in this context)
   - No original register row (hidden in this context)
5. Enter a refund amount and complete the refund
6. Verify the refund is processed successfully
7. Verify cash register validation works when UseCashRegisters is enabled

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to