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

(-)a/Koha/Item.pm (-6 / +5 lines)
Lines 564-570 we still expect the item to end up at a final location eventually. Link Here
564
sub get_transfer {
564
sub get_transfer {
565
    my ($self) = @_;
565
    my ($self) = @_;
566
566
567
    return $self->get_transfers->search( {}, { rows => 1 } )->next;
567
    my $transfer = $self->_result->branchtransfer;
568
569
    return Koha::Item::Transfers->_new_from_dbic($transfer)->next;
568
}
570
}
569
571
570
=head3 get_transfers
572
=head3 get_transfers
Lines 587-598 we still expect the item to end up at a final location eventually. Link Here
587
sub get_transfers {
589
sub get_transfers {
588
    my ($self) = @_;
590
    my ($self) = @_;
589
591
590
    my $transfer_rs = $self->_result->branchtransfers;
592
    my $transfer_rs = $self->_result->branchtransfer;
591
593
592
    return Koha::Item::Transfers
594
    return Koha::Item::Transfers->_new_from_dbic($transfer_rs);
593
                ->_new_from_dbic($transfer_rs)
594
                ->filter_by_current
595
                ->search( {}, { order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ], } );
596
}
595
}
597
596
598
=head3 last_returned_by
597
=head3 last_returned_by
(-)a/Koha/Schema/Result/Item.pm (-1 / +10 lines)
Lines 968-973 __PACKAGE__->many_to_many( Link Here
968
  "ordernumber",
968
  "ordernumber",
969
);
969
);
970
970
971
__PACKAGE__->has_many(
972
  "branchtransfer",
973
  "Koha::Schema::Result::Branchtransfer",
974
  { 'foreign.itemnumber' => 'self.itemnumber' },
975
  {
976
      where => { datearrived => undef, datecancelled => undef },
977
      order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ]
978
  }
979
);
980
971
use C4::Context;
981
use C4::Context;
972
sub effective_itemtype {
982
sub effective_itemtype {
973
    my ( $self ) = @_;
983
    my ( $self ) = @_;
974
- 

Return to bug 33493