Lines 36-41
use C4::Acquisition qw( GetInvoices GetInvoice );
Link Here
|
36 |
use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget ); |
36 |
use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget ); |
37 |
use Koha::DateUtils qw( dt_from_string ); |
37 |
use Koha::DateUtils qw( dt_from_string ); |
38 |
use Koha::Acquisition::Booksellers; |
38 |
use Koha::Acquisition::Booksellers; |
|
|
39 |
use Koha::AdditionalFields; |
39 |
|
40 |
|
40 |
my $input = CGI->new; |
41 |
my $input = CGI->new; |
41 |
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( |
42 |
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( |
Lines 62-86
my $branch = $input->param('branch');
Link Here
|
62 |
my $message_id = $input->param('message_id'); |
63 |
my $message_id = $input->param('message_id'); |
63 |
my $op = $input->param('op'); |
64 |
my $op = $input->param('op'); |
64 |
|
65 |
|
|
|
66 |
my @additional_fields = Koha::AdditionalFields->search( |
67 |
{ tablename => 'aqinvoices', |
68 |
searchable => 1 |
69 |
} |
70 |
)->as_list; |
71 |
my @additional_field_filters; |
72 |
for my $field (@additional_fields) { |
73 |
my $value = $input->param( 'additional_field_' . $field->id ); |
74 |
if ( defined $value and $value ne '' ) { |
75 |
push @additional_field_filters, |
76 |
{ id => $field->id, |
77 |
value => $value, |
78 |
}; |
79 |
} |
80 |
} |
81 |
|
65 |
my $invoices = []; |
82 |
my $invoices = []; |
66 |
if ( $op and $op eq 'do_search' ) { |
83 |
if ( $op and $op eq 'do_search' ) { |
67 |
@{$invoices} = GetInvoices( |
84 |
@{$invoices} = GetInvoices( |
68 |
invoicenumber => $invoicenumber, |
85 |
invoicenumber => $invoicenumber, |
69 |
supplierid => $supplierid, |
86 |
supplierid => $supplierid, |
70 |
shipmentdatefrom => $shipmentdatefrom, |
87 |
shipmentdatefrom => $shipmentdatefrom, |
71 |
shipmentdateto => $shipmentdateto, |
88 |
shipmentdateto => $shipmentdateto, |
72 |
billingdatefrom => $billingdatefrom, |
89 |
billingdatefrom => $billingdatefrom, |
73 |
billingdateto => $billingdateto, |
90 |
billingdateto => $billingdateto, |
74 |
isbneanissn => $isbneanissn, |
91 |
isbneanissn => $isbneanissn, |
75 |
title => $title, |
92 |
title => $title, |
76 |
author => $author, |
93 |
author => $author, |
77 |
publisher => $publisher, |
94 |
publisher => $publisher, |
78 |
publicationyear => $publicationyear, |
95 |
publicationyear => $publicationyear, |
79 |
branchcode => $branch, |
96 |
branchcode => $branch, |
80 |
message_id => $message_id, |
97 |
message_id => $message_id, |
|
|
98 |
additional_fields => \@additional_field_filters, |
81 |
); |
99 |
); |
82 |
} |
100 |
} |
83 |
|
101 |
|
|
|
102 |
$template->param( |
103 |
additional_field_filters => { map { $_->{id} => $_->{value} } @additional_field_filters }, |
104 |
additional_fields_for_invoice => \@additional_fields, |
105 |
); |
106 |
|
84 |
# Build suppliers list |
107 |
# Build suppliers list |
85 |
my @suppliers = Koha::Acquisition::Booksellers->search( undef, { order_by => { -asc => 'name' } } )->as_list; |
108 |
my @suppliers = Koha::Acquisition::Booksellers->search( undef, { order_by => { -asc => 'name' } } )->as_list; |
86 |
my $suppliers_loop = []; |
109 |
my $suppliers_loop = []; |