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

(-)a/catalogue/moredetail.pl (-6 / +4 lines)
Lines 208-221 foreach my $item (@items){ Link Here
208
        );
208
        );
209
209
210
        if ( my $accountline = $accountlines->next ) {
210
        if ( my $accountline = $accountlines->next ) {
211
            my $payment_offsets = Koha::Account::Offsets->search(
211
            my $payment_offsets = $accountline->debit_offsets(
212
                {
212
                {
213
                    debit_id  => $accountline->id,
214
                    credit_id => { '!=' => undef }, # it is not the debit itself
213
                    credit_id => { '!=' => undef }, # it is not the debit itself
215
                    type => { '!=' => [ 'Writeoff', 'Forgiven' ] },
214
                    'credit.credit_type_code' =>
216
                    amount => { '<' => 0 }    # credits are negative on the DB
215
                      { '!=' => [ 'Writeoff', 'Forgiven' ] },
217
                },
216
                },
218
                { order_by => { '-desc' => 'created_on' } }
217
                { join => 'credit', order_by => { '-desc' => 'created_on' } }
219
            );
218
            );
220
219
221
            if ($payment_offsets->count) {
220
            if ($payment_offsets->count) {
222
- 

Return to bug 22435