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

(-)a/C4/Circulation.pm (-6 / +8 lines)
Lines 2021-2027 sub AddReturn { Link Here
2021
2021
2022
    # fix up the overdues in accounts...
2022
    # fix up the overdues in accounts...
2023
    if ($borrowernumber) {
2023
    if ($borrowernumber) {
2024
        my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine );
2024
        my $fix = _FixOverduesOnReturn( $borrowernumber, $item->itemnumber, $exemptfine, 'RETURNED' );
2025
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->itemnumber...) failed!";  # zero is OK, check defined
2025
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->itemnumber...) failed!";  # zero is OK, check defined
2026
2026
2027
        if ( $issue and $issue->is_overdue ) {
2027
        if ( $issue and $issue->is_overdue ) {
Lines 2305-2311 sub _debar_user_on_return { Link Here
2305
2305
2306
=head2 _FixOverduesOnReturn
2306
=head2 _FixOverduesOnReturn
2307
2307
2308
   &_FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine);
2308
   &_FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $status);
2309
2309
2310
C<$borrowernumber> borrowernumber
2310
C<$borrowernumber> borrowernumber
2311
2311
Lines 2313-2324 C<$itemnumber> itemnumber Link Here
2313
2313
2314
C<$exemptfine> BOOL -- remove overdue charge associated with this issue. 
2314
C<$exemptfine> BOOL -- remove overdue charge associated with this issue. 
2315
2315
2316
C<$status> ENUM -- reason for fix [ RETURNED, RENEWED, LOST, FORGIVEN ]
2317
2316
Internal function
2318
Internal function
2317
2319
2318
=cut
2320
=cut
2319
2321
2320
sub _FixOverduesOnReturn {
2322
sub _FixOverduesOnReturn {
2321
    my ( $borrowernumber, $item, $exemptfine ) = @_;
2323
    my ( $borrowernumber, $item, $exemptfine, $status ) = @_;
2322
    unless( $borrowernumber ) {
2324
    unless( $borrowernumber ) {
2323
        warn "_FixOverduesOnReturn() not supplied valid borrowernumber";
2325
        warn "_FixOverduesOnReturn() not supplied valid borrowernumber";
2324
        return;
2326
        return;
Lines 2363-2369 sub _FixOverduesOnReturn { Link Here
2363
            &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2365
            &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item");
2364
        }
2366
        }
2365
    } else {
2367
    } else {
2366
        $accountline->status('RETURNED');
2368
        $accountline->status($status);
2367
    }
2369
    }
2368
2370
2369
    return $accountline->store();
2371
    return $accountline->store();
Lines 2845-2851 sub AddRenewal { Link Here
2845
    if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) {
2847
    if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) {
2846
        _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } );
2848
        _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } );
2847
    }
2849
    }
2848
    _FixOverduesOnReturn( $borrowernumber, $itemnumber );
2850
    _FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' );
2849
2851
2850
    # If the due date wasn't specified, calculate it by adding the
2852
    # If the due date wasn't specified, calculate it by adding the
2851
    # book's loan length to today's date or the current due date
2853
    # book's loan length to today's date or the current due date
Lines 3690-3696 sub LostItem{ Link Here
3690
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3692
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3691
        my $patron = Koha::Patrons->find( $borrowernumber );
3693
        my $patron = Koha::Patrons->find( $borrowernumber );
3692
3694
3693
        my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, C4::Context->preference('WhenLostForgiveFine'), 0); # 1, 0 = exemptfine, no-dropbox
3695
        my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, C4::Context->preference('WhenLostForgiveFine'), 'LOST');
3694
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3696
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3695
3697
3696
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
3698
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (+1 lines)
Lines 43-48 Link Here
43
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
43
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
44
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
44
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
45
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
45
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
46
        [%- CASE 'LOST'       -%]<span> (Lost)</span>
46
        [%- CASE              -%]
47
        [%- CASE              -%]
47
    [%- END -%]
48
    [%- END -%]
48
[%- END -%]
49
[%- END -%]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (-1 / +1 lines)
Lines 121-126 Link Here
121
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
121
        [%- CASE 'REPLACED'   -%]<span> (Replaced)</span>
122
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
122
        [%- CASE 'FORGIVEN'   -%]<span> (Forgiven)</span>
123
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
123
        [%- CASE 'VOID'       -%]<span> (Voided)</span>
124
        [%- CASE 'LOST'       -%]<span> (Lost)</span>
124
        [%- CASE              -%]
125
        [%- CASE              -%]
125
    [%- END -%]
126
    [%- END -%]
126
[%- END -%]
127
[%- END -%]
127
- 

Return to bug 22563