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

(-)a/C4/Circulation.pm (-5 / +8 lines)
Lines 349-355 sub transferbook { Link Here
349
    my $itemnumber = $item->itemnumber;
349
    my $itemnumber = $item->itemnumber;
350
350
351
    # get branches of book...
351
    # get branches of book...
352
    my $hbr = $item->homebranch;
352
    my $hbr = $item->effective_homebranch;
353
353
354
    # if using Branch Transfer Limits
354
    # if using Branch Transfer Limits
355
    if ( C4::Context->preference("UseBranchTransferLimits") == 1 ) {
355
    if ( C4::Context->preference("UseBranchTransferLimits") == 1 ) {
Lines 2340-2346 sub AddReturn { Link Here
2340
2340
2341
        # if library isn't in same the float group, transfer item to homebranch
2341
        # if library isn't in same the float group, transfer item to homebranch
2342
        $hbr          = 'homebranch';
2342
        $hbr          = 'homebranch';
2343
        $returnbranch = $validate_float ? $branch : $item->$hbr;
2343
        $returnbranch = $validate_float ? $branch : $item->effective_homebranch;
2344
    } elsif ( $hbr eq 'homebranch' ) {
2345
        $returnbranch = $item->effective_homebranch;
2346
    } elsif ( $hbr eq 'holdingbranch' ) {
2347
        $returnbranch = $item->effective_holdingbranch;
2344
    } else {
2348
    } else {
2345
        $returnbranch = $item->$hbr;
2349
        $returnbranch = $item->$hbr;
2346
    }
2350
    }
Lines 2354-2360 sub AddReturn { Link Here
2354
        my $limit = Koha::Library::FloatLimits->find( { itemtype => $effective_itemtype, branchcode => $branch } );
2358
        my $limit = Koha::Library::FloatLimits->find( { itemtype => $effective_itemtype, branchcode => $branch } );
2355
        if ($limit) {
2359
        if ($limit) {
2356
            my $transfer_library =
2360
            my $transfer_library =
2357
                Koha::Library::FloatLimits->lowest_ratio_library( $item, $branch, $item->holdingbranch );
2361
                Koha::Library::FloatLimits->lowest_ratio_library( $item, $branch, $item->effective_holdingbranch );
2358
            if ( $transfer_library && $transfer_library->branchcode ne $branch ) {
2362
            if ( $transfer_library && $transfer_library->branchcode ne $branch ) {
2359
                $returnbranch     = $transfer_library->branchcode;
2363
                $returnbranch     = $transfer_library->branchcode;
2360
                $transfer_trigger = 'LibraryFloatLimit';
2364
                $transfer_trigger = 'LibraryFloatLimit';
Lines 2469-2475 sub AddReturn { Link Here
2469
2473
2470
    # the holdingbranch is updated if the document is returned to another location.
2474
    # the holdingbranch is updated if the document is returned to another location.
2471
    # this is always done regardless of whether the item was on loan or not
2475
    # this is always done regardless of whether the item was on loan or not
2472
    if ( $item->holdingbranch ne $branch ) {
2476
    if ( $item->effective_holdingbranch ne $branch ) {
2473
        $item->holdingbranch($branch)->store( { log_action => 0, skip_record_index => 1, skip_holds_queue => 1 } );
2477
        $item->holdingbranch($branch)->store( { log_action => 0, skip_record_index => 1, skip_holds_queue => 1 } );
2474
    }
2478
    }
2475
2479
2476
- 

Return to bug 14962