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

(-)a/Koha/Account.pm (-1 / +1 lines)
Lines 347-353 sub add_credit { Link Here
347
                    borrowernumber => $self->{patron_id},
347
                    borrowernumber => $self->{patron_id},
348
                    accountno      => $accountno,
348
                    accountno      => $accountno,
349
                }
349
                }
350
            );
350
            ) if grep { $type eq $_ } ('payment', 'writeoff') ;
351
351
352
            if ( C4::Context->preference("FinesLog") ) {
352
            if ( C4::Context->preference("FinesLog") ) {
353
                logaction(
353
                logaction(
(-)a/t/db_dependent/Koha/Account.t (-2 / +14 lines)
Lines 67-73 subtest 'outstanding_debits() tests' => sub { Link Here
67
67
68
subtest 'add_credit() tests' => sub {
68
subtest 'add_credit() tests' => sub {
69
69
70
    plan tests => 13;
70
    plan tests => 15;
71
71
72
    $schema->storage->txn_begin;
72
    $schema->storage->txn_begin;
73
73
Lines 88-93 subtest 'add_credit() tests' => sub { Link Here
88
            description => 'Payment of 25',
88
            description => 'Payment of 25',
89
            library_id  => $patron->branchcode,
89
            library_id  => $patron->branchcode,
90
            note        => 'not really important',
90
            note        => 'not really important',
91
            type        => 'payment',
91
            user_id     => $patron->id
92
            user_id     => $patron->id
92
        }
93
        }
93
    );
94
    );
Lines 125-129 subtest 'add_credit() tests' => sub { Link Here
125
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
126
    is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' );
126
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
127
    is( $offset_2->debit_id, undef, 'No debit_id is set for credits' );
127
128
129
    my $line_3 = $account->add_credit(
130
        {   amount      => 20,
131
            description => 'Manual credit applied',
132
            library_id  => $patron->branchcode,
133
            user_id     => $patron->id,
134
            type        => 'forgiven'
135
        }
136
    );
137
138
    is( $schema->resultset('ActionLog')->count(), 2, 'Log was added' );
139
    is( $schema->resultset('Statistic')->count(), 2, 'No action added to statistics, because of credit type' );
140
128
    $schema->storage->txn_rollback;
141
    $schema->storage->txn_rollback;
129
};
142
};
130
- 

Return to bug 20980