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

(-)a/Koha/Account.pm (-1 / +1 lines)
Lines 351-357 sub add_credit { Link Here
351
                    borrowernumber => $self->{patron_id},
351
                    borrowernumber => $self->{patron_id},
352
                    accountno      => $accountno,
352
                    accountno      => $accountno,
353
                }
353
                }
354
            );
354
            ) if grep { $type eq $_ } ('payment', 'writeoff') ;
355
355
356
            if ( C4::Context->preference("FinesLog") ) {
356
            if ( C4::Context->preference("FinesLog") ) {
357
                logaction(
357
                logaction(
(-)a/t/db_dependent/Koha/Account.t (-1 / +12 lines)
Lines 178-182 subtest 'add_credit() tests' => sub { Link Here
178
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
178
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
179
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
179
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
180
180
181
    my $line_3 = $account->add_credit(
182
        {   amount      => 20,
183
            description => 'Manual credit applied',
184
            library_id  => $patron->branchcode,
185
            user_id     => $patron->id,
186
            type        => 'forgiven'
187
        }
188
    );
189
190
    is( $schema->resultset('ActionLog')->count(), 2, 'Log was added' );
191
    is( $schema->resultset('Statistic')->count(), 2, 'No action added to statistics, because of credit type' );
192
181
    $schema->storage->txn_rollback;
193
    $schema->storage->txn_rollback;
182
};
194
};
183
- 

Return to bug 20980