Bugzilla – Attachment 169310 Details for
Bug 17473
Permission for voiding payments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17473: Add void payment permission
Bug-17473-Add-void-payment-permission.patch (text/plain), 5.05 KB, created by
Eric Garcia
on 2024-07-22 15:27:54 UTC
(
hide
)
Description:
Bug 17473: Add void payment permission
Filename:
MIME Type:
Creator:
Eric Garcia
Created:
2024-07-22 15:27:54 UTC
Size:
5.05 KB
patch
obsolete
>From 97c63728d5811b203643bd3f53cba83645c2498a Mon Sep 17 00:00:00 2001 >From: Eric Garcia <cubingguy714@gmail.com> >Date: Wed, 17 Jul 2024 20:33:43 +0000 >Subject: [PATCH] Bug 17473: Add void payment permission > >To test: >1. Apply patch, updatedatabase, restart_all >2. Search for staff patron >3. More -> Set permissions >4. Check > - Staff access, allows viewing of catalogue in staff interface > - Add, modify and view patron information > - Manage patrons fines and fee >5. Notice under Manage patrons fines and fee there is a new permission "Voiding Payments" >6. Sign into staff interface as your selected staff patron >7. Search for a non-staff patron -> Accounting >8. Click 'Create manual invoice', add an amount and click 'Save and pay' -> 'Confirm' >9. Go to transactions and notice the option to Void payment appears >10. Go back to your staff patron's permission and unselect 'Voiding Payments' >11. Go to your non-staff patron and notice the option to void payments is gone >--- > .../atomicupdate/bug_17473_add_permission.pl | 21 +++++++++++++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../prog/en/includes/permissions.inc | 5 +++++ > .../prog/en/modules/members/boraccount.tt | 10 +++++---- > 4 files changed, 33 insertions(+), 4 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_17473_add_permission.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_17473_add_permission.pl b/installer/data/mysql/atomicupdate/bug_17473_add_permission.pl >new file mode 100755 >index 0000000000..2b2993b3d0 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_17473_add_permission.pl >@@ -0,0 +1,21 @@ >+use Modern::Perl >+ >+return { >+ bug_number => "17473", >+ description => "Add void_payment permission", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ $dbh->do(q{ >+ INSERT IGNORE permissions (module_bit, code, description) VALUES >+ (10, 'void_payment', 'Voiding Payments') >+ }); >+ >+ say $out "Added new permission 'void_payment'"; >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code) >+ SELECT borrowernumber, 10, 'void_payment' FROM user_permissions WHERE code = 'remaining_permissions' >+ }); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 4b5c8ebe2c..b996f07e88 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -68,6 +68,7 @@ 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, 'void_payment', 'Voiding Payments'), > (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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index b8f2c2b040..c16609d925 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -427,6 +427,11 @@ > Write off fines and fees > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'void_payment' -%] >+ <span class="sub_permission void_payment_subpermission"> >+ Voiding Payments >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'manual_invoice' -%] > <span class="sub_permission manual_invoice_subpermission"> > Add manual invoices to a patron account >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index a051fc2732..4d4527c9b5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -181,10 +181,12 @@ > <input type="hidden" name="op" value="cud-void" /> > <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"> > <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]"> >- <button type="submit" class="btn btn-default btn-xs void-action"> >- <i class="fa fa-ban"></i> >- Void payment >- </button> >+ [% IF CAN_user_updatecharges_void_payment %] >+ <button type="submit" class="btn btn-default btn-xs void-action"> >+ <i class="fa fa-ban"></i> >+ Void payment >+ </button> >+ [% END %] > </form> > [% END %] > [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17473
:
169109
|
169310
|
169384
|
169386
|
169387
|
174943
|
174944