Lines 35-40
use C4::Output;
Link Here
|
35 |
use C4::Acquisition; |
35 |
use C4::Acquisition; |
36 |
use C4::Bookseller qw/GetBookSellerFromId/; |
36 |
use C4::Bookseller qw/GetBookSellerFromId/; |
37 |
use C4::Budgets; |
37 |
use C4::Budgets; |
|
|
38 |
use Koha::Misc::Files; |
38 |
|
39 |
|
39 |
my $input = new CGI; |
40 |
my $input = new CGI; |
40 |
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( |
41 |
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( |
Lines 51-56
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
Link Here
|
51 |
my $invoiceid = $input->param('invoiceid'); |
52 |
my $invoiceid = $input->param('invoiceid'); |
52 |
my $op = $input->param('op'); |
53 |
my $op = $input->param('op'); |
53 |
|
54 |
|
|
|
55 |
my $invoice_files; |
56 |
if ( C4::Context->preference('AcqEnableFiles') ) { |
57 |
$invoice_files = Koha::Misc::Files->new( |
58 |
tabletag => 'aqinvoices', recordid => $invoiceid ); |
59 |
} |
60 |
|
54 |
if ( $op && $op eq 'close' ) { |
61 |
if ( $op && $op eq 'close' ) { |
55 |
CloseInvoice($invoiceid); |
62 |
CloseInvoice($invoiceid); |
56 |
my $referer = $input->param('referer'); |
63 |
my $referer = $input->param('referer'); |
Lines 86-96
elsif ( $op && $op eq 'mod' ) {
Link Here
|
86 |
} elsif ($input->param('merge')) { |
93 |
} elsif ($input->param('merge')) { |
87 |
my @sources = $input->param('merge'); |
94 |
my @sources = $input->param('merge'); |
88 |
MergeInvoices($invoiceid, \@sources); |
95 |
MergeInvoices($invoiceid, \@sources); |
|
|
96 |
defined($invoice_files) && $invoice_files->MergeFileRecIds(@sources); |
89 |
} |
97 |
} |
90 |
$template->param( modified => 1 ); |
98 |
$template->param( modified => 1 ); |
91 |
} |
99 |
} |
92 |
elsif ( $op && $op eq 'delete' ) { |
100 |
elsif ( $op && $op eq 'delete' ) { |
93 |
DelInvoice($invoiceid); |
101 |
DelInvoice($invoiceid); |
|
|
102 |
defined($invoice_files) && $invoice_files->DelAllFiles(); |
94 |
my $referer = $input->param('referer') || 'invoices.pl'; |
103 |
my $referer = $input->param('referer') || 'invoices.pl'; |
95 |
if ($referer) { |
104 |
if ($referer) { |
96 |
print $input->redirect($referer); |
105 |
print $input->redirect($referer); |
Lines 166-171
$template->param(
Link Here
|
166 |
budgets_loop => \@budgets_loop, |
175 |
budgets_loop => \@budgets_loop, |
167 |
); |
176 |
); |
168 |
|
177 |
|
|
|
178 |
defined( $invoice_files ) && $template->param( files => $invoice_files->GetFilesInfo() ); |
179 |
|
169 |
# FIXME |
180 |
# FIXME |
170 |
# Fonction dupplicated from basket.pl |
181 |
# Fonction dupplicated from basket.pl |
171 |
# Code must to be exported. Where ?? |
182 |
# Code must to be exported. Where ?? |