|
Lines 36-41
use C4::Output;
Link Here
|
| 36 |
use C4::Acquisition qw/GetInvoices/; |
36 |
use C4::Acquisition qw/GetInvoices/; |
| 37 |
use C4::Branch qw/GetBranches/; |
37 |
use C4::Branch qw/GetBranches/; |
| 38 |
use C4::Budgets; |
38 |
use C4::Budgets; |
|
|
39 |
use Koha::DateUtils; |
| 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 64-74
my $branch = $input->param('branch');
Link Here
|
| 64 |
my $op = $input->param('op'); |
65 |
my $op = $input->param('op'); |
| 65 |
|
66 |
|
| 66 |
my $invoices = []; |
67 |
my $invoices = []; |
|
|
68 |
|
| 69 |
my $shipmentdatefrom_iso = ''; |
| 70 |
my $shipmentdateto_iso = ''; |
| 71 |
my $billingdatefrom_iso = ''; |
| 72 |
my $billingdateto_iso = ''; |
| 73 |
|
| 74 |
|
| 67 |
if ( $op and $op eq 'do_search' ) { |
75 |
if ( $op and $op eq 'do_search' ) { |
| 68 |
my $shipmentdatefrom_iso = C4::Dates->new($shipmentdatefrom)->output('iso'); |
76 |
|
| 69 |
my $shipmentdateto_iso = C4::Dates->new($shipmentdateto)->output('iso'); |
77 |
if ( $shipmentdatefrom ) { |
| 70 |
my $billingdatefrom_iso = C4::Dates->new($billingdatefrom)->output('iso'); |
78 |
$shipmentdatefrom_iso = eval { dt_from_string( $shipmentdatefrom ) }; |
| 71 |
my $billingdateto_iso = C4::Dates->new($billingdateto)->output('iso'); |
79 |
$shipmentdatefrom_iso = output_pref( { dt => $shipmentdatefrom_iso, dateformat => 'iso', dateonly => 1 } ) if ( $shipmentdatefrom_iso ); |
|
|
80 |
} |
| 81 |
|
| 82 |
if ( $shipmentdateto ) { |
| 83 |
$shipmentdateto_iso = eval { dt_from_string( $shipmentdateto) }; |
| 84 |
$shipmentdateto_iso = output_pref( { dt => $shipmentdateto_iso, dateformat => 'iso', dateonly => 1 } ) if ( $shipmentdateto_iso ); |
| 85 |
} |
| 86 |
|
| 87 |
if ( $billingdatefrom ) { |
| 88 |
$billingdatefrom_iso = eval { dt_from_string( $billingdatefrom) }; |
| 89 |
$billingdatefrom_iso = output_pref( { dt => $billingdatefrom_iso, dateformat => 'iso', dateonly => 1 } ) if ( $billingdatefrom_iso ); |
| 90 |
} |
| 91 |
|
| 92 |
if ( $billingdateto ) { |
| 93 |
$billingdateto_iso = eval { dt_from_string( $billingdateto) }; |
| 94 |
$billingdateto_iso = output_pref( { dt => $billingdateto_iso, dateformat => 'iso', dateonly => 1 } ) if ( $billingdateto_iso ); |
| 95 |
} |
| 96 |
|
| 72 |
@{$invoices} = GetInvoices( |
97 |
@{$invoices} = GetInvoices( |
| 73 |
invoicenumber => $invoicenumber, |
98 |
invoicenumber => $invoicenumber, |
| 74 |
supplierid => $supplierid, |
99 |
supplierid => $supplierid, |
|
Lines 130-151
foreach my $budget (@$budgets) {
Link Here
|
| 130 |
$template->{'VARS'}->{'budgets_loop'} = \@budgets_loop; |
155 |
$template->{'VARS'}->{'budgets_loop'} = \@budgets_loop; |
| 131 |
|
156 |
|
| 132 |
$template->param( |
157 |
$template->param( |
| 133 |
do_search => ( $op and $op eq 'do_search' ) ? 1 : 0, |
158 |
do_search => ( $op and $op eq 'do_search' ) ? 1 : 0, |
| 134 |
invoices => $invoices, |
159 |
invoices => $invoices, |
| 135 |
invoicenumber => $invoicenumber, |
160 |
invoicenumber => $invoicenumber, |
| 136 |
booksellerid => $supplierid, |
161 |
booksellerid => $supplierid, |
| 137 |
suppliername => $suppliername, |
162 |
suppliername => $suppliername, |
| 138 |
billingdatefrom => $billingdatefrom, |
163 |
shipmentdatefrom => $shipmentdatefrom_iso, |
| 139 |
billingdateto => $billingdateto, |
164 |
shipmentdateto => $shipmentdateto_iso, |
| 140 |
isbneanissn => $isbneanissn, |
165 |
billingdatefrom => $billingdatefrom_iso, |
| 141 |
title => $title, |
166 |
billingdateto => $billingdateto_iso, |
| 142 |
author => $author, |
167 |
isbneanissn => $isbneanissn, |
| 143 |
publisher => $publisher, |
168 |
title => $title, |
| 144 |
publicationyear => $publicationyear, |
169 |
author => $author, |
| 145 |
branch => $branch, |
170 |
publisher => $publisher, |
| 146 |
branchname => $branchname, |
171 |
publicationyear => $publicationyear, |
| 147 |
suppliers_loop => $suppliers_loop, |
172 |
branch => $branch, |
| 148 |
branches_loop => $branches_loop, |
173 |
branchname => $branchname, |
|
|
174 |
suppliers_loop => $suppliers_loop, |
| 175 |
branches_loop => $branches_loop, |
| 149 |
); |
176 |
); |
| 150 |
|
177 |
|
| 151 |
output_html_with_http_headers $input, $cookie, $template->output; |
178 |
output_html_with_http_headers $input, $cookie, $template->output; |