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

(-)a/installer/data/mysql/atomicupdate/bug_17473_add_permission.pl (+21 lines)
Line 0 Link Here
1
use Modern::Perl
2
3
return {
4
    bug_number  => "17473",
5
    description => "Add void_payment permission",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
            INSERT IGNORE permissions (module_bit, code, description) VALUES
11
            (10, 'void_payment', 'Voiding Payments')
12
        });
13
14
        say $out "Added new permission 'void_payment'";
15
16
        $dbh->do(q{
17
            INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
18
            SELECT borrowernumber, 10, 'void_payment' FROM user_permissions WHERE code = 'remaining_permissions'
19
        });
20
    },
21
};
(-)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 (+5 lines)
Lines 427-432 Link Here
427
            Write off fines and fees
427
            Write off fines and fees
428
        </span>
428
        </span>
429
        <span class="permissioncode">([% name | html %])</span>
429
        <span class="permissioncode">([% name | html %])</span>
430
    [%- CASE 'void_payment' -%]
431
        <span class="sub_permission void_payment_subpermission">
432
            Voiding Payments
433
        </span>
434
        <span class="permissioncode">([% name | html %])</span>
430
    [%- CASE 'manual_invoice' -%]
435
    [%- CASE 'manual_invoice' -%]
431
        <span class="sub_permission manual_invoice_subpermission">
436
        <span class="sub_permission manual_invoice_subpermission">
432
            Add manual invoices to a patron account
437
            Add manual invoices to a patron account
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-5 / +6 lines)
Lines 181-190 Link Here
181
            <input type="hidden" name="op" value="cud-void" />
181
            <input type="hidden" name="op" value="cud-void" />
182
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
182
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]">
183
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
183
            <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]">
184
            <button type="submit" class="btn btn-default btn-xs void-action">
184
            [% IF CAN_user_updatecharges_void_payment %]
185
                <i class="fa fa-ban"></i>
185
                <button type="submit" class="btn btn-default btn-xs void-action">
186
                Void payment
186
                    <i class="fa fa-ban"></i>
187
            </button>
187
                    Void payment
188
                </button>
189
            [% END %]
188
          </form>
190
          </form>
189
        [% END %]
191
        [% END %]
190
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
192
        [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
191
- 

Return to bug 17473