Bugzilla – Attachment 169386 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.10 KB, created by
Roman Dolny
on 2024-07-22 20:56:01 UTC
(
hide
)
Description:
Bug 17473: Add void payment permission
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-22 20:56:01 UTC
Size:
5.10 KB
patch
obsolete
>From 9e1b965b3223a9f0a21f5a338e94a04ac778b297 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 > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > .../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 83808b97a2..b81ac72a21 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 f5396703e7..eaeca721da 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 5ed00b06f3..670399079c 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.39.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