|
Lines 186-212
if ( C4::Context->preference('IndependentBranches') ){
Link Here
|
| 186 |
} |
186 |
} |
| 187 |
|
187 |
|
| 188 |
# get all distinct unfulfilled reserves |
188 |
# get all distinct unfulfilled reserves |
| 189 |
my @biblionumbers = Koha::Holds->search( |
189 |
my $holds = Koha::Holds->search( |
| 190 |
{ %where }, |
190 |
{ %where }, |
| 191 |
{ join => 'itembib', alias => 'reserve', distinct => 1, columns => qw[me.biblionumber] } |
191 |
{ join => 'itembib', alias => 'reserve', distinct => 1, columns => qw[me.biblionumber] } |
| 192 |
)->get_column('biblionumber'); |
|
|
| 193 |
|
| 194 |
my @branchtransfers = map { $_->itemnumber } Koha::Item::Transfers->search({ datearrived => undef }, { columns => [ 'itemnumber' ], collapse => 1 }); |
| 195 |
my @waiting_holds = map { $_->itemnumber } Koha::Holds->search({'found' => 'W'}, { columns => [ 'itemnumber' ], collapse => 1 }); |
| 196 |
|
| 197 |
my @all_items = Koha::Items->search( |
| 198 |
{ |
| 199 |
biblionumber => { in => \@biblionumbers }, |
| 200 |
itemlost => 0, |
| 201 |
withdrawn => 0, |
| 202 |
notforloan => 0, |
| 203 |
onloan => undef, |
| 204 |
itemnumber => { -not_in => [ @branchtransfers, @waiting_holds ] }, |
| 205 |
} |
| 206 |
); |
192 |
); |
|
|
193 |
my @biblionumbers = $holds->get_column('biblionumber'); |
| 207 |
|
194 |
|
| 208 |
my $all_items; |
195 |
my $all_items; |
| 209 |
foreach my $item ( @all_items ) { |
196 |
foreach my $item ( $holds->get_items_that_can_fill ) { |
| 210 |
push @{$all_items->{$item->biblionumber}}, $item; |
197 |
push @{$all_items->{$item->biblionumber}}, $item; |
| 211 |
} |
198 |
} |
| 212 |
|
199 |
|
| 213 |
- |
|
|