Lines 1606-1611
sub AddReturn {
Link Here
|
1606 |
# check if we have a transfer for this document |
1606 |
# check if we have a transfer for this document |
1607 |
my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} ); |
1607 |
my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} ); |
1608 |
|
1608 |
|
|
|
1609 |
# find reserves..... |
1610 |
# if we don't have a reserve with the status W, we launch the Checkreserves routine |
1611 |
my ($resfound, $resrec) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); |
1612 |
if ($resfound) { |
1613 |
$resrec->{'ResFound'} = $resfound; |
1614 |
$messages->{'ResFound'} = $resrec; |
1615 |
} |
1616 |
|
1609 |
# if we have a transfer to do, we update the line of transfers with the datearrived |
1617 |
# if we have a transfer to do, we update the line of transfers with the datearrived |
1610 |
if ($datesent) { |
1618 |
if ($datesent) { |
1611 |
if ( $tobranch eq $branch ) { |
1619 |
if ( $tobranch eq $branch ) { |
Lines 1615-1621
sub AddReturn {
Link Here
|
1615 |
$sth->execute( $item->{'itemnumber'} ); |
1623 |
$sth->execute( $item->{'itemnumber'} ); |
1616 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
1624 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
1617 |
C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W'); |
1625 |
C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W'); |
1618 |
} else { |
1626 |
} elsif ( !($resrec && $resrec->{branchcode} eq $tobranch) ) { |
|
|
1627 |
# Do not raise WrongTransfer if it is transrerring to reserve branch |
1619 |
$messages->{'WrongTransfer'} = $tobranch; |
1628 |
$messages->{'WrongTransfer'} = $tobranch; |
1620 |
$messages->{'WrongTransferItem'} = $item->{'itemnumber'}; |
1629 |
$messages->{'WrongTransferItem'} = $item->{'itemnumber'}; |
1621 |
} |
1630 |
} |
Lines 1638-1651
sub AddReturn {
Link Here
|
1638 |
$messages->{'Debarred'} = $debardate if ($debardate); |
1647 |
$messages->{'Debarred'} = $debardate if ($debardate); |
1639 |
} |
1648 |
} |
1640 |
|
1649 |
|
1641 |
# find reserves..... |
|
|
1642 |
# if we don't have a reserve with the status W, we launch the Checkreserves routine |
1643 |
my ($resfound, $resrec) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); |
1644 |
if ($resfound) { |
1645 |
$resrec->{'ResFound'} = $resfound; |
1646 |
$messages->{'ResFound'} = $resrec; |
1647 |
} |
1648 |
|
1649 |
# update stats? |
1650 |
# update stats? |
1650 |
# Record the fact that this book was returned. |
1651 |
# Record the fact that this book was returned. |
1651 |
UpdateStats( |
1652 |
UpdateStats( |
1652 |
- |
|
|