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

(-)a/Koha/Item.pm (-1 / +23 lines)
Lines 1517-1522 sub _set_found_trigger { Link Here
1517
                    # will be credited which settles the debt without
1517
                    # will be credited which settles the debt without
1518
                    # creating extra credits
1518
                    # creating extra credits
1519
1519
1520
                    if ( $lost_charge->amountoutstanding == 0 ) {
1521
                        my $no_refund_if_lost_fee_paid_age = C4::Context->preference('NoRefundOnLostFinesPaidAge');
1522
                        if ($no_refund_if_lost_fee_paid_age) {
1523
                            my $lost_fee_payment = $lost_charge->debit_offsets( { type => 'APPLY' } )->last;
1524
                            if ($lost_fee_payment) {
1525
                                my $today = dt_from_string();
1526
                                my $payment_age_in_days =
1527
                                    dt_from_string( $lost_fee_payment->created_on )->delta_days($today)
1528
                                    ->in_units('days');
1529
                                if ( $payment_age_in_days > $no_refund_if_lost_fee_paid_age ) {
1530
                                    $self->add_message(
1531
                                        {
1532
                                            type    => 'info',
1533
                                            message => 'payment_not_refunded',
1534
                                            payload => undef
1535
                                        }
1536
                                    );
1537
                                    return $self;
1538
                                }
1539
                            }
1540
                        }
1541
                    }
1542
1520
                    my $credit_offsets = $lost_charge->debit_offsets(
1543
                    my $credit_offsets = $lost_charge->debit_offsets(
1521
                        {
1544
                        {
1522
                            'credit_id'               => { '!=' => undef },
1545
                            'credit_id'               => { '!=' => undef },
1523
- 

Return to bug 28575