Bug 20527 - "label" tag linked to the wrong "input" tag (wrong "for" attribute) in paycollect.tt
Summary: "label" tag linked to the wrong "input" tag (wrong "for" attribute) in paycol...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Eden
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2018-04-05 14:28 UTC by Victor Grousset/tuxayo
Modified: 2021-12-13 21:11 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the HTML 'label for=""' element for the Writeoff amount field on the Accounting > Make a payment form for a patron - changes "paid" to "amountwrittenoff".
Version(s) released in:
21.05.00,20.11.03,20.05.09,19.11.15
Circulation function:


Attachments
Bug 20527: Made the "Writeoff amount" input focus when the "Pay fines" tab loads. (1.18 KB, patch)
2019-01-16 01:31 UTC, Ethan
Details | Diff | Splinter Review
Bug 20527: Significant inputs will be focused on in the "Accounting" section of a patron. (6.21 KB, patch)
2019-01-16 22:16 UTC, Ethan
Details | Diff | Splinter Review
Bug 20527: Removing focus from payment note (1.21 KB, patch)
2019-01-17 01:09 UTC, Ethan
Details | Diff | Splinter Review
Bug 20527: Significant inputs will be focused on in the "Accounting" section of a patron. (6.26 KB, patch)
2019-01-17 08:04 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 20527: Removing focus from payment note (1.26 KB, patch)
2019-01-17 08:04 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 20527: Corrected paid to amountwrittenoff (1.35 KB, patch)
2021-01-21 03:09 UTC, Eden
Details | Diff | Splinter Review
Bug 20527: Corrected paid to amountwrittenoff (1.40 KB, patch)
2021-01-21 12:19 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20527: Corrected paid to amountwrittenoff (1.46 KB, patch)
2021-01-21 16:10 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 20527: (QA follow-up) Fix type 'Wiriteoff' (1.14 KB, patch)
2021-01-21 16:11 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Katrin Fischer 2018-04-07 09:19:32 UTC
Can you please add a test plan to explain where the problem is and how it looks like? :)
Comment 2 Victor Grousset/tuxayo 2018-04-14 17:25:41 UTC
This is not a functional bug it's a mistake in the HTML where a label is not well linked to the input field.

Well actually there a small functional symptom.

1. Go to a patron
2. Go to Fines
3. Go to Pay fines
4. Write off an individual fine line
5. URL should be "staff://cgi-bin/koha/members/paycollect.pl?borrowernumber=9999999&writeoff_individual=999999"
6. Click on "Writeoff amount:"
7. The field is not focused.
     This is the bug.
     Linking a label and the field allow to focus the field when clicking the label.
     It can be also used by accessibility tools. E.g. for a screen reader a blind keyboard to tell the name of the field.
Comment 3 Ethan 2019-01-16 01:31:38 UTC Comment hidden (obsolete)
Comment 4 David Nind 2019-01-16 10:24:43 UTC
Hi Ethan.

This works for the Write off button.

I think this should also be done for the other buttons as well - Pay, Pay amount, Pay selected, and Write off selected.

I also noticed that for the row of buttons at the bottom (Pay, Pay amount, Pay selected, and Write off selected) when you press cancel on the individual screens that it takes you back to the Transactions tab, rather than Make a payment tab. This should probably be added as separate bug.

Note that bug 18661 will fix the tab titles when you are in any of the payment and write off screens so that they stay as 'Transactions' and 'Make a payment'  (currently they are labelled Account and Pay fines).

I would also add an updated test plan to the bug as well (the QA team will probably ask for it!), for example:

1. Search for a patron (Patrons > Search > Select a patron)
2. Add an invoice for a patron (Accounting > Create manual invoice)
3. Before applying the patch click on any of the payment or write off buttons* (under Accounting > Make a payment) - you should notice that the tab focus is on the search patrons field at the top of the page, rather than the payment amount field
4. After applying the patch check that the tab focus for all of the payment or write off buttons* is on the payment amount field (and it should be outlined in a darker green)

* Buttons for transaction line items: Pay, Write off; Buttons at the bottom: Pay, Pay amount, Pay selected, and Write off selected

Setting the focus on the payment amount field allows staff to more quickly update the amount.

It is also an accessibility issue, and fixing this makes navigating the pages easier for those using accessibility tools, such as screen readers.


