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

(-)a/C4/Circulation.pm (-16 / +17 lines)
Lines 2433-2456 sub _FixOverduesOnReturn { Link Here
2433
            if ($exemptfine) {
2433
            if ($exemptfine) {
2434
                my $amountoutstanding = $accountline->amountoutstanding;
2434
                my $amountoutstanding = $accountline->amountoutstanding;
2435
2435
2436
                my $account = Koha::Account->new({patron_id => $borrowernumber});
2436
                if ( $amountoutstanding > 0 ) {
2437
                my $credit = $account->add_credit(
2437
                    my $account = Koha::Account->new({patron_id => $borrowernumber});
2438
                    {
2438
                    my $credit = $account->add_credit(
2439
                        amount     => $amountoutstanding,
2439
                        {
2440
                        user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
2440
                            amount     => $amountoutstanding,
2441
                        library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
2441
                            user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
2442
                        interface  => C4::Context->interface,
2442
                            library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
2443
                        type       => 'FORGIVEN',
2443
                            interface  => C4::Context->interface,
2444
                        item_id    => $item
2444
                            type       => 'FORGIVEN',
2445
                    }
2445
                            item_id    => $item
2446
                );
2446
                        }
2447
                    );
2447
2448
2448
                $credit->apply({ debits => [ $accountline ], offset_type => 'Forgiven' });
2449
                    $credit->apply({ debits => [ $accountline ], offset_type => 'Forgiven' });
2449
2450
2450
                $accountline->status('FORGIVEN');
2451
                    $accountline->status('FORGIVEN');
2451
2452
2452
                if (C4::Context->preference("FinesLog")) {
2453
                    if (C4::Context->preference("FinesLog")) {
2453
                    &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2454
                        &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2455
                    }
2454
                }
2456
                }
2455
            } else {
2457
            } else {
2456
                $accountline->status($status);
2458
                $accountline->status($status);
2457
- 

Return to bug 25417