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

(-)a/Koha/Account/Line.pm (-6 / +13 lines)
Lines 264-277 sub apply { Link Here
264
            $debit->amountoutstanding( $owed - $amount_to_cancel )->store;
264
            $debit->amountoutstanding( $owed - $amount_to_cancel )->store;
265
265
266
            # Same logic exists in Koha::Account::pay
266
            # Same logic exists in Koha::Account::pay
267
            if (   $debit->amountoutstanding == 0
267
            if (
268
                && $debit->itemnumber
268
                C4::Context->preference('MarkLostItemsAsReturned') =~
269
                m|onpayment|
269
                && $debit->debit_type_code
270
                && $debit->debit_type_code
270
                && $debit->debit_type_code eq 'LOST' )
271
                && $debit->debit_type_code eq 'LOST'
272
                && $debit->amountoutstanding == 0
273
                && $debit->itemnumber
274
                && !(
275
                       $self->credit_type_code eq 'LOST_FOUND'
276
                    && $self->itemnumber == $debit->itemnumber
277
                )
278
              )
271
            {
279
            {
272
                C4::Circulation::ReturnLostItem( $self->borrowernumber, $debit->itemnumber );
280
                C4::Circulation::ReturnLostItem( $self->borrowernumber,
281
                    $debit->itemnumber );
273
            }
282
            }
274
275
        }
283
        }
276
    });
284
    });
277
285
278
- 

Return to bug 22750