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

(-)a/C4/Circulation.pm (-6 / +12 lines)
Lines 2031-2037 sub AddReturn { Link Here
2031
2031
2032
    # fix up the overdues in accounts...
2032
    # fix up the overdues in accounts...
2033
    if ($borrowernumber) {
2033
    if ($borrowernumber) {
2034
        my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine );
2034
        my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine, 'RETURNED' );
2035
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->itemnumber...) failed!";  # zero is OK, check defined
2035
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->itemnumber...) failed!";  # zero is OK, check defined
2036
2036
2037
        if ( $issue and $issue->is_overdue ) {
2037
        if ( $issue and $issue->is_overdue ) {
Lines 2315-2321 sub _debar_user_on_return { Link Here
2315
2315
2316
=head2 _FixOverduesOnReturn
2316
=head2 _FixOverduesOnReturn
2317
2317
2318
   &_FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine);
2318
   &_FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $status);
2319
2319
2320
C<$borrowernumber> borrowernumber
2320
C<$borrowernumber> borrowernumber
2321
2321
Lines 2323-2334 C<$itemnumber> itemnumber Link Here
2323
2323
2324
C<$exemptfine> BOOL -- remove overdue charge associated with this issue. 
2324
C<$exemptfine> BOOL -- remove overdue charge associated with this issue. 
2325
2325
2326
C<$status> ENUM -- reason for fix [ RETURNED, RENEWED, LOST, FORGIVEN ]
2327
2326
Internal function
2328
Internal function
2327
2329
2328
=cut
2330
=cut
2329
2331
2330
sub _FixOverduesOnReturn {
2332
sub _FixOverduesOnReturn {
2331
    my ( $borrowernumber, $item, $exemptfine ) = @_;
2333
    my ( $borrowernumber, $item, $exemptfine, $status ) = @_;
2332
    unless( $borrowernumber ) {
2334
    unless( $borrowernumber ) {
2333
        warn "_FixOverduesOnReturn() not supplied valid borrowernumber";
2335
        warn "_FixOverduesOnReturn() not supplied valid borrowernumber";
2334
        return;
2336
        return;
Lines 2337-2342 sub _FixOverduesOnReturn { Link Here
2337
        warn "_FixOverduesOnReturn() not supplied valid itemnumber";
2339
        warn "_FixOverduesOnReturn() not supplied valid itemnumber";
2338
        return;
2340
        return;
2339
    }
2341
    }
2342
    unless( $status ) {
2343
        warn "_FixOverduesOnReturn() not supplied valid status";
2344
        return;
2345
    }
2340
2346
2341
    my $schema = Koha::Database->schema;
2347
    my $schema = Koha::Database->schema;
2342
2348
Lines 2377-2383 sub _FixOverduesOnReturn { Link Here
2377
                    &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2383
                    &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2378
                }
2384
                }
2379
            } else {
2385
            } else {
2380
                $accountline->status('RETURNED');
2386
                $accountline->status($status);
2381
            }
2387
            }
2382
2388
2383
            return $accountline->store();
2389
            return $accountline->store();
Lines 2868-2874 sub AddRenewal { Link Here
2868
    if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) {
2874
    if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) {
2869
        _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } );
2875
        _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } );
2870
    }
2876
    }
2871
    _FixOverduesOnReturn( $borrowernumber, $itemnumber );
2877
    _FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' );
2872
2878
2873
    # If the due date wasn't specified, calculate it by adding the
2879
    # If the due date wasn't specified, calculate it by adding the
2874
    # book's loan length to today's date or the current due date
2880
    # book's loan length to today's date or the current due date
Lines 3713-3719 sub LostItem{ Link Here
3713
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3719
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3714
        my $patron = Koha::Patrons->find( $borrowernumber );
3720
        my $patron = Koha::Patrons->find( $borrowernumber );
3715
3721
3716
        my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, C4::Context->preference('WhenLostForgiveFine'), 0); # 1, 0 = exemptfine, no-dropbox
3722
        my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, C4::Context->preference('WhenLostForgiveFine'), 'LOST');
3717
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3723
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3718
3724
3719
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
3725
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (+1 lines)
Lines 44-49 Link Here
44
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
44
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
45
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
45
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
46
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
46
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
47
        [%- CASE 'LOST'       -%]<span> (Lost)</span>
47
        [%- CASE              -%]
48
        [%- CASE              -%]
48
    [%- END -%]
49
    [%- END -%]
49
[%- END -%]
50
[%- END -%]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (-1 / +1 lines)
Lines 150-155 Link Here
150
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
150
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
151
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
151
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
152
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
152
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
153
        [%- CASE 'LOST'       -%]<span> (Lost)</span>
153
        [%- CASE              -%]
154
        [%- CASE              -%]
154
    [%- END -%]
155
    [%- END -%]
155
[%- END -%]
156
[%- END -%]
156
- 

Return to bug 22563