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

(-)a/C4/Circulation.pm (-2 / +21 lines)
Lines 1877-1882 sub AddReturn { Link Here
1877
        return ( $doreturn, $messages, $issue, $patron_unblessed);
1877
        return ( $doreturn, $messages, $issue, $patron_unblessed);
1878
    }
1878
    }
1879
1879
1880
    # if we try a checkin that would result in a forbidden branchtransfer, refuse the return as well
1881
    # first, find branchtransferlimit value for this item
1882
    my $branchtransferlimitvalue = $itemtype;
1883
    $branchtransferlimitvalue = $item->{ccode}
1884
        if C4::Context->preference("item-level_itypes")
1885
            && C4::Context->preference("BranchTransferLimitsType") eq 'ccode';
1886
    if ( $hbr ne $branch
1887
            && (
1888
                C4::Context->preference("IndependentBranches")
1889
                or ( C4::Context->preference("UseBranchTransferLimits")
1890
                    and not IsBranchTransferAllowed($hbr, $branch, $branchtransferlimitvalue ) )
1891
        )
1892
    ) {
1893
        $messages->{'Wrongbranch'} = {
1894
            Wrongbranch => $branch,
1895
            Rightbranch => $message
1896
        };
1897
        $doreturn = 0;
1898
        return ( $doreturn, $messages, $issue, $patron_unblessed);
1899
    }
1900
1880
    if ( $item->{'withdrawn'} ) { # book has been cancelled
1901
    if ( $item->{'withdrawn'} ) { # book has been cancelled
1881
        $messages->{'withdrawn'} = 1;
1902
        $messages->{'withdrawn'} = 1;
1882
        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
1903
        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
Lines 3556-3562 Code is either an itemtype or collection doe depending on the pref BranchTransfe Link Here
3556
3577
3557
sub IsBranchTransferAllowed {
3578
sub IsBranchTransferAllowed {
3558
	my ( $toBranch, $fromBranch, $code ) = @_;
3579
	my ( $toBranch, $fromBranch, $code ) = @_;
3559
3560
	if ( $toBranch eq $fromBranch ) { return 1; } ## Short circuit for speed.
3580
	if ( $toBranch eq $fromBranch ) { return 1; } ## Short circuit for speed.
3561
        
3581
        
3562
	my $limitType = C4::Context->preference("BranchTransferLimitsType");   
3582
	my $limitType = C4::Context->preference("BranchTransferLimitsType");   
3563
- 

Return to bug 7376