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

(-)a/C4/Circulation.pm (-1 / +3 lines)
Lines 2429-2438 sub _FixAccountForLostAndReturned { Link Here
2429
    my $credit_total = $accountline->amountoutstanding + $total_to_refund;
2429
    my $credit_total = $accountline->amountoutstanding + $total_to_refund;
2430
2430
2431
    if ( $credit_total > 0 ) {
2431
    if ( $credit_total > 0 ) {
2432
        my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
2432
        $credit = $account->add_credit(
2433
        $credit = $account->add_credit(
2433
            {   amount      => $credit_total,
2434
            {   amount      => $credit_total,
2434
                description => 'Item Returned ' . $item_id,
2435
                description => 'Item Returned ' . $item_id,
2435
                type        => 'lost_item_return'
2436
                type        => 'lost_item_return',
2437
                library_id  => $branchcode
2436
            }
2438
            }
2437
        );
2439
        );
2438
2440
(-)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