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

(-)a/circ/reserveratios.pl (-18 / +5 lines)
Lines 98-110 my $include_aqorders_qty_join = Link Here
98
98
99
my $nfl_comparison = $include_ordered   ? '<=' : '=';
99
my $nfl_comparison = $include_ordered   ? '<=' : '=';
100
my $sus_comparison = $include_suspended ? '<=' : '<';
100
my $sus_comparison = $include_suspended ? '<=' : '<';
101
my $strsth         = "SELECT reservedate,
101
my $strsth         = "SELECT reserves.biblionumber,
102
        reserves.borrowernumber as borrowernumber,
103
        reserves.biblionumber,
104
        reserves.branchcode as branch,
105
        items.holdingbranch,
106
        items.itemcallnumber,
107
        items.itemnumber,
108
        GROUP_CONCAT(DISTINCT items.itemcallnumber 
102
        GROUP_CONCAT(DISTINCT items.itemcallnumber 
109
            ORDER BY items.itemnumber SEPARATOR '|') as listcall,
103
            ORDER BY items.itemnumber SEPARATOR '|') as listcall,
110
        GROUP_CONCAT(DISTINCT homebranch
104
        GROUP_CONCAT(DISTINCT homebranch
Lines 117-124 my $strsth = "SELECT reservedate, Link Here
117
            ORDER BY items.itemnumber SEPARATOR '|') as l_itype,
111
            ORDER BY items.itemnumber SEPARATOR '|') as l_itype,
118
        GROUP_CONCAT(DISTINCT items.ccode
112
        GROUP_CONCAT(DISTINCT items.ccode
119
            ORDER BY items.ccode SEPARATOR '|') as l_ccode,
113
            ORDER BY items.ccode SEPARATOR '|') as l_ccode,
120
121
        reserves.found,
122
        biblio.title,
114
        biblio.title,
123
        biblio.subtitle,
115
        biblio.subtitle,
124
        biblio.medium,
116
        biblio.medium,
Lines 142-148 if ( C4::Context->preference('IndependentBranches') ) { Link Here
142
    push @query_params, C4::Context->userenv->{'branch'};
134
    push @query_params, C4::Context->userenv->{'branch'};
143
}
135
}
144
136
145
$strsth .= " GROUP BY reserves.biblionumber ORDER BY reservecount DESC";
137
$strsth .= " GROUP BY reserves.biblionumber, biblio.title, biblio.subtitle,
138
    biblio.medium, biblio.part_number, biblio.part_name, biblio.author
139
    ORDER BY reservecount DESC
140
";
146
141
147
$template->param( sql => $strsth );
142
$template->param( sql => $strsth );
148
my $sth = $dbh->prepare($strsth);
143
my $sth = $dbh->prepare($strsth);
Lines 156-177 while ( my $data = $sth->fetchrow_hashref ) { Link Here
156
    push(
151
    push(
157
        @reservedata,
152
        @reservedata,
158
        {
153
        {
159
            reservedate        => $data->{reservedate},
160
            priority           => $data->{priority},
161
            name               => $data->{borrower},
162
            title              => $data->{title},
154
            title              => $data->{title},
163
            subtitle           => $data->{subtitle},
155
            subtitle           => $data->{subtitle},
164
            medium             => $data->{medium},
156
            medium             => $data->{medium},
165
            part_number        => $data->{part_number},
157
            part_number        => $data->{part_number},
166
            part_name          => $data->{part_name},
158
            part_name          => $data->{part_name},
167
            author             => $data->{author},
159
            author             => $data->{author},
168
            itemnum            => $data->{itemnumber},
169
            biblionumber       => $data->{biblionumber},
160
            biblionumber       => $data->{biblionumber},
170
            holdingbranch      => $data->{holdingbranch},
171
            homebranch_list    => [ split( '\|', $data->{homebranch_list} ) ],
161
            homebranch_list    => [ split( '\|', $data->{homebranch_list} ) ],
172
            holdingbranch_list => [ split( '\|', $data->{holdingbranch_list} ) ],
162
            holdingbranch_list => [ split( '\|', $data->{holdingbranch_list} ) ],
173
            branch             => $data->{branch},
174
            itemcallnumber     => $data->{itemcallnumber},
175
            location           => [ split( '\|', $data->{l_location} ) ],
163
            location           => [ split( '\|', $data->{l_location} ) ],
176
            itype              => [ split( '\|', $data->{l_itype} ) ],
164
            itype              => [ split( '\|', $data->{l_itype} ) ],
177
            ccode              => [ split( '\|', $data->{l_ccode} ) ],
165
            ccode              => [ split( '\|', $data->{l_ccode} ) ],
178
- 

Return to bug 21941