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

(-)a/circ/pendingreserves.pl (+9 lines)
Lines 32-41 use C4::Auth; Link Here
32
use C4::Dates qw/format_date format_date_in_iso/;
32
use C4::Dates qw/format_date format_date_in_iso/;
33
use C4::Debug;
33
use C4::Debug;
34
use Date::Calc qw/Today Add_Delta_YMD/;
34
use Date::Calc qw/Today Add_Delta_YMD/;
35
use C4::Branch; # GetBranches GetBranchesLoop
35
36
36
my $input = new CGI;
37
my $input = new CGI;
37
my $startdate=$input->param('from');
38
my $startdate=$input->param('from');
38
my $enddate=$input->param('to');
39
my $enddate=$input->param('to');
40
my $branch =$input->param('branch');
39
my $run_report=$input->param('run_report');
41
my $run_report=$input->param('run_report');
40
42
41
my $theme = $input->param('theme');    # only used if allowthemeoverride is set
43
my $theme = $input->param('theme');    # only used if allowthemeoverride is set
Lines 89-94 my @reservedata; Link Here
89
if ( $run_report ) {
91
if ( $run_report ) {
90
    my $dbh    = C4::Context->dbh;
92
    my $dbh    = C4::Context->dbh;
91
    my $sqldatewhere = "";
93
    my $sqldatewhere = "";
94
    my $sqlbranch = "";
92
    $debug and warn format_date_in_iso($startdate) . "\n" . format_date_in_iso($enddate);
95
    $debug and warn format_date_in_iso($startdate) . "\n" . format_date_in_iso($enddate);
93
    my @query_params = ();
96
    my @query_params = ();
94
    if ($startdate) {
97
    if ($startdate) {
Lines 99-104 if ( $run_report ) { Link Here
99
        $sqldatewhere .= " AND reservedate <= ?";
102
        $sqldatewhere .= " AND reservedate <= ?";
100
        push @query_params, format_date_in_iso($enddate);
103
        push @query_params, format_date_in_iso($enddate);
101
    }
104
    }
105
    if ($branch)  {
106
        $sqlbranch .= " AND items.homebranch= ?";
107
        push @query_params,($branch);
108
    }
102
109
103
    my $strsth =
110
    my $strsth =
104
    "SELECT min(reservedate) as l_reservedate,
111
    "SELECT min(reservedate) as l_reservedate,
Lines 138-143 if ( $run_report ) { Link Here
138
    WHERE
145
    WHERE
139
    reserves.found IS NULL
146
    reserves.found IS NULL
140
    $sqldatewhere
147
    $sqldatewhere
148
    $sqlbranch
141
    AND (reserves.itemnumber IS NULL OR reserves.itemnumber = items.itemnumber)
149
    AND (reserves.itemnumber IS NULL OR reserves.itemnumber = items.itemnumber)
142
    AND items.itemnumber NOT IN (SELECT itemnumber FROM branchtransfers where datearrived IS NULL)
150
    AND items.itemnumber NOT IN (SELECT itemnumber FROM branchtransfers where datearrived IS NULL)
143
    AND issues.itemnumber IS NULL
151
    AND issues.itemnumber IS NULL
Lines 196-201 $template->param( Link Here
196
    todaysdate      	=> format_date($todaysdate),
204
    todaysdate      	=> format_date($todaysdate),
197
    from                => $startdate,
205
    from                => $startdate,
198
    to              	=> $enddate,
206
    to              	=> $enddate,
207
    branchloop     => GetBranchesLoop(),
199
    run_report          => $run_report,
208
    run_report          => $run_report,
200
    reserveloop     	=> \@reservedata,
209
    reserveloop     	=> \@reservedata,
201
    "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
210
    "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-1 / +13 lines)
Lines 210-215 Calendar.setup( Link Here
210
                }
210
                }
211
        );
211
        );
212
</script></li>
212
</script></li>
213
<li><label for="branch">
214
    Branch:
215
</label>
216
<select name="branch" id="branch">
217
        [% FOREACH branchloo IN  branchloop %]
218
            [% IF ( branchloo.selected ) %]
219
            <option value="[% branchloo.value %]" selected=selected">[% branchloo.branchname %]</option>
220
            [% ELSE %]
221
            <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
222
            [% END %]
223
        [% END %]
224
        </select>
225
</li>
213
</ol>
226
</ol>
214
<p><i>(Inclusive, default is two days ago to today, set other date ranges as needed. )</i></p>
227
<p><i>(Inclusive, default is two days ago to today, set other date ranges as needed. )</i></p>
215
<fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
228
<fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
216
- 

Return to bug 6809