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

(-)a/C4/Circulation.pm (-1 / +15 lines)
Lines 2041-2046 sub AddReturn { Link Here
2041
            $messages->{'NeedsTransfer'} = 1;   # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch}
2041
            $messages->{'NeedsTransfer'} = 1;   # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch}
2042
        }
2042
        }
2043
    }
2043
    }
2044
    #This elsif-clause copypastes the upper if-clause. This is horrible and I cry, but cannot refactor this mess now :( due to Koha upstream master stuff looming.
2045
    elsif (($doreturn or $messages->{'NotIssued'})
2046
        and !$resfound and ($branch ne $hbr)
2047
        and not($messages->{'WrongTransfer'})
2048
        && $floatingType){ #So if we would otherwise transfer, but we have a floating rule overriding it.
2049
                           #We can infer that the transfer was averted because of a floating rule.
2050
        #Make sure we dont log the same floating denial multiple times
2051
        #So first check if we already logged this operation.
2052
        my $logs = C4::Log::GetLogs(DateTime->now(time_zone => C4::Context->tz),
2053
                                    DateTime->now(time_zone => C4::Context->tz),
2054
                                    undef, ['FLOATING'], undef, $item->{'itemnumber'}, "$branch -> $hbr denied");
2055
        if (not($logs) || (ref($logs) eq 'ARRAY' && scalar(@$logs) == 0)) {
2056
            C4::Log::logaction("FLOATING", $floatingType, $item->{'itemnumber'}, "$branch -> $hbr denied");
2057
        }
2058
    }
2044
    return ( $doreturn, $messages, $issue, $borrower );
2059
    return ( $doreturn, $messages, $issue, $borrower );
2045
}
2060
}
2046
2061
2047
- 

Return to bug 9525