From 2e5b5b7dd1b2c0592ebaeb4d28c2b22ccce68940 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 23 Jan 2020 15:52:25 +0000 Subject: [PATCH] Bug 24082: Add `anonymous_refund` permission to `cash_management` This patch adds the new `anonymous_refund` permission to the `cash_management` flag and binds it to the visability of the register details page. https://bugs.koha-community.org/show_bug.cgi?id=23355 --- installer/data/mysql/atomicupdate/bug_24082.perl | 12 ++++++++++++ installer/data/mysql/userpermissions.sql | 1 + .../intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ .../intranet-tmpl/prog/en/includes/pos-menu.inc | 2 +- .../intranet-tmpl/prog/en/modules/pos/register.tt | 2 ++ pos/register.pl | 2 +- 6 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24082.perl diff --git a/installer/data/mysql/atomicupdate/bug_24082.perl b/installer/data/mysql/atomicupdate/bug_24082.perl new file mode 100644 index 0000000000..be66c07777 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24082.perl @@ -0,0 +1,12 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (25, 'anonymous_refund', 'Perform refund actions from cash registers') + }); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 23442 - Add a refund option to the point of sale system)\n"; +} diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql index ebf869641f..2b41fa24b1 100644 --- a/installer/data/mysql/userpermissions.sql +++ b/installer/data/mysql/userpermissions.sql @@ -121,6 +121,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'), (24, 'manage_rotas', 'Create, edit and delete rotas'), (24, 'manage_rota_items', 'Add and remove items from rotas'), + (25, 'anonymous_refund', 'Perform refund actions from cash registers'), (25, 'cashup', 'Perform cash register cashup action'), (25, 'takepayment', 'Access the point of sale page and take payments') ; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 25943655fd..942fd5b6f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -701,5 +701,10 @@ Perform cash register cashup action ([% name | html %]) + [%- CASE 'anonymous_refund' -%] + + Perform anonymous refund actions + + ([% name | html %]) [%- END -%] [%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc index c9579b5492..c2ad730e5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc @@ -1,6 +1,6 @@