Bug 30876: (follow-up) Use the $biblio object even further

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomas Cohen Arazi 2022-06-01 10:12:05 -03:00
parent b60d59eb89
commit 12464241eb
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 6 additions and 3 deletions

View File

@ -57,8 +57,11 @@ if ( $op eq 'list' ) {
$seen_bib{$recall->biblio_id}++;
# get recall data about this biblio
my $biblio = Koha::Biblios->find($recall->biblio_id);
my @this_bib_recalls = Koha::Recalls->search({ biblio_id => $recall->biblio_id, status => [ 'requested','overdue','in_transit' ] }, { order_by => { -asc => 'created_date' } })->as_list;
my $biblio = $recall->biblio;
my @this_bib_recalls = $biblio->recalls->search(
{ status => [ 'requested', 'overdue', 'in_transit' ] },
{ order_by => { -asc => 'created_date' } }
)->as_list;
my $recalls_count = scalar @this_bib_recalls;
my @unique_patrons = do { my %seen; grep { !$seen{$_->patron_id}++ } @this_bib_recalls };
my $patrons_count = scalar @unique_patrons;
@ -98,7 +101,7 @@ if ( $op eq 'list' ) {
my @unique_libraries = do { my %seen; grep { !$seen{$_}++ } @libraries };
push( @pull_list, {
biblio => $recall->biblio,
biblio => $biblio,
items_count => $items_count,
recalls_count => $recalls_count,
patrons_count => $patrons_count,