Bug 23674 will add the ability to have a note on the transaction table in a patron account. This enhancement will make each of those notes editable after they have been submitted.
Created attachment 168211 [details] [review] Bug 37211: Make notes in patron transactions table editable This patch adds an edit button to each notes field in an accountline entry. This feature is controlled by a new staff permision under the 'updatecharges' permision called 'edit_notes'. To test: 1) Apply patch, updatedatabase, restart_all 2) In the staff interface, give your logged in user superlibrarian permissions. 3) Visit a patron's accounting tab. Create a manual invoice for some amount and enter a note. 4) Create another manual invoice, this time do not enter a note. 5) Click on the transactions tab to view the table. 6) See that the notes column now has edit buttons. 7) Attempt to edit the note that is not blank. 8) A modal should pop up prompting you to edit your note. The previous note should be in the text box. 9) Edit this note and press confirm. 10) Ensure the note was updated and the updated column was filled with the correct time. 11) Now attempt to edit the blank note. 12) Again, you should see a modal but no prefilled message. Update this note and ensure correct changes. 13) Go back to the permissions for your logged in user and remove the 'edit_notes' subpermission under the 'updatecharges' permissions. 14) Go back to the patron's accounting tab. This time, there should not be any edit buttons in the notes column.
Created attachment 168212 [details] [review] Bug 37211: Add new subpermission in updatecharge 'edit_notes'
Applying: Bug 37211: Make notes in patron transactions table editable error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt). error: could not build fake ancestor Patch failed at 0001 Bug 37211: Make notes in patron transactions table editable
Created attachment 170002 [details] [review] Bug 37211: Make notes in patron transactions table editable This patch adds an edit button to each notes field in an accountline entry. This feature is controlled by a new staff permision under the 'updatecharges' permision called 'edit_notes'. To test: 1) Apply patch, updatedatabase, restart_all 2) In the staff interface, give your logged in user superlibrarian permissions. 3) Visit a patron's accounting tab. Create a manual invoice for some amount and enter a note. 4) Create another manual invoice, this time do not enter a note. 5) Click on the transactions tab to view the table. 6) See that the notes column now has edit buttons. 7) Attempt to edit the note that is not blank. 8) A modal should pop up prompting you to edit your note. The previous note should be in the text box. 9) Edit this note and press confirm. 10) Ensure the note was updated and the updated column was filled with the correct time. 11) Now attempt to edit the blank note. 12) Again, you should see a modal but no prefilled message. Update this note and ensure correct changes. 13) Go back to the permissions for your logged in user and remove the 'edit_notes' subpermission under the 'updatecharges' permissions. 14) Go back to the patron's accounting tab. This time, there should not be any edit buttons in the notes column.
Created attachment 170003 [details] [review] Bug 37211: Add new subpermission in updatecharge 'edit_notes'
Applying: Bug 37211: Add new subpermission in updatecharge 'edit_notes' error: sha1 information is lacking or useless (installer/data/mysql/mandatory/userpermissions.sql). error: could not build fake ancestor Patch failed at 0001 Bug 37211: Add new subpermission in updatecharge 'edit_notes'
(In reply to Eric Garcia from comment #6) > Applying: Bug 37211: Add new subpermission in updatecharge 'edit_notes' > error: sha1 information is lacking or useless > (installer/data/mysql/mandatory/userpermissions.sql). > error: could not build fake ancestor > Patch failed at 0001 Bug 37211: Add new subpermission in updatecharge > 'edit_notes' I'm not getting this... maybe try a 'git pull'?
Created attachment 170218 [details] [review] Bug 37211: Make notes in patron transactions table editable This patch adds an edit button to each notes field in an accountline entry. This feature is controlled by a new staff permision under the 'updatecharges' permision called 'edit_notes'. To test: 1) Apply patch, updatedatabase, restart_all 2) In the staff interface, give your logged in user superlibrarian permissions. 3) Visit a patron's accounting tab. Create a manual invoice for some amount and enter a note. 4) Create another manual invoice, this time do not enter a note. 5) Click on the transactions tab to view the table. 6) See that the notes column now has edit buttons. 7) Attempt to edit the note that is not blank. 8) A modal should pop up prompting you to edit your note. The previous note should be in the text box. 9) Edit this note and press confirm. 10) Ensure the note was updated and the updated column was filled with the correct time. 11) Now attempt to edit the blank note. 12) Again, you should see a modal but no prefilled message. Update this note and ensure correct changes. 13) Go back to the permissions for your logged in user and remove the 'edit_notes' subpermission under the 'updatecharges' permissions. 14) Go back to the patron's accounting tab. This time, there should not be any edit buttons in the notes column. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Created attachment 170219 [details] [review] Bug 37211: Add new subpermission in updatecharge 'edit_notes' Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment on attachment 170218 [details] [review] Bug 37211: Make notes in patron transactions table editable Review of attachment 170218 [details] [review]: ----------------------------------------------------------------- ::: members/boraccount.pl @@ +235,5 @@ > + sub { > + # Update the note and date in the account line > + $payment->set( > + { > + date => \'NOW()', I'm not sure we should be updating the date here... we have a timestamp field in the accountlines table that already updates on any change to the accountline.. the date field is meant for recording when the accountline was created.
Created attachment 177244 [details] [review] Bug 37211: (QA follow-up) Don't reset creation date on update We shouldn't be resetting an accountlines creation date when we update the associated note. We have 'timestamp' for updates already.
Created attachment 177245 [details] [review] Bug 37211: (QA follow-up) Update database update to be idempotent
Created attachment 177248 [details] [review] Bug 37211: Make notes in patron transactions table editable This patch adds an edit button to each notes field in an accountline entry. This feature is controlled by a new staff permision under the 'updatecharges' permision called 'edit_notes'. To test: 1) Apply patch, updatedatabase, restart_all 2) In the staff interface, give your logged in user superlibrarian permissions. 3) Visit a patron's accounting tab. Create a manual invoice for some amount and enter a note. 4) Create another manual invoice, this time do not enter a note. 5) Click on the transactions tab to view the table. 6) See that the notes column now has edit buttons. 7) Attempt to edit the note that is not blank. 8) A modal should pop up prompting you to edit your note. The previous note should be in the text box. 9) Edit this note and press confirm. 10) Ensure the note was updated and the updated column was filled with the correct time. 11) Now attempt to edit the blank note. 12) Again, you should see a modal but no prefilled message. Update this note and ensure correct changes. 13) Go back to the permissions for your logged in user and remove the 'edit_notes' subpermission under the 'updatecharges' permissions. 14) Go back to the patron's accounting tab. This time, there should not be any edit buttons in the notes column. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 177249 [details] [review] Bug 37211: Add new subpermission in updatecharge 'edit_notes' Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 177250 [details] [review] Bug 37211: (QA follow-up) Don't reset creation date on update We shouldn't be resetting an accountlines creation date when we update the associated note. We have 'timestamp' for updates already. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 177251 [details] [review] Bug 37211: (QA follow-up) Update database update to be idempotent Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 177252 [details] [review] Bug 37211: (QA follow-up) Update for bootstrap5 and remove copy/paste There were some unneeded data elements being passed around and we also needed to update from data- to data-bs- in places to get the modals working again. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I did some required follow-ups here to get it over the line. Last comment is that I'm not sure about the styling/placement of the edit button... but I'm sure someone clever will come along and help clean that up so I'm not going to block the feature here. Passing QA
Created attachment 177261 [details] [review] Bug 37211: (QA follow-up) Make note edit button styles less intrusive, align To override the padding on .btn-xs I had to inline style="padding: 0;", it would be nice to have inline-btn variants (that come without padding or margin) for datatables because this is probably a common problem.