return Koha::Items->_new_from_dbic( $items_rs ) unless $params->{host_items};
my @itemnumbers = $items_rs->get_column('itemnumber')->all;
my $host_itemnumbers = $self->_host_itemnumbers();
my $params = { -or => [biblionumber => $self->id] };
push @itemnumbers, @{ $host_itemnumbers };
push @{$params->{'-or'}}, itemnumber => { -in => $host_itemnumbers } if $host_itemnumbers;
return Koha::Items->search({ "me.itemnumber" => { -in => \@itemnumbers } });
return Koha::Items->search($params);
}
=head3 host_items
sub get_transfer {
my ($self) = @_;
return $self->get_transfers->search( {}, { rows => 1 } )->next;
my $transfer = $self->_result->branchtransfer;
return Koha::Item::Transfers->_new_from_dbic($transfer)->next;
=head3 get_transfers
"ordernumber",
);
__PACKAGE__->has_many(
"branchtransfer",
"Koha::Schema::Result::Branchtransfer",
sub {
my $args = shift;
return {
"$args->{foreign_alias}.itemnumber" => { -ident => "$args->{self_alias}.itemnumber" },
"$args->{foreign_alias}.datearrived" => undef,
"$args->{foreign_alias}.datecancelled" => undef,
};
},
{ cascade_copy => 0, cascade_delete => 0 },
use C4::Context;
sub effective_itemtype {
my ( $self ) = @_;
my $params;
my $patron = Koha::Patrons->find( $borrowernumber );
$params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems;
my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfers'] } );
my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfer'] } );
# flag indicating existence of at least one item linked via a host record
my $hostrecords = $biblio->host_items->count;
-