From 2a6cc4c911e013b3137ce9430a686275351a8fad Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 Nov 2019 15:04:56 +0000 Subject: [PATCH] Bug 23442: Add refund permission Add a new subpermission called 'refund' to the 'updatecharges' permission group which will allow/prevent refund actions to be performed by staff. Signed-off-by: Kyle M Hall Signed-off-by: Josef Moravec Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug_23442.perl | 7 +++++++ installer/data/mysql/userpermissions.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_23442.perl b/installer/data/mysql/atomicupdate/bug_23442.perl index 5cbdeb1d90..bcd98fe8b4 100644 --- a/installer/data/mysql/atomicupdate/bug_23442.perl +++ b/installer/data/mysql/atomicupdate/bug_23442.perl @@ -13,7 +13,14 @@ if ( CheckVersion($DBversion) ) { INSERT IGNORE INTO account_offset_types ( type ) VALUES ('REFUND'); }); + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (10, 'refund', 'Perform account refund action') + }); + SetVersion($DBversion); print "Upgrade to $DBversion done (Bug 23442 - Add REFUND to account_credit_types)\n"; print "Upgrade to $DBversion done (Bug 23442 - Add REFUND to account_offset_types)\n"; + print "Upgrade to $DBversion done (Bug 23442 - Add accounts refund permission)\n"; } diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql index 3fdbbf8e8e..ab46391bdc 100644 --- a/installer/data/mysql/userpermissions.sql +++ b/installer/data/mysql/userpermissions.sql @@ -44,6 +44,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_items_restricted', 'Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)'), ( 9, 'delete_all_items', 'Delete all items at once'), (10, 'payout', 'Perform account payout action'), + (10, 'refund', 'Perform account refund action'), (10, 'writeoff', 'Write off fines and fees'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'currencies_manage', 'Manage currencies and exchange rates'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 352286e032..ff42562f64 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -309,6 +309,11 @@ Payout credits to patrons ([% name | html %]) + [%- CASE 'refund' -%] + + Refund payments to patrons + + ([% name | html %]) [%- CASE 'writeoff' -%] Write off fines and fees -- 2.39.5