Bugzilla – Attachment 182922 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), 4.46 KB, created by
Eric Garcia
on 2025-06-03 15:05:43 UTC
(
hide
)
Description:
Bug 17473: Add void payment permission
Filename:
MIME Type:
Creator:
Eric Garcia
Created:
2025-06-03 15:05:43 UTC
Size:
4.46 KB
patch
obsolete
>From 684598813cf26004910452bf868257514c8f309c Mon Sep 17 00:00:00 2001 >From: Eric Garcia <cubingguy714@gmail.com> >Date: Tue, 3 Jun 2025 15:01:02 +0000 >Subject: [PATCH] Bug 17473: Add void payment permission > >--- > .../atomicupdate/bug_17473_add_permission.pl | 33 +++++++++++++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../prog/en/includes/permissions.inc | 3 ++ > .../prog/en/modules/members/boraccount.tt | 2 +- > 4 files changed, 38 insertions(+), 1 deletion(-) > 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..b00a266d1e >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_17473_add_permission.pl >@@ -0,0 +1,33 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+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') >+ } >+ ); >+ >+ # permissions >+ 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' >+ } >+ ); >+ >+ # Other information >+ say_success( $out, "Use green for success" ); >+ say_warning( $out, "Use yellow for warning/a call to action" ); >+ say_info( $out, "Use blue for further information" ); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index d5121c91fd..4e3c5fc71d 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 a0e17a2d41..92b5f5e599 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -299,6 +299,9 @@ > [%- CASE 'writeoff' -%] > <span class="sub_permission writeoff_subpermission"> 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 </span> > <span class="permissioncode">([% name | html %])</span> >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 d4a337786e..f10d08f420 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -195,7 +195,7 @@ > <button type="submit" class="btn btn-default btn-xs pay-action"> <i class="fa-solid fa-money-bill-1"></i> Pay </button> > </form> > [% END %] >- [% IF account.is_credit && account.status != 'VOID' %] >+ [% IF account.is_credit && account.status != 'VOID' && CAN_user_updatecharges_void_payment %] > <button > type="button" > data-bs-toggle="modal" >-- >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
| 182922