View | Details | Raw Unified | Return to bug 14920
Collapse All | Expand All

(-)a/circ/reserveratios.pl (-18 / +10 lines)
Lines 55-72 if ($booksellerid && $basketno) { Link Here
55
     $template->param( booksellerid => $booksellerid, basketno => $basketno );
55
     $template->param( booksellerid => $booksellerid, basketno => $basketno );
56
}
56
}
57
57
58
$startdate = eval { output_pref( { dt => dt_from_string( $startdate ), dateonly => 1, dateformat => 'iso' } ); };
58
$startdate = eval { dt_from_string( $startdate ) } if $startdate;
59
$enddate = eval { output_pref( { dt => dt_from_string( $enddate ), dateonly => 1, dateformat => 'iso' } ); };
59
$enddate = eval { dt_from_string( $enddate ) } if $enddate;
60
60
61
my $todaysdate_dt = dt_from_string;
61
my $todaysdate = dt_from_string;
62
my $todaysdate  = output_pref( { dt => $todaysdate_dt, dateonly => 1, dateformat => 'iso' } );
63
62
64
#    A default of the prior years's holds is a reasonable way to pull holds
63
#    A default of the prior years's holds is a reasonable way to pull holds
65
my $datelastyear_dt = $todaysdate_dt->subtract( days => 1);
66
my $datelastyear = output_pref( { dt => $datelastyear_dt, dateonly => 1, dateformat => 'iso' } );
67
68
$startdate = $datelastyear unless $startdate;
69
$enddate = $todaysdate unless $enddate;
64
$enddate = $todaysdate unless $enddate;
65
$startdate = $todaysdate->clone->subtract( years => 1 ) unless $startdate;
70
66
71
if (!defined($ratio)) {
67
if (!defined($ratio)) {
72
    $ratio = 3;
68
    $ratio = 3;
Lines 79-94 if ($ratio <= 0) { Link Here
79
75
80
my $dbh    = C4::Context->dbh;
76
my $dbh    = C4::Context->dbh;
81
my $sqldatewhere = "";
77
my $sqldatewhere = "";
82
$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 });
78
$debug and warn output_pref({ dt => $startdate, dateformat => 'iso', dateonly => 1 }) . "\n" . output_pref({ dt => $enddate, dateformat => 'iso', dateonly => 1 });
83
my @query_params = ();
79
my @query_params = ();
84
if ($startdate) {
80
85
    $sqldatewhere .= " AND reservedate >= ?";
81
$sqldatewhere .= " AND reservedate >= ?";
86
    push @query_params, $startdate ;
82
push @query_params, output_pref({ dt => $startdate, dateformat => 'iso' }) ;
87
}
83
$sqldatewhere .= " AND reservedate <= ?";
88
if ($enddate) {
84
push @query_params, output_pref({ dt => $enddate, dateformat => 'iso' });
89
    $sqldatewhere .= " AND reservedate <= ?";
90
    push @query_params, $enddate;
91
}
92
85
93
my $nfl_comparison = $include_ordered ? '<=' : '=';
86
my $nfl_comparison = $include_ordered ? '<=' : '=';
94
my $strsth =
87
my $strsth =
95
- 

Return to bug 14920