Lines 59-85
use C4::Koha;
Link Here
|
59 |
use Koha::DateUtils; |
59 |
use Koha::DateUtils; |
60 |
|
60 |
|
61 |
my $input = new CGI; |
61 |
my $input = new CGI; |
62 |
my $title = $input->param( 'title'); |
|
|
63 |
my $author = $input->param('author'); |
64 |
my $isbn = $input->param('isbn'); |
65 |
my $name = $input->param( 'name' ); |
66 |
my $ean = $input->param('ean'); |
67 |
my $basket = $input->param( 'basket' ); |
68 |
my $basketgroupname = $input->param('basketgroupname'); |
69 |
my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); |
70 |
my $do_search = $input->param('do_search') || 0; |
62 |
my $do_search = $input->param('do_search') || 0; |
71 |
my $budget = $input->param( 'budget' ); |
|
|
72 |
my $orderstatus = $input->param( 'orderstatus' ); |
73 |
my $ordernumber = $input->param( 'ordernumber' ); |
74 |
my $search_children_too = $input->param( 'search_children_too' ); |
75 |
my @created_by = $input->multi_param('created_by'); |
76 |
|
77 |
my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string; |
78 |
my $to_placed_on = eval { dt_from_string( scalar $input->param('to') ) } || dt_from_string; |
79 |
unless ( $input->param('from') ) { |
80 |
# Fill the form with year-1 |
81 |
$from_placed_on->subtract( years => 1 ); |
82 |
} |
83 |
|
63 |
|
84 |
my $dbh = C4::Context->dbh; |
64 |
my $dbh = C4::Context->dbh; |
85 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
65 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
Lines 93-118
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
93 |
} |
73 |
} |
94 |
); |
74 |
); |
95 |
|
75 |
|
|
|
76 |
my $filters = { |
77 |
basket => scalar $input->param('basket'), |
78 |
title => scalar $input->param('title'), |
79 |
author => scalar $input->param('author'), |
80 |
isbn => scalar $input->param('isbn'), |
81 |
name => scalar $input->param('name'), |
82 |
ean => scalar $input->param('ean'), |
83 |
basketgroupname => scalar $input->param('basketgroupname'), |
84 |
budget => scalar $input->param('budget'), |
85 |
booksellerinvoicenumber => scalar $input->param('booksellerinvoicenumber'), |
86 |
budget => scalar $input->param('budget'), |
87 |
orderstatus => scalar $input->param('orderstatus'), |
88 |
ordernumber => scalar $input->param('ordernumber'), |
89 |
search_children_too => scalar $input->param('search_children_too'), |
90 |
created_by => scalar $input->multi_param('created_by'), |
91 |
}; |
92 |
my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string; |
93 |
my $to_placed_on = eval { dt_from_string( scalar $input->param('to') ) } || dt_from_string; |
94 |
unless ( $input->param('from') ) { |
95 |
# Fill the form with year-1 |
96 |
$from_placed_on->subtract( years => 1 ); |
97 |
} |
98 |
$filters->{from_placed_on} = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ), |
99 |
$filters->{to_placed_on} = output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ), |
100 |
|
96 |
my $order_loop; |
101 |
my $order_loop; |
97 |
# If we're supplied any value then we do a search. Otherwise we don't. |
102 |
# If we're supplied any value then we do a search. Otherwise we don't. |
98 |
if ($do_search) { |
103 |
if ($do_search) { |
99 |
$order_loop = GetHistory( |
104 |
$order_loop = GetHistory(%$filters); |
100 |
title => $title, |
|
|
101 |
author => $author, |
102 |
isbn => $isbn, |
103 |
ean => $ean, |
104 |
name => $name, |
105 |
from_placed_on => output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ), |
106 |
to_placed_on => output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ), |
107 |
basket => $basket, |
108 |
booksellerinvoicenumber => $booksellerinvoicenumber, |
109 |
basketgroupname => $basketgroupname, |
110 |
budget => $budget, |
111 |
orderstatus => $orderstatus, |
112 |
ordernumber => $ordernumber, |
113 |
search_children_too => $search_children_too, |
114 |
created_by => \@created_by, |
115 |
); |
116 |
} |
105 |
} |
117 |
|
106 |
|
118 |
my $budgetperiods = C4::Budgets::GetBudgetPeriods; |
107 |
my $budgetperiods = C4::Budgets::GetBudgetPeriods; |
Lines 126-151
for my $bp ( @{$budgetperiods} ) {
Link Here
|
126 |
} |
115 |
} |
127 |
|
116 |
|
128 |
$template->param( |
117 |
$template->param( |
129 |
order_loop => $order_loop, |
118 |
order_loop => $order_loop, |
130 |
numresults => $order_loop ? scalar(@$order_loop) : undef, |
119 |
filters => $filters, |
131 |
title => $title, |
120 |
bp_loop => $bp_loop, |
132 |
author => $author, |
121 |
search_done => $do_search, |
133 |
isbn => $isbn, |
|
|
134 |
ean => $ean, |
135 |
name => $name, |
136 |
basket => $basket, |
137 |
booksellerinvoicenumber => $booksellerinvoicenumber, |
138 |
basketgroupname => $basketgroupname, |
139 |
ordernumber => $ordernumber, |
140 |
search_children_too => $search_children_too, |
141 |
from_placed_on => $from_placed_on, |
142 |
to_placed_on => $to_placed_on, |
143 |
orderstatus => $orderstatus, |
144 |
budget_id => $budget, |
145 |
bp_loop => $bp_loop, |
146 |
search_done => $do_search, |
147 |
debug => $debug || $input->param('debug') || 0, |
148 |
uc(C4::Context->preference("marcflavour")) => 1 |
149 |
); |
122 |
); |
150 |
|
123 |
|
151 |
output_html_with_http_headers $input, $cookie, $template->output; |
124 |
output_html_with_http_headers $input, $cookie, $template->output; |