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

(-)a/acqui/invoice.pl (+4 lines)
Lines 110-115 elsif ( $op && $op eq 'mod' ) { Link Here
110
    $template->param( modified => 1 );
110
    $template->param( modified => 1 );
111
}
111
}
112
elsif ( $op && $op eq 'delete' ) {
112
elsif ( $op && $op eq 'delete' ) {
113
114
    output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
115
        unless $logged_in_patron->has_permission( { acquisition => 'delete_invoices' } );
116
113
    DelInvoice($invoiceid);
117
    DelInvoice($invoiceid);
114
    defined($invoice_files) && $invoice_files->DelAllFiles();
118
    defined($invoice_files) && $invoice_files->DelAllFiles();
115
    my $referer = $input->param('referer') || 'invoices.pl';
119
    my $referer = $input->param('referer') || 'invoices.pl';
(-)a/installer/data/mysql/atomicupdate/bug_24157.perl (-1 / +6 lines)
Lines 11-16 if( CheckVersion( $DBversion ) ) { Link Here
11
    |);
11
    |);
12
12
13
13
14
    $dbh->do(q|
15
        INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
16
        (11, 'delete_invoices', 'Delete invoices')
17
    |);
18
14
    SetVersion( $DBversion );
19
    SetVersion( $DBversion );
15
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices)\n";
20
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices delete_invoices)\n";
16
}
21
}
(-)a/installer/data/mysql/userpermissions.sql (+1 lines)
Lines 64-69 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
64
   (11, 'edi_manage', 'Manage EDIFACT transmissions'),
64
   (11, 'edi_manage', 'Manage EDIFACT transmissions'),
65
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
65
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
66
   (11, 'edit_invoices', 'Edit invoices'),
66
   (11, 'edit_invoices', 'Edit invoices'),
67
   (11, 'delete_invoices', 'Delete invoices'),
67
   (12, 'suggestions_manage', 'Manage purchase suggestions'),
68
   (12, 'suggestions_manage', 'Manage purchase suggestions'),
68
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
69
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
69
   (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
70
   (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 677-682 Link Here
677
            Edit invoices
677
            Edit invoices
678
        </span>
678
        </span>
679
        <span class="permissioncode">([% name | html %])</span>
679
        <span class="permissioncode">([% name | html %])</span>
680
    [%- CASE 'delete_invoices' -%]
681
        <span class="sub_permission delete_invoices_subpermission">
682
            Delete invoices
683
        </span>
684
        <span class="permissioncode">([% name | html %])</span>
680
  [%# self_check %]
685
  [%# self_check %]
681
    [%- CASE 'self_checkin_module' -%]
686
    [%- CASE 'self_checkin_module' -%]
682
        <span class="sub_permission self_checkin_module_subpermission">
687
        <span class="sub_permission self_checkin_module_subpermission">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-2 / +1 lines)
Lines 90-96 Link Here
90
                                [% END %]
90
                                [% END %]
91
                            [% END %]
91
                            [% END %]
92
                            [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
92
                            [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
93
                                [% IF CAN_user_acquisition_edit_invoices %]
93
                                [% IF CAN_user_acquisition_delete_invoices %]
94
                                    <li><a href="invoice.pl?op=delete&amp;invoiceid=[% invoice.invoiceid | uri %]&amp;referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]" class="delete_invoice"><i class="fa fa-trash"></i> Delete</a></li>
94
                                    <li><a href="invoice.pl?op=delete&amp;invoiceid=[% invoice.invoiceid | uri %]&amp;referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]" class="delete_invoice"><i class="fa fa-trash"></i> Delete</a></li>
95
                                [% END %]
95
                                [% END %]
96
                            [% END %]
96
                            [% END %]
97
- 

Return to bug 24157