|
Lines 55-64
use CGI qw ( -utf8 );
Link Here
|
| 55 |
use C4::Auth; # get_template_and_user |
55 |
use C4::Auth; # get_template_and_user |
| 56 |
use C4::Output; |
56 |
use C4::Output; |
| 57 |
use C4::Acquisition; |
57 |
use C4::Acquisition; |
| 58 |
use C4::Dates; |
|
|
| 59 |
use C4::Debug; |
58 |
use C4::Debug; |
| 60 |
use C4::Branch; |
59 |
use C4::Branch; |
| 61 |
use C4::Koha; |
60 |
use C4::Koha; |
|
|
61 |
use Koha::DateUtils; |
| 62 |
|
62 |
|
| 63 |
my $input = new CGI; |
63 |
my $input = new CGI; |
| 64 |
my $title = $input->param( 'title'); |
64 |
my $title = $input->param( 'title'); |
|
Lines 67-77
my $isbn = $input->param('isbn');
Link Here
|
| 67 |
my $name = $input->param( 'name' ); |
67 |
my $name = $input->param( 'name' ); |
| 68 |
my $ean = $input->param('ean'); |
68 |
my $ean = $input->param('ean'); |
| 69 |
my $basket = $input->param( 'basket' ); |
69 |
my $basket = $input->param( 'basket' ); |
| 70 |
my $basketgroupname = $input->param('basketgroupname'); |
70 |
my $basketgroupname = $input->param('basketgroupname'); |
| 71 |
my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); |
71 |
my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' ); |
| 72 |
my $do_search = $input->param('do_search') || 0; |
72 |
my $do_search = $input->param('do_search') || 0; |
| 73 |
my $from_placed_on = C4::Dates->new($input->param('from')); |
73 |
my $from_placed_on = eval { dt_from_string( $input->param('from') ) } || dt_from_string; |
| 74 |
my $to_placed_on = C4::Dates->new($input->param('to')); |
74 |
my $to_placed_on = eval { dt_from_string( $input->param('to') ) } || dt_from_string; |
| 75 |
my $budget = $input->param( 'budget' ); |
75 |
my $budget = $input->param( 'budget' ); |
| 76 |
my $orderstatus = $input->param( 'orderstatus' ); |
76 |
my $orderstatus = $input->param( 'orderstatus' ); |
| 77 |
my $ordernumber = $input->param( 'ordernumber' ); |
77 |
my $ordernumber = $input->param( 'ordernumber' ); |
|
Lines 79-87
my $search_children_too = $input->param( 'search_children_too' );
Link Here
|
| 79 |
my @created_by = $input->param('created_by'); |
79 |
my @created_by = $input->param('created_by'); |
| 80 |
|
80 |
|
| 81 |
if ( not $input->param('from') ) { |
81 |
if ( not $input->param('from') ) { |
| 82 |
# FIXME Dirty but we can't sent a Date::Calc to C4::Dates ? |
82 |
# Subtract one year if param was not defined |
| 83 |
# We would use a function like Add_Delta_YM(-1, 0, 0); |
83 |
$from_placed_on->subtract(years => 1); |
| 84 |
$$from_placed_on{dmy_arrayref}[5] -= 1; |
|
|
| 85 |
} |
84 |
} |
| 86 |
|
85 |
|
| 87 |
my $dbh = C4::Context->dbh; |
86 |
my $dbh = C4::Context->dbh; |
|
Lines 98-107
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 98 |
|
97 |
|
| 99 |
my ( $from_iso, $to_iso, $d ); |
98 |
my ( $from_iso, $to_iso, $d ); |
| 100 |
if ( $d = $input->param('from') ) { |
99 |
if ( $d = $input->param('from') ) { |
| 101 |
$from_iso = C4::Dates->new($d)->output('iso'); |
100 |
$from_iso = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ); |
| 102 |
} |
101 |
} |
| 103 |
if ( $d = $input->param('iso') ) { |
102 |
if ( $d = $input->param('to') ) { |
| 104 |
$to_iso = C4::Dates->new($d)->output('iso'); |
103 |
$to_iso = output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ); |
| 105 |
} |
104 |
} |
| 106 |
|
105 |
|
| 107 |
my $order_loop; |
106 |
my $order_loop; |
|
Lines 126-133
if ($do_search) {
Link Here
|
| 126 |
); |
125 |
); |
| 127 |
} |
126 |
} |
| 128 |
|
127 |
|
| 129 |
my $from_date = $from_placed_on ? $from_placed_on->output('syspref') : undef; |
128 |
my $from_date = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ); |
| 130 |
my $to_date = $to_placed_on ? $to_placed_on->output('syspref') : undef; |
129 |
my $to_date = output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ); |
| 131 |
|
130 |
|
| 132 |
my $budgetperiods = C4::Budgets::GetBudgetPeriods; |
131 |
my $budgetperiods = C4::Budgets::GetBudgetPeriods; |
| 133 |
my $bp_loop = $budgetperiods; |
132 |
my $bp_loop = $budgetperiods; |