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

(-)a/Koha/Item.pm (-1 / +23 lines)
Lines 1488-1493 sub _set_found_trigger { Link Here
1488
                    # will be credited which settles the debt without
1488
                    # will be credited which settles the debt without
1489
                    # creating extra credits
1489
                    # creating extra credits
1490
1490
1491
                    if ( $lost_charge->amountoutstanding == 0 ) {
1492
                        my $no_refund_if_lost_fee_paid_age = C4::Context->preference('NoRefundOnLostFinesPaidAge');
1493
                        if ($no_refund_if_lost_fee_paid_age) {
1494
                            my $lost_fee_payment = $lost_charge->debit_offsets( { type => 'APPLY' } )->last;
1495
                            if ($lost_fee_payment) {
1496
                                my $today = dt_from_string();
1497
                                my $payment_age_in_days =
1498
                                    dt_from_string( $lost_fee_payment->created_on )->delta_days($today)
1499
                                    ->in_units('days');
1500
                                if ( $payment_age_in_days > $no_refund_if_lost_fee_paid_age ) {
1501
                                    $self->add_message(
1502
                                        {
1503
                                            type    => 'info',
1504
                                            message => 'payment_not_refunded',
1505
                                            payload => undef
1506
                                        }
1507
                                    );
1508
                                    return $self;
1509
                                }
1510
                            }
1511
                        }
1512
                    }
1513
1491
                    my $credit_offsets = $lost_charge->debit_offsets(
1514
                    my $credit_offsets = $lost_charge->debit_offsets(
1492
                        {
1515
                        {
1493
                            'credit_id'               => { '!=' => undef },
1516
                            'credit_id'               => { '!=' => undef },
1494
- 

Return to bug 28575