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 2146-2157
sub AddReturn {
Link Here
|
2146 |
(C4::Context->preference("UseBranchTransferLimits") and |
2147 |
(C4::Context->preference("UseBranchTransferLimits") and |
2147 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2148 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2148 |
)) { |
2149 |
)) { |
2149 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->itemnumber,$branch, $returnbranch; |
2150 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s, %s)", $item->itemnumber,$branch, $returnbranch, $transfer_trigger; |
2150 |
$debug and warn "item: " . Dumper($item_unblessed); |
2151 |
$debug and warn "item: " . Dumper($item_unblessed); |
2151 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch); |
2152 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch, $transfer_trigger); |
2152 |
$messages->{'WasTransfered'} = 1; |
2153 |
$messages->{'WasTransfered'} = 1; |
2153 |
} else { |
2154 |
} else { |
2154 |
$messages->{'NeedsTransfer'} = $returnbranch; |
2155 |
$messages->{'NeedsTransfer'} = $returnbranch; |
|
|
2156 |
$messages->{'TransferTrigger'} = $transfer_trigger; |
2155 |
} |
2157 |
} |
2156 |
} |
2158 |
} |
2157 |
|
2159 |
|