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 62-68 subtest 'outstanding_debits() tests' => sub { Link Here
62
62
63
subtest 'add_credit() tests' => sub {
63
subtest 'add_credit() tests' => sub {
64
64
65
    plan tests => 13;
65
    plan tests => 15;
66
66
67
    $schema->storage->txn_begin;
67
    $schema->storage->txn_begin;
68
68
Lines 83-88 subtest 'add_credit() tests' => sub { Link Here
83
            description => 'Payment of 25',
83
            description => 'Payment of 25',
84
            library_id  => $patron->branchcode,
84
            library_id  => $patron->branchcode,
85
            note        => 'not really important',
85
            note        => 'not really important',
86
            type        => 'payment',
86
            user_id     => $patron->id
87
            user_id     => $patron->id
87
        }
88
        }
88
    );
89
    );
Lines 120-124 subtest 'add_credit() tests' => sub { Link Here
120
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
121
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
121
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
122
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
122
123
124
    my $line_3 = $account->add_credit(
125
        {   amount      => 20,
126
            description => 'Manual credit applied',
127
            library_id  => $patron->branchcode,
128
            user_id     => $patron->id,
129
            type        => 'forgiven'
130
        }
131
    );
132
133
    is( $schema->resultset('ActionLog')->count(), 2, 'Log was added' );
134
    is( $schema->resultset('Statistic')->count(), 2, 'No action added to statistics, because of credit type' );
135
123
    $schema->storage->txn_rollback;
136
    $schema->storage->txn_rollback;
124
};
137
};
125
- 

Return to bug 20980