David
Comment 5 Aleisha Amohia 2019-01-16 21:51:43 UTC
(In reply to David Nind from comment #4)
> 
> I also noticed that for the row of buttons at the bottom (Pay, Pay amount,
> Pay selected, and Write off selected) when you press cancel on the
> individual screens that it takes you back to the Transactions tab, rather
> than Make a payment tab. This should probably be added as separate bug.
> 
This can be fixed at Bug 22148.
Comment 6 Ethan 2019-01-16 22:16:52 UTC Comment hidden (obsolete)
Comment 7 Ethan 2019-01-17 01:09:22 UTC Comment hidden (obsolete)
Comment 8 ByWater Sandboxes 2019-01-17 08:04:30 UTC
Created attachment 84130 [details] [review]
Bug 20527: Significant inputs will be focused on in the "Accounting" section of a patron.

Test Plan:
1. From the homepage, select Patrons.
2. Search for any patron and select any patron.
3. You should be seeing the patrons' details. On the left, select "Accounting".
4. Click on "Pay".
5. The "Collect from patron" field should be focused. This means you
should not have to click on the input field to start typing, it should
already be selected. Confirm that this
works.
6. Click "Cancel" and you should be back to the "Make a payment" tab.
7. Click on "Write off".
8.The "Writeoff amount" field should be focused. Confirm that this
works.
9. Click "Cancel" and you should be back to the "Make a payment" tab.
10. Click on "Pay amount".
11. The "Collect from patron" field should be focused. Confirm that this
works.
12. Click "Pay fines" tab and you should be back to the "Make a payment" tab.
13. Click on "Pay selected".
14. Repeat steps 12 & 13.
15. Click  on "Write off selected".
16. The "Writeoff amount" field should be focused. Confirm that this
works.
17. Click "Pay fines" tab and you should be back to the "Make a payment" tab.
18. Click the "Create manual invoice".
19. The "Amount" field should be focused. Confirm that this works.
20. Click on "Create manual credit".
21. The "Amount" field should be focused. Confirm that this works.

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 ByWater Sandboxes 2019-01-17 08:04:32 UTC
Created attachment 84131 [details] [review]
Bug 20527: Removing focus from payment note

Did not mean to leave this in.

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 Katrin Fischer 2019-01-27 14:16:13 UTC
I am not sure if this patch does fix the problem initially reported. Adding Owen in hope he might be able to shine some light.
Comment 11 Owen Leonard 2019-01-27 17:37:55 UTC
The patch doesn't address what the bug reports. The patch adds auto-focus to some accounting form fields, but some of them don't make sense: Putting the focus on the payment field only makes sense if it's the first or only field in the form. Adding focus to the *last* input in the form seems counterproductive.

The auto-focus changes to paycollect.tt could be re-implemented on a new bug report, but it's not right for this bug.
Comment 12 Eden 2021-01-21 03:09:41 UTC
Created attachment 115494 [details] [review]
Bug 20527: Corrected paid to amountwrittenoff

Test Plan
1. Go to My account and go into accounting
2.Create manual invoice (If you already have invoices skip this step)
3.On the Make a payment tab click on Write off under actions of an
invoice
4. Click on Writeoff amount label and make sure that the amount written
is highlighted in green.
Comment 13 Owen Leonard 2021-01-21 12:19:23 UTC
Created attachment 115536 [details] [review]
Bug 20527: Corrected paid to amountwrittenoff

Test Plan
1. Go to My account and go into accounting
2.Create manual invoice (If you already have invoices skip this step)
3.On the Make a payment tab click on Write off under actions of an
invoice
4. Click on Writeoff amount label and make sure that the amount written
is highlighted in green.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 14 Nick Clemens (kidclamp) 2021-01-21 16:10:59 UTC
Created attachment 115568 [details] [review]
Bug 20527: Corrected paid to amountwrittenoff

Test Plan
1. Go to My account and go into accounting
2.Create manual invoice (If you already have invoices skip this step)
3.On the Make a payment tab click on Write off under actions of an
invoice
4. Click on Writeoff amount label and make sure that the amount written
is highlighted in green.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Nick Clemens (kidclamp) 2021-01-21 16:11:02 UTC
Created attachment 115570 [details] [review]
Bug 20527: (QA follow-up) Fix type 'Wiriteoff'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Jonathan Druart 2021-01-22 13:53:33 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 17 Fridolin Somers 2021-01-29 13:26:09 UTC
Pushed to 20.11.x for 20.11.03
Comment 18 Andrew Fuerste-Henry 2021-02-03 22:26:35 UTC
Pushed to 20.05.x for 20.05.09
Comment 19 Victor Grousset/tuxayo 2021-02-04 17:27:58 UTC
Backported: Pushed to 19.11.x branch for 19.11.15