View | Details | Raw Unified | Return to bug 17473
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_17473_add_permission.pl (+33 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "17473",
6
    description => "Add void_payment permission",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(
12
            q{
13
            INSERT IGNORE permissions (module_bit, code, description) VALUES
14
            (10, 'void_payment', 'Voiding payments')
15
        }
16
        );
17
18
        # permissions
19
        say $out "Added new permission 'void_payment'";
20
21
        $dbh->do(
22
            q{
23
            INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
24
            SELECT borrowernumber, 10, 'void_payment' FROM user_permissions WHERE code = 'remaining_permissions'
25
        }
26
        );
27
28
        # Other information
29
        say_success( $out, "Use green for success" );
30
        say_warning( $out, "Use yellow for warning/a call to action" );
31
        say_info( $out, "Use blue for further information" );
32
    },
33
};
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 68-73 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
68
   (10, 'refund', 'Perform account refund action'),
68
   (10, 'refund', 'Perform account refund action'),
69
   (10, 'discount', 'Perform account discount action'),
69
   (10, 'discount', 'Perform account discount action'),
70
   (10, 'writeoff', 'Write off fines and fees'),
70
   (10, 'writeoff', 'Write off fines and fees'),
71
   (10, 'void_payment', 'Voiding payments'),
71
   (10, 'manual_credit', 'Add manual credits to a patron account'),
72
   (10, 'manual_credit', 'Add manual credits to a patron account'),
72
   (10, 'manual_invoice', 'Add manual invoices to a patron account'),
73
   (10, 'manual_invoice', 'Add manual invoices to a patron account'),
73
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
74
   (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+3 lines)
Lines 299-304 Link Here
299
    [%- CASE 'writeoff' -%]
299
    [%- CASE 'writeoff' -%]
300
        <span class="sub_permission writeoff_subpermission"> Write off fines and fees </span>
300
        <span class="sub_permission writeoff_subpermission"> Write off fines and fees </span>
301
        <span class="permissioncode">([% name | html %])</span>
301
        <span class="permissioncode">([% name | html %])</span>
302
    [%- CASE 'void_payment' -%]
303
        <span class="sub_permission void_payment_subpermission"> Voiding payments </span>
304
        <span class="permissioncode">([% name | html %]</span>
302
    [%- CASE 'manual_invoice' -%]
305
    [%- CASE 'manual_invoice' -%]
303
        <span class="sub_permission manual_invoice_subpermission"> Add manual invoices to a patron account </span>
306
        <span class="sub_permission manual_invoice_subpermission"> Add manual invoices to a patron account </span>
304
        <span class="permissioncode">([% name | html %])</span>
307
        <span class="permissioncode">([% name | html %])</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-2 / +1 lines)
Lines 195-201 Link Here
195
                                        <button type="submit" class="btn btn-default btn-xs pay-action"> <i class="fa-solid fa-money-bill-1"></i> Pay </button>
195
                                        <button type="submit" class="btn btn-default btn-xs pay-action"> <i class="fa-solid fa-money-bill-1"></i> Pay </button>
196
                                    </form>
196
                                    </form>
197
                                [% END %]
197
                                [% END %]
198
                                [% IF account.is_credit && account.status != 'VOID' %]
198
                                [% IF account.is_credit && account.status != 'VOID' && CAN_user_updatecharges_void_payment %]
199
                                    <button
199
                                    <button
200
                                        type="button"
200
                                        type="button"
201
                                        data-bs-toggle="modal"
201
                                        data-bs-toggle="modal"
202
- 

Return to bug 17473