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

(-)a/C4/Circulation.pm (-10 / +11 lines)
Lines 2039-2046 sub AddReturn { Link Here
2039
        $item->holdingbranch($branch)->store;
2039
        $item->holdingbranch($branch)->store;
2040
    }
2040
    }
2041
2041
2042
    my $item_was_lost = $item->itemlost;
2042
    my $leave_item_lost = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0;
2043
    my $leave_item_lost = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0;
2043
    ModDateLastSeen( $item->itemnumber, $leave_item_lost );
2044
    ModDateLastSeen( $item->itemnumber, $leave_item_lost ); # will unset itemlost if needed
2045
2046
    # fix up the accounts.....
2047
    if ( $item_was_lost ) {
2048
        $messages->{'WasLost'} = 1;
2049
        unless ( C4::Context->preference("BlockReturnOfLostItems") ) {
2050
            #my $refunded = Koha::Account::Lines->search{(itemnumber => $item->itemnumber, type => 'LOST_FOUND', # FIXME which other parameters to know it has been refunded?
2051
            $messages->{'LostItemFeeRefunded'} = 1;
2052
        }
2053
    }
2044
2054
2045
    # check if we have a transfer for this document
2055
    # check if we have a transfer for this document
2046
    my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->itemnumber );
2056
    my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->itemnumber );
Lines 2060-2073 sub AddReturn { Link Here
2060
        $validTransfert = 1;
2070
        $validTransfert = 1;
2061
    }
2071
    }
2062
2072
2063
    # fix up the accounts.....
2064
    if ( $item->itemlost ) {
2065
        $messages->{'WasLost'} = 1;
2066
        unless ( C4::Context->preference("BlockReturnOfLostItems") ) {
2067
            $messages->{'LostItemFeeRefunded'} = $refunded;
2068
        }
2069
    }
2070
2071
    # fix up the overdues in accounts...
2073
    # fix up the overdues in accounts...
2072
    if ($borrowernumber) {
2074
    if ($borrowernumber) {
2073
        my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine, 'RETURNED' );
2075
        my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine, 'RETURNED' );
2074
- 

Return to bug 18501