From ccc5c30c8ae4a5973a790a79b904d131d287cad2 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 15 Jul 2022 16:54:03 +0100 Subject: [PATCH] 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 Signed-off-by: Katrin Fischer --- installer/data/mysql/atomicupdate/bug_30335.pl | 15 +++++++++++++++ .../data/mysql/mandatory/userpermissions.sql | 2 ++ .../prog/en/includes/permissions.inc | 10 ++++++++++ 3 files changed, 27 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_30335.pl diff --git a/installer/data/mysql/atomicupdate/bug_30335.pl b/installer/data/mysql/atomicupdate/bug_30335.pl new file mode 100644 index 0000000000..3afb3b2148 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30335.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "30335", + description => "Add manual_invoice and manual_credit permissions", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{ + INSERT IGNORE permissions (module_bit, code, description) VALUES + (10, 'manual_credit', 'Add manual credits to a patron account'), + (10, 'manual_invoice', 'Add manual invoices to a patron account') + }); + }, +}; diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index 3a3f7f9b4e..4ff9b86ab6 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -55,6 +55,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES (10, 'refund', 'Perform account refund action'), (10, 'discount', 'Perform account discount action'), (10, 'writeoff', 'Write off fines and fees'), + (10, 'manual_credit', 'Add manual credits to a patron account'), + (10, 'manual_invoice', 'Add manual invoices to a patron account'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'currencies_manage', 'Manage currencies and exchange rates'), (11, 'vendors_manage', 'Manage vendors'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 3e70c155bc..b27c36ddaf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -368,6 +368,16 @@ Write off fines and fees ([% name | html %]) + [%- CASE 'manual_invoice' -%] + + Add manual invoices to a patron account + + ([% name | html %]) + [%- CASE 'manual_credit' -%] + + Add manual credits to a patron account + + ([% name | html %]) [%- CASE 'suggestions_manage' -%] Manage purchase suggestions -- 2.30.2