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

(-)a/C4/Circulation.pm (-1 / +3 lines)
Lines 2426-2437 sub _FixAccountForLostAndReturned { Link Here
2426
                                : 0;
2426
                                : 0;
2427
2427
2428
        if ( $total_to_refund > 0 ) {
2428
        if ( $total_to_refund > 0 ) {
2429
            my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
2429
            my $account = Koha::Patrons->find( $accountline->borrowernumber )->account;
2430
            my $account = Koha::Patrons->find( $accountline->borrowernumber )->account;
2430
            $credit = $account->add_credit(
2431
            $credit = $account->add_credit(
2431
                {
2432
                {
2432
                    amount      => $total_to_refund,
2433
                    amount      => $total_to_refund,
2433
                    description => 'Item Returned ' . $item_id,
2434
                    description => 'Item Returned ' . $item_id,
2434
                    type        => 'lost_item_return'
2435
                    type        => 'lost_item_return',
2436
                    library_id   => $branchcode,
2435
                }
2437
                }
2436
            );
2438
            );
2437
        }
2439
        }
(-)a/Koha/Account.pm (-2 / +5 lines)
Lines 357-362 sub add_credit { Link Here
357
            # Insert the account line
357
            # Insert the account line
358
            $line = Koha::Account::Line->new(
358
            $line = Koha::Account::Line->new(
359
                {   borrowernumber    => $self->{patron_id},
359
                {   borrowernumber    => $self->{patron_id},
360
                    accountno         => $accountno,
360
                    date              => \'NOW()',
361
                    date              => \'NOW()',
361
                    amount            => $amount,
362
                    amount            => $amount,
362
                    description       => $description,
363
                    description       => $description,
Lines 365-371 sub add_credit { Link Here
365
                    payment_type      => $payment_type,
366
                    payment_type      => $payment_type,
366
                    note              => $note,
367
                    note              => $note,
367
                    manager_id        => $user_id,
368
                    manager_id        => $user_id,
368
                    itemnumber        => $item_id
369
                    branchcode        => $library_id,
370
                    itemnumber        => $item_id,
371
                    lastincrement     => undef,
369
                }
372
                }
370
            )->store();
373
            )->store();
371
374
Lines 401-406 sub add_credit { Link Here
401
                            note              => $note,
404
                            note              => $note,
402
                            itemnumber        => $item_id,
405
                            itemnumber        => $item_id,
403
                            manager_id        => $user_id,
406
                            manager_id        => $user_id,
407
                            branchcode        => $library_id,
404
                        }
408
                        }
405
                    )
409
                    )
406
                );
410
                );
407
- 

Return to bug 19066