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'); |