Bug 30335

Summary: Add ability to hide/disable manual invoices and manual credits in patron accounts
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: Fines and feesAssignee: Lucas Gass <lucas>
Status: RESOLVED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: david, lucas, martin.renvoize
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24077
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Attachments: Bug 30335: Add classes to invoice/credit tabs on patron accouting pages
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages
Bug 30335: (follow-up) Add permissions for manual accounts options
Bug 30335: (follow-up) Bind new permissions to pages and tabs
Bug 30335: (follow-up) Ensure existing users remain permitted
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages
Bug 30335: (follow-up) Add permissions for manual accounts options
Bug 30335: (follow-up) Bind new permissions to pages and tabs
Bug 30335: (follow-up) Ensure existing users remain permitted

Description Andrew Fuerste-Henry 2022-03-22 13:56:04 UTC
Some libraries prefer not to allow staff to create manual invoices and/or manual credits on patron accounts. These tabs in the patron account are not easily hidden via CSS as they don't have distinct classes.

We should give these tabs distinct classes to aid in manipulation via CSS.

Alternatively/additionally, we could add system preferences to actually disable these features entirely.
Comment 1 Lucas Gass 2022-03-22 17:48:38 UTC
Created attachment 132031 [details] [review]
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages

To test:
1. Apply patch and go to the patron accounting page.
2. Notice the class names for each list element on the page.
3. You can use the following CSS to try hiding each of the tabs:

.transactions { display: none; }
.makepayment { display: none; }
.manualinvoice { display: none; }
.manualcredit { display: none; }
Comment 2 Rachael 2022-06-30 19:46:28 UTC
Created attachment 136796 [details] [review]
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages

To test:
1. Apply patch and go to the patron accounting page.
2. Notice the class names for each list element on the page.
3. You can use the following CSS to try hiding each of the tabs:

.transactions { display: none; }
.makepayment { display: none; }
.manualinvoice { display: none; }
.manualcredit { display: none; }

Signed-off-by: rachael <rachael@inlibro.com>
Comment 3 Martin Renvoize 2022-07-15 16:11:40 UTC
Created attachment 137777 [details] [review]
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages

To test:
1. Apply patch and go to the patron accounting page.
2. Notice the class names for each list element on the page.
3. You can use the following CSS to try hiding each of the tabs:

.transactions { display: none; }
.makepayment { display: none; }
.manualinvoice { display: none; }
.manualcredit { display: none; }

Signed-off-by: Rachael Laritz <rachael@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2022-07-15 16:11:43 UTC
Created attachment 137778 [details] [review]
Bug 30335: (follow-up) Add permissions for manual accounts options

This patch adds two new sub-permissions, `manual_credit` and
`manual_invoice` to allow/prevent staff the ability to add manual
invoices and credits to a patrons account.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2022-07-15 16:11:46 UTC
Created attachment 137779 [details] [review]
Bug 30335: (follow-up) Bind new permissions to pages and tabs

This patch binds the new permissions added in the previous patch to the
tab display on the borrower account page.

Test plan
1) Apply the previous patch and run the database update
2) Configure a user without the new permissions
3) Confirm the 'Create manual invoice' and 'Create manual credit' tabs
   no longer appear under the 'Accounting' area when logged in as the
   above user.
4) Confirm that you cannot manually navigate to /members/mancredit.pl or
   /members/maninvoice.pl when logged in as the above user.
5) Confirm that users with the above permissions are still able to see
   the tabs and take actions on them.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2022-07-15 16:12:34 UTC
Couldn't help myself.. there was a suggestion here to use system preferences.. I felt user permissions made even more sense..

Follow-ups added to enhance this enhancement.
Comment 7 Martin Renvoize 2022-07-15 16:13:44 UTC
Setting back to NSO to get an independent eye on my follow-ups.
Comment 8 Martin Renvoize 2022-07-15 16:22:51 UTC
Created attachment 137784 [details] [review]
Bug 30335: (follow-up) Ensure existing users remain permitted

This patch updates the database update to ensure users with the
'remaining_permissions' subpermission of 'updatecharges' continue to be
able to manually invoice and manually credit borrower accounts after the
patch is applied.
Comment 9 Katrin Fischer 2022-07-18 20:41:11 UTC
Created attachment 137845 [details] [review]
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages

To test:
1. Apply patch and go to the patron accounting page.
2. Notice the class names for each list element on the page.
3. You can use the following CSS to try hiding each of the tabs:

.transactions { display: none; }
.makepayment { display: none; }
.manualinvoice { display: none; }
.manualcredit { display: none; }

Signed-off-by: Rachael Laritz <rachael@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2022-07-18 20:41:15 UTC
Created attachment 137846 [details] [review]
Bug 30335: (follow-up) Add permissions for manual accounts options

This patch adds two new sub-permissions, `manual_credit` and
`manual_invoice` to allow/prevent staff the ability to add manual
invoices and credits to a patrons account.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2022-07-18 20:41:20 UTC
Created attachment 137847 [details] [review]
Bug 30335: (follow-up) Bind new permissions to pages and tabs

This patch binds the new permissions added in the previous patch to the
tab display on the borrower account page.

Test plan
1) Apply the previous patch and run the database update
2) Configure a user without the new permissions
3) Confirm the 'Create manual invoice' and 'Create manual credit' tabs
   no longer appear under the 'Accounting' area when logged in as the
   above user.
4) Confirm that you cannot manually navigate to /members/mancredit.pl or
   /members/maninvoice.pl when logged in as the above user.
5) Confirm that users with the above permissions are still able to see
   the tabs and take actions on them.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2022-07-18 20:41:24 UTC
Created attachment 137848 [details] [review]
Bug 30335: (follow-up) Ensure existing users remain permitted

This patch updates the database update to ensure users with the
'remaining_permissions' subpermission of 'updatecharges' continue to be
able to manually invoice and manually credit borrower accounts after the
patch is applied.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Martin Renvoize 2022-08-23 10:54:36 UTC
Awesome, thanks Katrin.

Setting to PQA now :)
Comment 14 Tomás Cohen Arazi 2022-08-31 11:52:00 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 15 Lucas Gass 2022-10-31 17:56:24 UTC
Enhancement will not be included in the 22.05.x series