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

(-)a/Koha/Account/Line.pm (-1 / +3 lines)
Lines 248-254 sub apply { Link Here
248
                $debit->amountoutstanding,
248
                $debit->amountoutstanding,
249
                $debit
249
                $debit
250
            );
250
            );
251
            $overdue_unreturned->{$debit->itemnumber} = $debit if $renewable;
251
            if ($renewable && $debit->itemnumber) {
252
                $overdue_unreturned->{$debit->itemnumber} = $debit;
253
            }
252
254
253
            # Same logic exists in Koha::Account::pay
255
            # Same logic exists in Koha::Account::pay
254
            if (   $debit->amountoutstanding == 0
256
            if (   $debit->amountoutstanding == 0
(-)a/t/db_dependent/Koha/Account.t (-1 / +1 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 11;
22
use Test::More tests => 12;
23
use Test::MockModule;
23
use Test::MockModule;
24
use Test::Exception;
24
use Test::Exception;
25
25
(-)a/t/db_dependent/Koha/Account/Lines.t (-2 / +1 lines)
Lines 365-371 subtest 'apply() tests' => sub { Link Here
365
    my $module = new Test::MockModule('C4::Circulation');
365
    my $module = new Test::MockModule('C4::Circulation');
366
    $module->mock('AddRenewal', sub { $called = 1; });
366
    $module->mock('AddRenewal', sub { $called = 1; });
367
    my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' });
367
    my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' });
368
    my $debits_renew = Koha::Account::Lines->search({ accountlines_id => $accountline->id });
368
    my $debits_renew = Koha::Account::Lines->search({ accountlines_id => $accountline->id })->as_list;
369
    $credit_renew->apply( { debits => $debits_renew, offset_type => 'Manual Credit' } );
369
    $credit_renew->apply( { debits => $debits_renew, offset_type => 'Manual Credit' } );
370
370
371
    is( $called, 1, 'RenewAccruingItemWhenPaid causes C4::Circulation::AddRenew to be called when appropriate' );
371
    is( $called, 1, 'RenewAccruingItemWhenPaid causes C4::Circulation::AddRenew to be called when appropriate' );
372
- 

Return to bug 23051