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

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

Return to bug 33493