Bug 30335 - Add ability to hide/disable manual invoices and manual credits in patron accounts
Summary: Add ability to hide/disable manual invoices and manual credits in patron acco...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-22 13:56 UTC by Andrew Fuerste-Henry
Modified: 2023-12-28 20:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/661
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 (7.54 KB, patch)
2022-03-22 17:48 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages (7.58 KB, patch)
2022-06-30 19:46 UTC, Rachael
Details | Diff | Splinter Review
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages (7.65 KB, patch)
2022-07-15 16:11 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30335: (follow-up) Add permissions for manual accounts options (3.38 KB, patch)
2022-07-15 16:11 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30335: (follow-up) Bind new permissions to pages and tabs (6.84 KB, patch)
2022-07-15 16:11 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30335: (follow-up) Ensure existing users remain permitted (1.91 KB, patch)
2022-07-15 16:22 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30335: Add classes to invoice/credit tabs on patron accouting pages (7.71 KB, patch)
2022-07-18 20:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30335: (follow-up) Add permissions for manual accounts options (3.43 KB, patch)
2022-07-18 20:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30335: (follow-up) Bind new permissions to pages and tabs (6.89 KB, patch)
2022-07-18 20:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30335: (follow-up) Ensure existing users remain permitted (1.97 KB, patch)
2022-07-18 20:41 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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