Lines 1882-1887
sub AddReturn {
Link Here
|
1882 |
# get the proper branch to which to return the item |
1882 |
# get the proper branch to which to return the item |
1883 |
my $returnbranch = $hbr ne 'noreturn' ? $item->$hbr : $branch; |
1883 |
my $returnbranch = $hbr ne 'noreturn' ? $item->$hbr : $branch; |
1884 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
1884 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
|
|
1885 |
my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef; |
1885 |
|
1886 |
|
1886 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
1887 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
1887 |
my $patron_unblessed = $patron ? $patron->unblessed : {}; |
1888 |
my $patron_unblessed = $patron ? $patron->unblessed : {}; |
Lines 2115-2126
sub AddReturn {
Link Here
|
2115 |
(C4::Context->preference("UseBranchTransferLimits") and |
2116 |
(C4::Context->preference("UseBranchTransferLimits") and |
2116 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2117 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2117 |
)) { |
2118 |
)) { |
2118 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->itemnumber,$branch, $returnbranch; |
2119 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s, %s)", $item->itemnumber,$branch, $returnbranch, $transfer_trigger; |
2119 |
$debug and warn "item: " . Dumper($item_unblessed); |
2120 |
$debug and warn "item: " . Dumper($item_unblessed); |
2120 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch); |
2121 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch, $transfer_trigger); |
2121 |
$messages->{'WasTransfered'} = 1; |
2122 |
$messages->{'WasTransfered'} = 1; |
2122 |
} else { |
2123 |
} else { |
2123 |
$messages->{'NeedsTransfer'} = $returnbranch; |
2124 |
$messages->{'NeedsTransfer'} = $returnbranch; |
|
|
2125 |
$messages->{'TransferTrigger'} = $transfer_trigger; |
2124 |
} |
2126 |
} |
2125 |
} |
2127 |
} |
2126 |
|
2128 |
|