Bug 40795 - Fix +add note function on payment table
Summary: Fix +add note function on payment table
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Lisette Scheer
QA Contact: Testopia
URL:
Keywords:
Depends on: 23674
Blocks:
  Show dependency treegraph
 
Reported: 2025-09-11 17:40 UTC by Juliet Heltibridle
Modified: 2025-10-28 12:45 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This updates the tables for a patron's accounting 'Make a payment' tab (members/pay.pl) and 'Transactions' tab to use a consistent UI when adding and editing the notes field, using a pop-up window for adding and edit a note. An 'Edit' action button is now used to edit all existing notes (which opens a pop-up window to edit the note). An 'Add' action button is now used to add a new note (which opens a pop-up window to add a note).
Version(s) released in:
Circulation function:


Attachments
Bug 40795: Fix +add note function on payment table (9.89 KB, patch)
2025-10-02 18:03 UTC, Lisette Scheer
Details | Diff | Splinter Review
Bug 40795: Fix +add note function on payment table (9.93 KB, patch)
2025-10-28 12:12 UTC, David Nind
Details | Diff | Splinter Review
Screenshots - before and after the patch (191.28 KB, application/pdf)
2025-10-28 12:38 UTC, David Nind
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juliet Heltibridle 2025-09-11 17:40:49 UTC
Now that bug 23674 allows notes on all transactions in the transactions table, the +Add note function in the payments table can cause some additional confusion. In the payments table (pay.pl) you can click on +Add Note, but the note can't be saved unless you pay the fine in the payment screen. The same note can now be edited or saved in the transactions table in 25.05.

Steps to duplicate issue:
1. Go to a patron with outstanding fines/fees
2. Go to the Make a payment tab
3. In the payments table, click +Add Note for a transaction
4. Type a note.
5. Note that there is no way to save the edit. 
6. Press enter on the note, Koha takes you to the payment screen, where the changes are shown, but you must pay the fine to save the change.
7. Go to the transactions tab in 25.05.
8. Click edit and type a note and confirm
8. Go to Make a payment tab and see the note you added. The note will look like it is selected for additional editing.

I would like to either see this column become uneditable (so you have to edit it in the transactions table) or have it function the same as the transactions table (have an edit button that opens a popup to edit the note).
Comment 1 Juliet Heltibridle 2025-09-18 15:02:55 UTC
I'm noticing now that Koha does actually save the contents of what you typed into the form, but it stays "open" for editing when you are on the add transaction page, which makes it look like it's not going to save when you navigate away from the page. So I think the actual fix we need is to have Koha give the user some indication that the note is saved, and then to "close" the form until an edit button is clicked again.
Comment 2 Lisette Scheer 2025-10-02 18:03:53 UTC
Created attachment 187310 [details] [review]
Bug 40795: Fix +add note function on payment table

This patch updates the table on members/pay.pl to have consistant ui with the transactions table, using a modal.

On members/pay.pl if there's no note, a note can still be added without the edit permission to allow for notes at time of payment, consistent with current behavior.
I also updated the logic with the buttons on both pages to show as "add" when there's not a note present.

To test:
1. Before applying patches, navigate to a user in your test environment (I used 23529000035676)
2. Click "Accounting" in the left hand link list
3. Create manual invoice, give it an amount but no note
4. Create another manual invoice, give it an amount and any note.
5. Navigate to "Transactions" observe both notes have an edit button.
6. Click edit on the one with a note, update it, and save. Note it has been updated.
7. Navigate to "Make a payment" Observe both columns have a text box that's immediately editable. The note should be filled on the charge with a note.
8. Apply the patch
9. Repeat step 5, observe the column with no note says "Add" now.
10. Repeat step 7, observe the payment note field matches the "note" field on transactions.
11. Edit the existing note and save
12. Add a new note for the other transaction and save.
Comment 3 David Nind 2025-10-28 12:12:51 UTC
Created attachment 188507 [details] [review]
Bug 40795: Fix +add note function on payment table

This patch updates the table on members/pay.pl to have consistant ui with the transactions table, using a modal.

On members/pay.pl if there's no note, a note can still be added without the edit permission to allow for notes at time of payment, consistent with current behavior.
I also updated the logic with the buttons on both pages to show as "add" when there's not a note present.

To test:
1. Before applying patches, navigate to a user in your test environment (I used 23529000035676)
2. Click "Accounting" in the left hand link list
3. Create manual invoice, give it an amount but no note
4. Create another manual invoice, give it an amount and any note.
5. Navigate to "Transactions" observe both notes have an edit button.
6. Click edit on the one with a note, update it, and save. Note it has been updated.
7. Navigate to "Make a payment" Observe both columns have a text box that's immediately editable. The note should be filled on the charge with a note.
8. Apply the patch
9. Repeat step 5, observe the column with no note says "Add" now.
10. Repeat step 7, observe the payment note field matches the "note" field on transactions.
11. Edit the existing note and save
12. Add a new note for the other transaction and save.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-10-28 12:38:07 UTC
Created attachment 188508 [details]
Screenshots - before and after the patch

I've attached screenshots before and after the patch.

- Transactions tab:
  . Transaction with no note: no text and an 'Edit' action button ==> no text and an '+ Add' action button
  . Transaction with a note: the text and an 'Edit' action button ==> the text and a 'Edit' action button (no change)

- Make a payment tab:
  . Transaction with no note: '+ Add note' link ==> '+ Add' action button
  . Transaction with a note: an editable note field ==> the text and an 'Edit' action button

Both are now consistent after the patch.