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

(-)a/C4/Circulation.pm (-5 / +6 lines)
Lines 836-842 sub CanBookBeIssued { Link Here
836
        );
836
        );
837
        my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0;
837
        my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0;
838
        my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) =
838
        my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) =
839
            AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} );
839
            AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ) if $item_object->onloan;
840
        ModDateLastSeen( $item_object->itemnumber, $block_lost_return );    # FIXME Move to Koha::Item
840
        ModDateLastSeen( $item_object->itemnumber, $block_lost_return );    # FIXME Move to Koha::Item
841
        return (
841
        return (
842
            {
842
            {
Lines 2055-2061 sub GetBranchItemRule { Link Here
2055
=head2 AddReturn
2055
=head2 AddReturn
2056
2056
2057
  ($doreturn, $messages, $iteminformation, $borrower) =
2057
  ($doreturn, $messages, $iteminformation, $borrower) =
2058
      &AddReturn( $barcode, $branch [,$exemptfine] [,$returndate] );
2058
      &AddReturn( $barcode, $branch [,$exemptfine] [,$returndate] [,$skip_localuse ] );
2059
2059
2060
Returns a book.
2060
Returns a book.
2061
2061
Lines 2071-2076 removed. Optional. Link Here
2071
=item C<$return_date> allows the default return date to be overridden
2071
=item C<$return_date> allows the default return date to be overridden
2072
by the given return date. Optional.
2072
by the given return date. Optional.
2073
2073
2074
=item C<$skip_localuse> indicated that localuse should not be recorded. Optional.
2075
2074
=back
2076
=back
2075
2077
2076
C<&AddReturn> returns a list of four items:
2078
C<&AddReturn> returns a list of four items:
Lines 2136-2142 patron who last borrowed the book. Link Here
2136
=cut
2138
=cut
2137
2139
2138
sub AddReturn {
2140
sub AddReturn {
2139
    my ( $barcode, $branch, $exemptfine, $return_date ) = @_;
2141
    my ( $barcode, $branch, $exemptfine, $return_date, $skip_localuse ) = @_;
2140
2142
2141
    if ($branch and not Koha::Libraries->find($branch)) {
2143
    if ($branch and not Koha::Libraries->find($branch)) {
2142
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
2144
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
Lines 2479-2485 sub AddReturn { Link Here
2479
        ccode          => $item->ccode,
2481
        ccode          => $item->ccode,
2480
        categorycode   => $categorycode,
2482
        categorycode   => $categorycode,
2481
        interface      => C4::Context->interface,
2483
        interface      => C4::Context->interface,
2482
    });
2484
    }) unless ( $skip_localuse && $stat_type eq 'localuse' );
2483
2485
2484
    # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then.
2486
    # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then.
2485
    if ( $patron ) {
2487
    if ( $patron ) {
2486
- 

Return to bug 35840