Lines 33-41
use C4::Context;
Link Here
|
33 |
use C4::Output; |
33 |
use C4::Output; |
34 |
use CGI qw ( -utf8 ); |
34 |
use CGI qw ( -utf8 ); |
35 |
use C4::Auth; |
35 |
use C4::Auth; |
36 |
use C4::Dates qw/format_date format_date_in_iso/; |
|
|
37 |
use C4::Debug; |
36 |
use C4::Debug; |
38 |
use Date::Calc qw/Today Add_Delta_YMD/; |
37 |
use Date::Calc qw/Today Add_Delta_YMD/; |
|
|
38 |
use Koha::DateUtils; |
39 |
|
39 |
|
40 |
my $input = new CGI; |
40 |
my $input = new CGI; |
41 |
my $startdate=$input->param('from'); |
41 |
my $startdate=$input->param('from'); |
Lines 79-106
if (!defined($startdate) or $startdate eq "") {
Link Here
|
79 |
# changed from delivered range of 10 years-yesterday to 2 days ago-today |
79 |
# changed from delivered range of 10 years-yesterday to 2 days ago-today |
80 |
# Find two days ago for the default shelf pull start date, unless HoldsToPullStartDate sys pref is set. |
80 |
# Find two days ago for the default shelf pull start date, unless HoldsToPullStartDate sys pref is set. |
81 |
my $pastdate= sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -C4::Context->preference('HoldsToPullStartDate')||TWO_DAYS_AGO )); |
81 |
my $pastdate= sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -C4::Context->preference('HoldsToPullStartDate')||TWO_DAYS_AGO )); |
82 |
$startdate = format_date($pastdate); |
82 |
$startdate = output_pref({ dt => dt_from_string( $pastdate ), dateonly => 1 }); |
83 |
} |
83 |
} |
84 |
|
84 |
|
85 |
if (!defined($enddate) or $enddate eq "") { |
85 |
if (!defined($enddate) or $enddate eq "") { |
86 |
#similarly: calculate end date with ConfirmFutureHolds (days) |
86 |
#similarly: calculate end date with ConfirmFutureHolds (days) |
87 |
my $d=sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, C4::Context->preference('ConfirmFutureHolds')||0 )); |
87 |
my $d=sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, C4::Context->preference('ConfirmFutureHolds')||0 )); |
88 |
$enddate = format_date($d); |
88 |
$enddate = output_pref({ dt => dt_from_string( $d ), dateonly => 1 }); |
89 |
} |
89 |
} |
90 |
|
90 |
|
91 |
my @reservedata; |
91 |
my @reservedata; |
92 |
if ( $run_report ) { |
92 |
if ( $run_report ) { |
93 |
my $dbh = C4::Context->dbh; |
93 |
my $dbh = C4::Context->dbh; |
94 |
my $sqldatewhere = ""; |
94 |
my $sqldatewhere = ""; |
95 |
$debug and warn format_date_in_iso($startdate) . "\n" . format_date_in_iso($enddate); |
95 |
$debug and warn output_pref({ dt => dt_from_string( $startdate ), dateformat => 'iso', dateonly => 1 }) . "\n" . output_pref({ dt => dt_from_string( $enddate ), dateformat => 'iso', dateonly => 1 }); |
96 |
my @query_params = (); |
96 |
my @query_params = (); |
97 |
if ($startdate) { |
97 |
if ($startdate) { |
98 |
$sqldatewhere .= " AND reservedate >= ?"; |
98 |
$sqldatewhere .= " AND reservedate >= ?"; |
99 |
push @query_params, format_date_in_iso($startdate); |
99 |
push @query_params, output_pref({ dt => dt_from_string( $startdate ), dateformat => 'iso', dateonly => 1 }); |
100 |
} |
100 |
} |
101 |
if ($enddate) { |
101 |
if ($enddate) { |
102 |
$sqldatewhere .= " AND reservedate <= ?"; |
102 |
$sqldatewhere .= " AND reservedate <= ?"; |
103 |
push @query_params, format_date_in_iso($enddate); |
103 |
push @query_params, output_pref({ dt => dt_from_string( $enddate ), dateformat => 'iso', dateonly => 1 }); |
104 |
} |
104 |
} |
105 |
|
105 |
|
106 |
my $strsth = |
106 |
my $strsth = |
107 |
- |
|
|