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

(-)a/acqui/invoice.pl (-1 / +18 lines)
Lines 58-64 my $op = $input->param('op'); Link Here
58
58
59
output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
59
output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
60
  if $op
60
  if $op
61
  && not $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } );
61
  && ! $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } )
62
  && ! $logged_in_patron->has_permission( { acquisition => 'reopen_closed_invoices' } )
63
  && ! $logged_in_patron->has_permission( { acquisition => 'merge_invoices' } )
64
  && ! $logged_in_patron->has_permission( { acquisition => 'delete_invoices' } );
62
65
63
my $invoice_files;
66
my $invoice_files;
64
if ( C4::Context->preference('AcqEnableFiles') ) {
67
if ( C4::Context->preference('AcqEnableFiles') ) {
Lines 67-72 if ( C4::Context->preference('AcqEnableFiles') ) { Link Here
67
}
70
}
68
71
69
if ( $op && $op eq 'close' ) {
72
if ( $op && $op eq 'close' ) {
73
    output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
74
        unless $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } );
70
    CloseInvoice($invoiceid);
75
    CloseInvoice($invoiceid);
71
    my $referer = $input->param('referer');
76
    my $referer = $input->param('referer');
72
    if ($referer) {
77
    if ($referer) {
Lines 101-106 elsif ( $op && $op eq 'mod' ) { Link Here
101
        ReopenInvoice($invoiceid)
106
        ReopenInvoice($invoiceid)
102
            if $logged_in_patron->has_permission( { acquisition => 'reopen_closed_invoices' } );
107
            if $logged_in_patron->has_permission( { acquisition => 'reopen_closed_invoices' } );
103
    } elsif ($input->param('close')) {
108
    } elsif ($input->param('close')) {
109
110
        output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
111
            unless $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } );
112
104
        CloseInvoice($invoiceid);
113
        CloseInvoice($invoiceid);
105
    } elsif ($input->param('merge')) {
114
    } elsif ($input->param('merge')) {
106
115
Lines 127-137 elsif ( $op && $op eq 'delete' ) { Link Here
127
    }
136
    }
128
}
137
}
129
elsif ( $op && $op eq 'del_adj' ) {
138
elsif ( $op && $op eq 'del_adj' ) {
139
140
    output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
141
        unless $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } );
142
130
    my $adjustment_id  = $input->param('adjustment_id');
143
    my $adjustment_id  = $input->param('adjustment_id');
131
    my $del_adj = Koha::Acquisition::Invoice::Adjustments->find( $adjustment_id );
144
    my $del_adj = Koha::Acquisition::Invoice::Adjustments->find( $adjustment_id );
132
    $del_adj->delete() if ($del_adj);
145
    $del_adj->delete() if ($del_adj);
133
}
146
}
134
elsif ( $op && $op eq 'mod_adj' ) {
147
elsif ( $op && $op eq 'mod_adj' ) {
148
149
    output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
150
        unless $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } );
151
135
    my @adjustment_id  = $input->multi_param('adjustment_id');
152
    my @adjustment_id  = $input->multi_param('adjustment_id');
136
    my @adjustment     = $input->multi_param('adjustment');
153
    my @adjustment     = $input->multi_param('adjustment');
137
    my @reason         = $input->multi_param('reason');
154
    my @reason         = $input->multi_param('reason');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (+2 lines)
Lines 24-29 Link Here
24
        <div class="col-sm-10 col-sm-push-2">
24
        <div class="col-sm-10 col-sm-push-2">
25
            <main>
25
            <main>
26
26
27
                [% INCLUDE 'blocking_errors.inc' %]
28
27
      [% IF ( modified ) %]
29
      [% IF ( modified ) %]
28
        <div class="dialog message">
30
        <div class="dialog message">
29
          <p>Invoice has been modified</p>
31
          <p>Invoice has been modified</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-1 / +2 lines)
Lines 20-25 Link Here
20
        <div class="col-sm-10 col-sm-push-2">
20
        <div class="col-sm-10 col-sm-push-2">
21
            <main>
21
            <main>
22
22
23
                [% INCLUDE 'blocking_errors.inc' %]
24
23
      <h1>Invoices</h1>
25
      <h1>Invoices</h1>
24
      [% IF ( do_search ) %]
26
      [% IF ( do_search ) %]
25
        [% IF invoices %]
27
        [% IF invoices %]
26
- 

Return to bug 24157