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

(-)a/C4/Circulation.pm (-1 / +3 lines)
Lines 2424-2435 sub _FixAccountForLostAndReturned { Link Here
2424
                                : 0;
2424
                                : 0;
2425
2425
2426
        if ( $total_to_refund > 0 ) {
2426
        if ( $total_to_refund > 0 ) {
2427
            my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
2427
            my $account = Koha::Patrons->find( $accountline->borrowernumber )->account;
2428
            my $account = Koha::Patrons->find( $accountline->borrowernumber )->account;
2428
            $credit = $account->add_credit(
2429
            $credit = $account->add_credit(
2429
                {
2430
                {
2430
                    amount      => $total_to_refund,
2431
                    amount      => $total_to_refund,
2431
                    description => 'Item Returned ' . $item_id,
2432
                    description => 'Item Returned ' . $item_id,
2432
                    type        => 'lost_item_return'
2433
                    type        => 'lost_item_return',
2434
                    library_id   => $branchcode,
2433
                }
2435
                }
2434
            );
2436
            );
2435
        }
2437
        }
(-)a/Koha/Account.pm (-2 / +5 lines)
Lines 352-357 sub add_credit { Link Here
352
            # Insert the account line
352
            # Insert the account line
353
            $line = Koha::Account::Line->new(
353
            $line = Koha::Account::Line->new(
354
                {   borrowernumber    => $self->{patron_id},
354
                {   borrowernumber    => $self->{patron_id},
355
                    accountno         => $accountno,
355
                    date              => \'NOW()',
356
                    date              => \'NOW()',
356
                    amount            => $amount,
357
                    amount            => $amount,
357
                    description       => $description,
358
                    description       => $description,
Lines 360-366 sub add_credit { Link Here
360
                    payment_type      => $payment_type,
361
                    payment_type      => $payment_type,
361
                    note              => $note,
362
                    note              => $note,
362
                    manager_id        => $user_id,
363
                    manager_id        => $user_id,
363
                    itemnumber        => $item_id
364
                    branchcode        => $library_id,
365
                    itemnumber        => $item_id,
366
                    lastincrement     => undef,
364
                }
367
                }
365
            )->store();
368
            )->store();
366
369
Lines 396-401 sub add_credit { Link Here
396
                            note              => $note,
399
                            note              => $note,
397
                            itemnumber        => $item_id,
400
                            itemnumber        => $item_id,
398
                            manager_id        => $user_id,
401
                            manager_id        => $user_id,
402
                            branchcode        => $library_id,
399
                        }
403
                        }
400
                    )
404
                    )
401
                );
405
                );
402
- 

Return to bug 19066