Lines 1898-1903
sub AddReturn {
Link Here
|
1898 |
# get the proper branch to which to return the item |
1898 |
# get the proper branch to which to return the item |
1899 |
my $returnbranch = $hbr ne 'noreturn' ? $item->$hbr : $branch; |
1899 |
my $returnbranch = $hbr ne 'noreturn' ? $item->$hbr : $branch; |
1900 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
1900 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
|
|
1901 |
my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef; |
1901 |
|
1902 |
|
1902 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
1903 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
1903 |
my $patron_unblessed = $patron ? $patron->unblessed : {}; |
1904 |
my $patron_unblessed = $patron ? $patron->unblessed : {}; |
Lines 2137-2148
sub AddReturn {
Link Here
|
2137 |
(C4::Context->preference("UseBranchTransferLimits") and |
2138 |
(C4::Context->preference("UseBranchTransferLimits") and |
2138 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2139 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2139 |
)) { |
2140 |
)) { |
2140 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->itemnumber,$branch, $returnbranch; |
2141 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s, %s)", $item->itemnumber,$branch, $returnbranch, $transfer_trigger; |
2141 |
$debug and warn "item: " . Dumper($item_unblessed); |
2142 |
$debug and warn "item: " . Dumper($item_unblessed); |
2142 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch); |
2143 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch, $transfer_trigger); |
2143 |
$messages->{'WasTransfered'} = 1; |
2144 |
$messages->{'WasTransfered'} = 1; |
2144 |
} else { |
2145 |
} else { |
2145 |
$messages->{'NeedsTransfer'} = $returnbranch; |
2146 |
$messages->{'NeedsTransfer'} = $returnbranch; |
|
|
2147 |
$messages->{'TransferTrigger'} = $transfer_trigger; |
2146 |
} |
2148 |
} |
2147 |
} |
2149 |
} |
2148 |
|
2150 |
|