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

(-)a/C4/Accounts.pm (-98 / +171 lines)
Lines 26-31 use C4::Members; Link Here
26
use C4::Circulation qw(ReturnLostItem);
26
use C4::Circulation qw(ReturnLostItem);
27
use C4::Log qw(logaction);
27
use C4::Log qw(logaction);
28
use Koha::Account;
28
use Koha::Account;
29
use Koha::Account::Line;
30
use Koha::Account::Lines;
31
use Koha::Account::Offset;
29
32
30
use Data::Dumper qw(Dumper);
33
use Data::Dumper qw(Dumper);
31
34
Lines 118-150 EOT Link Here
118
121
119
=cut
122
=cut
120
123
124
=head2 chargelostitem
125
126
In a default install of Koha the following lost values are set
127
1 = Lost
128
2 = Long overdue
129
3 = Lost and paid for
130
131
FIXME: itemlost should be set to 3 after payment is made, should be a warning to the interface that a charge has been added
132
FIXME : if no replacement price, borrower just doesn't get charged?
133
134
=cut
135
121
sub chargelostitem{
136
sub chargelostitem{
122
# lost ==1 Lost, lost==2 longoverdue, lost==3 lost and paid for
123
# FIXME: itemlost should be set to 3 after payment is made, should be a warning to the interface that
124
# a charge has been added
125
# FIXME : if no replacement price, borrower just doesn't get charged?
126
    my $dbh = C4::Context->dbh();
137
    my $dbh = C4::Context->dbh();
127
    my ($borrowernumber, $itemnumber, $amount, $description) = @_;
138
    my ($borrowernumber, $itemnumber, $amount, $description) = @_;
128
139
129
    # first make sure the borrower hasn't already been charged for this item
140
    # first make sure the borrower hasn't already been charged for this item
130
    my $sth1=$dbh->prepare("SELECT * from accountlines
141
    my $existing_charges = Koha::Account::Lines->search(
131
    WHERE borrowernumber=? AND itemnumber=? and accounttype='L'");
142
        {
132
    $sth1->execute($borrowernumber,$itemnumber);
143
            borrowernumber => $borrowernumber,
133
    my $existing_charge_hashref=$sth1->fetchrow_hashref();
144
            itemnumber     => $itemnumber,
145
            accounttype    => 'L',
146
        }
147
    )->count();
134
148
135
    # OK, they haven't
149
    # OK, they haven't
136
    unless ($existing_charge_hashref) {
150
    unless ($existing_charges) {
137
        my $manager_id = 0;
151
        my $manager_id = 0;
138
        $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
152
        $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
139
        # This item is on issue ... add replacement cost to the borrower's record and mark it returned
153
        # This item is on issue ... add replacement cost to the borrower's record and mark it returned
140
        #  Note that we add this to the account even if there's no replacement price, allowing some other
154
        #  Note that we add this to the account even if there's no replacement price, allowing some other
141
        #  process (or person) to update it, since we don't handle any defaults for replacement prices.
155
        #  process (or person) to update it, since we don't handle any defaults for replacement prices.
142
        my $accountno = getnextacctno($borrowernumber);
156
        my $accountno = getnextacctno($borrowernumber);
143
        my $sth2=$dbh->prepare("INSERT INTO accountlines
157
144
        (borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber,manager_id)
158
        my $accountline = Koha::Account::Line->new(
145
        VALUES (?,?,now(),?,?,'L',?,?,?)");
159
            {
146
        $sth2->execute($borrowernumber,$accountno,$amount,
160
                borrowernumber    => $borrowernumber,
147
        $description,$amount,$itemnumber,$manager_id);
161
                accountno         => $accountno,
162
                date              => \'NOW()',
163
                amount            => $amount,
164
                description       => $description,
165
                accounttype       => 'L',
166
                amountoutstanding => $amount,
167
                itemnumber        => $itemnumber,
168
                manager_id        => $manager_id,
169
            }
170
        )->store();
171
172
        my $account_offset = Koha::Account::Offset->new(
173
            {
174
                debit_id => $accountline->id,
175
                type     => 'Lost Item',
176
                amount   => $amount,
177
            }
178
        )->store();
148
179
149
        if ( C4::Context->preference("FinesLog") ) {
180
        if ( C4::Context->preference("FinesLog") ) {
150
            logaction("FINES", 'CREATE', $borrowernumber, Dumper({
181
            logaction("FINES", 'CREATE', $borrowernumber, Dumper({
Lines 208-228 sub manualinvoice { Link Here
208
        $notifyid = 1;
239
        $notifyid = 1;
209
    }
240
    }
210
241
211
    if ( $itemnum ) {
242
    my $accountline = Koha::Account::Line->new(
212
        $desc .= ' ' . $itemnum;
243
        {
213
        my $sth = $dbh->prepare(
244
            borrowernumber    => $borrowernumber,
214
            'INSERT INTO  accountlines
245
            accountno         => $accountno,
215
                        (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id, note, manager_id)
246
            date              => \'NOW()',
216
        VALUES (?, ?, now(), ?,?, ?,?,?,?,?,?)');
247
            amount            => $amount,
217
     $sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum,$notifyid, $note, $manager_id) || return $sth->errstr;
248
            description       => $desc,
218
  } else {
249
            accounttype       => $type,
219
    my $sth=$dbh->prepare("INSERT INTO  accountlines
250
            amountoutstanding => $amountleft,
220
            (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding,notify_id, note, manager_id)
251
            itemnumber        => $itemnum || undef,
221
            VALUES (?, ?, now(), ?, ?, ?, ?,?,?,?)"
252
            notify_id         => $notifyid,
222
        );
253
            note              => $note,
223
        $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type,
254
            manager_id        => $manager_id,
224
            $amountleft, $notifyid, $note, $manager_id );
255
        }
225
    }
256
    )->store();
257
258
    my $account_offset = Koha::Account::Offset->new(
259
        {
260
            debit_id => $accountline->id,
261
            type     => 'Manual Debit',
262
            amount   => $amount,
263
        }
264
    )->store();
226
265
227
    if ( C4::Context->preference("FinesLog") ) {
266
    if ( C4::Context->preference("FinesLog") ) {
228
        logaction("FINES", 'CREATE',$borrowernumber,Dumper({
267
        logaction("FINES", 'CREATE',$borrowernumber,Dumper({
Lines 308-352 sub getrefunds { Link Here
308
    return (@results);
347
    return (@results);
309
}
348
}
310
349
350
#FIXME: ReversePayment should be replaced with a Void Payment feature
311
sub ReversePayment {
351
sub ReversePayment {
312
    my ( $accountlines_id ) = @_;
352
    my ($accountlines_id) = @_;
313
    my $dbh = C4::Context->dbh;
353
    my $dbh = C4::Context->dbh;
314
354
315
    my $sth = $dbh->prepare('SELECT * FROM accountlines WHERE accountlines_id = ?');
355
    my $accountline        = Koha::Account::Lines->find($accountlines_id);
316
    $sth->execute( $accountlines_id );
356
    my $amount_outstanding = $accountline->amountoutstanding;
317
    my $row = $sth->fetchrow_hashref();
357
318
    my $amount_outstanding = $row->{'amountoutstanding'};
358
    my $new_amountoutstanding =
319
359
      $amount_outstanding <= 0 ? $accountline->amount * -1 : 0;
320
    if ( $amount_outstanding <= 0 ) {
360
321
        $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = amount * -1, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?');
361
    $accountline->description( $accountline->description . " Reversed -" );
322
        $sth->execute( $accountlines_id );
362
    $accountline->amountoutstanding($new_amountoutstanding);
323
    } else {
363
    $accountline->store();
324
        $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = 0, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?');
364
325
        $sth->execute( $accountlines_id );
365
    my $account_offset = Koha::Account::Offset->new(
326
    }
366
        {
367
            credit_id => $accountline->id,
368
            type      => 'Reverse Payment',
369
            amount    => $amount_outstanding - $new_amountoutstanding,
370
        }
371
    )->store();
327
372
328
    if ( C4::Context->preference("FinesLog") ) {
373
    if ( C4::Context->preference("FinesLog") ) {
329
        my $manager_id = 0;
374
        my $manager_id = 0;
330
        $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
375
        $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
331
376
332
        if ( $amount_outstanding <= 0 ) {
377
        logaction(
333
            $row->{'amountoutstanding'} *= -1;
378
            "FINES", 'MODIFY',
334
        } else {
379
            $accountline->borrowernumber,
335
            $row->{'amountoutstanding'} = '0';
380
            Dumper(
336
        }
381
                {
337
        $row->{'description'} .= ' Reversed -';
382
                    action                => 'reverse_fee_payment',
338
        logaction("FINES", 'MODIFY', $row->{'borrowernumber'}, Dumper({
383
                    borrowernumber        => $accountline->borrowernumber,
339
            action                => 'reverse_fee_payment',
384
                    old_amountoutstanding => $amount_outstanding,
340
            borrowernumber        => $row->{'borrowernumber'},
385
                    new_amountoutstanding => $new_amountoutstanding,
341
            old_amountoutstanding => $row->{'amountoutstanding'},
386
                    ,
342
            new_amountoutstanding => 0 - $amount_outstanding,,
387
                    accountlines_id => $accountline->id,
343
            accountlines_id       => $row->{'accountlines_id'},
388
                    accountno       => $accountline->accountno,
344
            accountno             => $row->{'accountno'},
389
                    manager_id      => $manager_id,
345
            manager_id            => $manager_id,
390
                }
346
        }));
391
            )
347
392
        );
348
    }
393
    }
349
350
}
394
}
351
395
352
=head2 WriteOffFee
396
=head2 WriteOffFee
Lines 366-425 C<$payment_note> is the note to attach to this payment Link Here
366
410
367
sub WriteOffFee {
411
sub WriteOffFee {
368
    my ( $borrowernumber, $accountlines_id, $itemnum, $accounttype, $amount, $branch, $payment_note ) = @_;
412
    my ( $borrowernumber, $accountlines_id, $itemnum, $accounttype, $amount, $branch, $payment_note ) = @_;
413
369
    $payment_note //= "";
414
    $payment_note //= "";
370
    $branch ||= C4::Context->userenv->{branch};
371
    my $manager_id = 0;
415
    my $manager_id = 0;
372
    $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
416
417
    if ( C4::Context->userenv ) {
418
        $manager_id = C4::Context->userenv->{number};
419
        $branch ||= C4::Context->userenv->{branch};
420
    }
373
421
374
    # if no item is attached to fine, make sure to store it as a NULL
422
    # if no item is attached to fine, make sure to store it as a NULL
375
    $itemnum ||= undef;
423
    $itemnum ||= undef;
376
424
377
    my ( $sth, $query );
425
    my $accountline = Koha::Account::Lines->find($accountlines_id);
378
    my $dbh = C4::Context->dbh();
426
    return unless $accountline;
379
427
    $accountline->amountoutstanding(0);
380
    $query = "
428
    $accountline->store();
381
        UPDATE accountlines SET amountoutstanding = 0
382
        WHERE accountlines_id = ? AND borrowernumber = ?
383
    ";
384
    $sth = $dbh->prepare( $query );
385
    $sth->execute( $accountlines_id, $borrowernumber );
386
429
387
    if ( C4::Context->preference("FinesLog") ) {
430
    if ( C4::Context->preference("FinesLog") ) {
388
        logaction("FINES", 'MODIFY', $borrowernumber, Dumper({
431
        logaction(
389
            action                => 'fee_writeoff',
432
            "FINES", 'MODIFY',
390
            borrowernumber        => $borrowernumber,
433
            $borrowernumber,
391
            accountlines_id       => $accountlines_id,
434
            Dumper(
392
            manager_id            => $manager_id,
435
                {
393
        }));
436
                    action          => 'fee_writeoff',
437
                    borrowernumber  => $borrowernumber,
438
                    accountlines_id => $accountlines_id,
439
                    manager_id      => $manager_id,
440
                }
441
            )
442
        );
394
    }
443
    }
395
444
396
    $query ="
397
        INSERT INTO accountlines
398
        ( borrowernumber, accountno, itemnumber, date, amount, description, accounttype, manager_id, note )
399
        VALUES ( ?, ?, ?, NOW(), ?, 'Writeoff', 'W', ?, ? )
400
    ";
401
    $sth = $dbh->prepare( $query );
402
    my $acct = getnextacctno($borrowernumber);
445
    my $acct = getnextacctno($borrowernumber);
403
    $sth->execute( $borrowernumber, $acct, $itemnum, $amount, $manager_id, $payment_note );
446
447
    my $writeoff = Koha::Account::Line->new(
448
        {
449
            borrowernumber => $borrowernumber,
450
            accountno      => $acct,
451
            itemnumber     => $itemnum || undef,
452
            date           => \'NOW()',
453
            amount         => $amount * -1,
454
            description    => 'Writeoff',
455
            accounttype    => 'W',
456
            manager_id     => $manager_id,
457
            note           => $payment_note,
458
        }
459
    )->store();
460
461
    Koha::Account::Offset->new(
462
        {
463
            debit_id  => $accountline->id,
464
            credit_id => $writeoff->id,
465
            type      => 'Writeoff',
466
            amount    => $amount * -1,
467
        }
468
    )->store();
404
469
405
    if ( C4::Context->preference("FinesLog") ) {
470
    if ( C4::Context->preference("FinesLog") ) {
406
        logaction("FINES", 'CREATE',$borrowernumber,Dumper({
471
        logaction(
407
            action            => 'create_writeoff',
472
            "FINES", 'CREATE',
408
            borrowernumber    => $borrowernumber,
473
            $borrowernumber,
409
            accountno         => $acct,
474
            Dumper(
410
            amount            => 0 - $amount,
475
                {
411
            accounttype       => 'W',
476
                    action            => 'create_writeoff',
412
            itemnumber        => $itemnum,
477
                    borrowernumber    => $borrowernumber,
413
            accountlines_paid => [ $accountlines_id ],
478
                    accountno         => $acct,
414
            manager_id        => $manager_id,
479
                    amount            => 0 - $amount,
415
        }));
480
                    accounttype       => 'W',
481
                    itemnumber        => $itemnum,
482
                    accountlines_paid => [$accountlines_id],
483
                    manager_id        => $manager_id,
484
                }
485
            )
486
        );
416
    }
487
    }
417
488
418
    UpdateStats({
489
    UpdateStats(
419
                branch => $branch,
490
        {
420
                type => 'writeoff',
491
            branch         => $branch,
421
                amount => $amount,
492
            type           => 'writeoff',
422
                borrowernumber => $borrowernumber}
493
            amount         => $amount,
494
            borrowernumber => $borrowernumber
495
        }
423
    );
496
    );
424
497
425
}
498
}
(-)a/C4/Circulation.pm (-23 / +52 lines)
Lines 56-61 use Koha::Libraries; Link Here
56
use Koha::Holds;
56
use Koha::Holds;
57
use Koha::RefundLostItemFeeRule;
57
use Koha::RefundLostItemFeeRule;
58
use Koha::RefundLostItemFeeRules;
58
use Koha::RefundLostItemFeeRules;
59
use Koha::Account::Lines;
60
use Koha::Account::Line;
61
use Koha::Account::Offset;
59
use Carp;
62
use Carp;
60
use List::MoreUtils qw( uniq );
63
use List::MoreUtils qw( uniq );
61
use Scalar::Util qw( looks_like_number );
64
use Scalar::Util qw( looks_like_number );
Lines 2451-2489 sub _FixOverduesOnReturn { Link Here
2451
    my $dbh = C4::Context->dbh;
2454
    my $dbh = C4::Context->dbh;
2452
2455
2453
    # check for overdue fine
2456
    # check for overdue fine
2454
    my $sth = $dbh->prepare(
2457
    my $accountline = Koha::Account::Lines->search(
2455
"SELECT * FROM accountlines WHERE (borrowernumber = ?) AND (itemnumber = ?) AND (accounttype='FU' OR accounttype='O')"
2458
        {
2456
    );
2459
            borrowernumber => $borrowernumber,
2457
    $sth->execute( $borrowernumber, $item );
2460
            itemnumber     => $item,
2458
2461
            -or            => [
2459
    # alter fine to show that the book has been returned
2462
                accounttype => 'FU',
2460
    my $data = $sth->fetchrow_hashref;
2463
                accounttype => 'O',
2461
    return 0 unless $data;    # no warning, there's just nothing to fix
2464
            ],
2465
        }
2466
    )->next();
2467
    return 0 unless $accountline;    # no warning, there's just nothing to fix
2462
2468
2463
    my $uquery;
2469
    my $uquery;
2464
    my @bind = ($data->{'accountlines_id'});
2465
    if ($exemptfine) {
2470
    if ($exemptfine) {
2466
        $uquery = "update accountlines set accounttype='FFOR', amountoutstanding=0";
2471
        my $amountoutstanding = $accountline->amountoutstanding;
2472
2473
        $accountline->accounttype('FFOR');
2474
        $accountline->amountoutstanding(0);
2475
2476
        Koha::Account::Offset->new(
2477
            {
2478
                debit_id => $accountline->id,
2479
                type => 'Forgiven',
2480
                amount => $amountoutstanding * -1,
2481
            }
2482
        );
2483
2467
        if (C4::Context->preference("FinesLog")) {
2484
        if (C4::Context->preference("FinesLog")) {
2468
            &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2485
            &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2469
        }
2486
        }
2470
    } elsif ($dropbox && $data->{lastincrement}) {
2487
    } elsif ($dropbox && $accountline->lastincrement) {
2471
        my $outstanding = $data->{amountoutstanding} - $data->{lastincrement} ;
2488
        my $outstanding = $accountline->amountoutstanding - $accountline->lastincrement;
2472
        my $amt = $data->{amount} - $data->{lastincrement} ;
2489
        my $amt = $accountline->amount - $accountline->lastincrement;
2473
        if (C4::Context->preference("FinesLog")) {
2490
2474
            &logaction("FINES", 'MODIFY',$borrowernumber,"Dropbox adjustment $amt, item $item");
2491
        Koha::Account::Offset->new(
2492
            {
2493
                debit_id => $accountline->id,
2494
                type => 'Dropbox',
2495
                amount => $accountline->lastincrement * -1,
2496
            }
2497
        );
2498
2499
        if ( C4::Context->preference("FinesLog") ) {
2500
            &logaction( "FINES", 'MODIFY', $borrowernumber,
2501
                "Dropbox adjustment $amt, item $item" );
2475
        }
2502
        }
2476
         $uquery = "update accountlines set accounttype='F' ";
2503
2477
         if($outstanding  >= 0 && $amt >=0) {
2504
        $accountline->accounttype('F');
2478
            $uquery .= ", amount = ? , amountoutstanding=? ";
2505
2479
            unshift @bind, ($amt, $outstanding) ;
2506
        if ( $outstanding >= 0 && $amt >= 0 ) {
2507
            $accountline->amount($amt);
2508
            $accountline->amountoutstanding($outstanding);
2480
        }
2509
        }
2510
2481
    } else {
2511
    } else {
2482
        $uquery = "update accountlines set accounttype='F' ";
2512
        $accountline->accounttype('F');
2483
    }
2513
    }
2484
    $uquery .= " where (accountlines_id = ?)";
2514
2485
    my $usth = $dbh->prepare($uquery);
2515
    return $accountline->store();
2486
    return $usth->execute(@bind);
2487
}
2516
}
2488
2517
2489
=head2 _FixAccountForLostAndReturned
2518
=head2 _FixAccountForLostAndReturned
(-)a/C4/Overdues.pm (+17 lines)
Lines 36-41 use C4::Debug; Link Here
36
use Koha::DateUtils;
36
use Koha::DateUtils;
37
use Koha::Account::Line;
37
use Koha::Account::Line;
38
use Koha::Account::Lines;
38
use Koha::Account::Lines;
39
use Koha::Account::Offset;
39
40
40
use vars qw(@ISA @EXPORT);
41
use vars qw(@ISA @EXPORT);
41
42
Lines 590-595 sub UpdateFine { Link Here
590
                    accounttype   => 'FU',
591
                    accounttype   => 'FU',
591
                }
592
                }
592
            )->store();
593
            )->store();
594
595
            Koha::Account::Offset->new(
596
                {
597
                    debit_id => $accountline->id,
598
                    type     => 'Fine Update',
599
                    amount   => $diff,
600
                }
601
            )->store();
593
        }
602
        }
594
    } else {
603
    } else {
595
        if ( $amount ) { # Don't add new fines with an amount of 0
604
        if ( $amount ) { # Don't add new fines with an amount of 0
Lines 617-622 sub UpdateFine { Link Here
617
                    issue_id          => $issue_id,
626
                    issue_id          => $issue_id,
618
                }
627
                }
619
            )->store();
628
            )->store();
629
630
            Koha::Account::Offset->new(
631
                {
632
                    debit_id => $accountline->id,
633
                    type     => 'Fine',
634
                    amount   => $amount,
635
                }
636
            )->store();
620
        }
637
        }
621
    }
638
    }
622
    # logging action
639
    # logging action
(-)a/Koha/Account.pm (-1 / +26 lines)
Lines 27-32 use C4::Stats qw( UpdateStats ); Link Here
27
27
28
use Koha::Account::Line;
28
use Koha::Account::Line;
29
use Koha::Account::Lines;
29
use Koha::Account::Lines;
30
use Koha::Account::Offset;
30
use Koha::DateUtils qw( dt_from_string );
31
use Koha::DateUtils qw( dt_from_string );
31
32
32
=head1 NAME
33
=head1 NAME
Lines 89-94 sub pay { Link Here
89
    my $balance_remaining = $amount; # Set it now so we can adjust the amount if necessary
90
    my $balance_remaining = $amount; # Set it now so we can adjust the amount if necessary
90
    $balance_remaining ||= 0;
91
    $balance_remaining ||= 0;
91
92
93
    my @account_offsets;
94
92
    # We were passed a specific line to pay
95
    # We were passed a specific line to pay
93
    foreach my $fine ( @$lines ) {
96
    foreach my $fine ( @$lines ) {
94
        # If accountline id is passed but no amount, we pay that line in full
97
        # If accountline id is passed but no amount, we pay that line in full
Lines 99-104 sub pay { Link Here
99
        $fine->amountoutstanding( $new_amountoutstanding )->store();
102
        $fine->amountoutstanding( $new_amountoutstanding )->store();
100
        $balance_remaining = $balance_remaining - $amount;
103
        $balance_remaining = $balance_remaining - $amount;
101
104
105
        my $account_offset = Koha::Account::Offset->new(
106
            {
107
                debit_id => $fine->id,
108
                type     => 'Payment',
109
                amount   => $amount * -1,
110
            }
111
        );
112
        push( @account_offsets, $account_offset );
113
102
        if ( $fine->accounttype eq 'Rep' || $fine->accounttype eq 'L' )
114
        if ( $fine->accounttype eq 'Rep' || $fine->accounttype eq 'L' )
103
        {
115
        {
104
            C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber );
116
            C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber );
Lines 147-152 sub pay { Link Here
147
        $fine->amountoutstanding( $old_amountoutstanding - $amount_to_pay );
159
        $fine->amountoutstanding( $old_amountoutstanding - $amount_to_pay );
148
        $fine->store();
160
        $fine->store();
149
161
162
        my $account_offset = Koha::Account::Offset->new(
163
            {
164
                debit_id => $fine->id,
165
                type     => 'Payment',
166
                amount   => $amount_to_pay * -1,
167
            }
168
        );
169
        push( @account_offsets, $account_offset );
170
150
        if ( C4::Context->preference("FinesLog") ) {
171
        if ( C4::Context->preference("FinesLog") ) {
151
            logaction(
172
            logaction(
152
                "FINES", 'MODIFY',
173
                "FINES", 'MODIFY',
Lines 188-193 sub pay { Link Here
188
        }
209
        }
189
    )->store();
210
    )->store();
190
211
212
    foreach my $o ( @account_offsets ) {
213
        $o->credit_id( $payment->id() );
214
        $o->store();
215
    }
216
191
    $library_id ||= $userenv ? $userenv->{'branch'} : undef;
217
    $library_id ||= $userenv ? $userenv->{'branch'} : undef;
192
218
193
    UpdateStats(
219
    UpdateStats(
194
- 

Return to bug 14826