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

(-)a/C4/Circulation.pm (-3 / +3 lines)
Lines 2376-2383 sub AddReturn { Link Here
2376
            else {
2376
            else {
2377
                $messages->{'TransferTrigger'} = $transfer->reason;
2377
                $messages->{'TransferTrigger'} = $transfer->reason;
2378
                if ( $transfer->frombranch eq $branch ) {
2378
                if ( $transfer->frombranch eq $branch ) {
2379
                    $transfer->transit;
2379
                    $messages->{'NeedsTransfer'}   = $transfer->tobranch;
2380
                    $messages->{'WasTransfered'}   = $transfer->tobranch;
2381
                }
2380
                }
2382
                else {
2381
                else {
2383
                    $messages->{'WrongTransfer'}     = $transfer->tobranch;
2382
                    $messages->{'WrongTransfer'}     = $transfer->tobranch;
Lines 2522-2528 sub AddReturn { Link Here
2522
        and not $messages->{'WrongTransfer'}
2521
        and not $messages->{'WrongTransfer'}
2523
        and not $messages->{'WasTransfered'}
2522
        and not $messages->{'WasTransfered'}
2524
        and not $messages->{TransferredRecall}
2523
        and not $messages->{TransferredRecall}
2525
        and not $messages->{RecallNeedsTransfer} )
2524
        and not $messages->{RecallNeedsTransfer}
2525
        and not $messages->{NeedsTransfer} )
2526
    {
2526
    {
2527
        my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode';
2527
        my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode';
2528
        if  (C4::Context->preference("AutomaticItemReturn"    ) or
2528
        if  (C4::Context->preference("AutomaticItemReturn"    ) or
(-)a/Koha/Item.pm (-1 lines)
Lines 776-782 we still expect the item to end up at a final location eventually. Link Here
776
776
777
sub get_transfer {
777
sub get_transfer {
778
    my ($self) = @_;
778
    my ($self) = @_;
779
780
    my $transfer = $self->_result->current_branchtransfers->next;
779
    my $transfer = $self->_result->current_branchtransfers->next;
781
    return  Koha::Item::Transfer->_new_from_dbic($transfer) if $transfer;
780
    return  Koha::Item::Transfer->_new_from_dbic($transfer) if $transfer;
782
}
781
}
(-)a/Koha/Schema/Result/Item.pm (-12 / +22 lines)
Lines 1013-1031 __PACKAGE__->many_to_many( Link Here
1013
  "ordernumber",
1013
  "ordernumber",
1014
);
1014
);
1015
1015
1016
#__PACKAGE__->has_many(
1017
#  "current_branchtransfers",
1018
#  "Koha::Schema::Result::Branchtransfer",
1019
#    sub {
1020
#        my $args = shift;
1021
#
1022
#        return {
1023
#            "$args->{foreign_alias}.itemnumber"    => { -ident => "$args->{self_alias}.itemnumber" },
1024
#            "$args->{foreign_alias}.datearrived"   => undef,
1025
#            "$args->{foreign_alias}.datecancelled" => undef,
1026
#        };
1027
#    },
1028
#    { order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ] }
1029
#);
1030
1016
__PACKAGE__->has_many(
1031
__PACKAGE__->has_many(
1017
  "current_branchtransfers",
1032
    "current_branchtransfers",
1018
  "Koha::Schema::Result::Branchtransfer",
1033
    "Koha::Schema::Result::Branchtransfer",
1019
    sub {
1034
    { "foreign.itemnumber" => "self.itemnumber" },
1020
        my $args = shift;
1035
    {
1021
1036
        where    => { 'datearrived' => undef, 'datecancelled' => undef },
1022
        return {
1037
        order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ]
1023
            "$args->{foreign_alias}.itemnumber"    => { -ident => "$args->{self_alias}.itemnumber" },
1038
    }
1024
            "$args->{foreign_alias}.datearrived"   => undef,
1025
            "$args->{foreign_alias}.datecancelled" => undef,
1026
        };
1027
    },
1028
    { order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ] }
1029
);
1039
);
1030
1040
1031
# Relationship with bundled items
1041
# Relationship with bundled items
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 196-202 $params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems; Link Here
196
my $items_params = {
196
my $items_params = {
197
    ( $invalid_marc_record ? () : ( host_items => 1 ) ),
197
    ( $invalid_marc_record ? () : ( host_items => 1 ) ),
198
};
198
};
199
my $items = $biblio->items($items_params)->search_ordered( $params, { prefetch => ['issue','current_branchtransfers'] } );
199
my $items = $biblio->items($items_params)->search_ordered( $params, { prefetch => ['issue'] } );
200
200
201
# flag indicating existence of at least one item linked via a host record
201
# flag indicating existence of at least one item linked via a host record
202
my $hostrecords = $biblio->host_items->count;
202
my $hostrecords = $biblio->host_items->count;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +1 lines)
Lines 121-127 Link Here
121
                                </div> <!-- /.hold-auto-filled -->
121
                                </div> <!-- /.hold-auto-filled -->
122
                            [% END # /IF hold_auto_filled %]
122
                            [% END # /IF hold_auto_filled %]
123
123
124
                            [% IF ( trigger ) %]
124
                            [% IF ( trigger && !transfertodo ) %]
125
                                 <div id="transfer-trigger" class="dialog message">
125
                                 <div id="transfer-trigger" class="dialog message">
126
                                     <h3>Reason for transfer</h3>
126
                                     <h3>Reason for transfer</h3>
127
                                     <p>
127
                                     <p>
128
- 

Return to bug 35100