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

(-)a/Koha/Account.pm (-1 / +1 lines)
Lines 346-352 sub add_credit { Link Here
346
                    borrowernumber => $self->{patron_id},
346
                    borrowernumber => $self->{patron_id},
347
                    accountno      => $accountno,
347
                    accountno      => $accountno,
348
                }
348
                }
349
            );
349
            ) if grep { $type eq $_ } ('payment', 'writeoff') ;
350
350
351
            if ( C4::Context->preference("FinesLog") ) {
351
            if ( C4::Context->preference("FinesLog") ) {
352
                logaction(
352
                logaction(
(-)a/t/db_dependent/Koha/Account.t (-2 / +14 lines)
Lines 32-38 my $builder = t::lib::TestBuilder->new; Link Here
32
32
33
subtest 'add_credit() tests' => sub {
33
subtest 'add_credit() tests' => sub {
34
34
35
    plan tests => 13;
35
    plan tests => 15;
36
36
37
    $schema->storage->txn_begin;
37
    $schema->storage->txn_begin;
38
38
Lines 53-58 subtest 'add_credit() tests' => sub { Link Here
53
            description => 'Payment of 25',
53
            description => 'Payment of 25',
54
            library_id  => $patron->branchcode,
54
            library_id  => $patron->branchcode,
55
            note        => 'not really important',
55
            note        => 'not really important',
56
            type        => 'payment',
56
            user_id     => $patron->id
57
            user_id     => $patron->id
57
        }
58
        }
58
    );
59
    );
Lines 90-94 subtest 'add_credit() tests' => sub { Link Here
90
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
91
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
91
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
92
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
92
93
94
    my $line_3 = $account->add_credit(
95
        {   amount      => 20,
96
            description => 'Manual credit applied',
97
            library_id  => $patron->branchcode,
98
            user_id     => $patron->id,
99
            type        => 'forgiven'
100
        }
101
    );
102
103
    is( $schema->resultset('ActionLog')->count(), 2, 'Log was added' );
104
    is( $schema->resultset('Statistic')->count(), 2, 'No action added to statistics, because of credit type' );
105
93
    $schema->storage->txn_rollback;
106
    $schema->storage->txn_rollback;
94
};
107
};
95
- 

Return to bug 20980