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

(-)a/C4/Circulation.pm (-4 / +2 lines)
Lines 1953-1969 sub AddReturn { Link Here
1953
1953
1954
    # case of a return of document (deal with issues and holdingbranch)
1954
    # case of a return of document (deal with issues and holdingbranch)
1955
    if ($doreturn) {
1955
    if ($doreturn) {
1956
        my $is_overdue;
1957
        die "The item is not issed and cannot be returned" unless $issue; # Just in case...
1956
        die "The item is not issed and cannot be returned" unless $issue; # Just in case...
1958
        $patron or warn "AddReturn without current borrower";
1957
        $patron or warn "AddReturn without current borrower";
1959
        $is_overdue = $issue->is_overdue( $return_date );
1960
1958
1961
        if ($patron) {
1959
        if ($patron) {
1962
            eval {
1960
            eval {
1963
                MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy );
1961
                MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy );
1964
            };
1962
            };
1965
            unless ( $@ ) {
1963
            unless ( $@ ) {
1966
                if ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue && !$item->itemlost ) {
1964
                if ( C4::Context->preference('CalculateFinesOnReturn') && !$item->itemlost ) {
1967
                    _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } );
1965
                    _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } );
1968
                }
1966
                }
1969
            } else {
1967
            } else {
Lines 2890-2896 sub AddRenewal { Link Here
2890
    my $schema = Koha::Database->schema;
2888
    my $schema = Koha::Database->schema;
2891
    $schema->txn_do(sub{
2889
    $schema->txn_do(sub{
2892
2890
2893
        if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) {
2891
        if ( C4::Context->preference('CalculateFinesOnReturn') ) {
2894
            _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } );
2892
            _CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } );
2895
        }
2893
        }
2896
        _FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' );
2894
        _FixOverduesOnReturn( $borrowernumber, $itemnumber, undef, 'RENEWED' );
(-)a/C4/Overdues.pm (-1 / +4 lines)
Lines 232-237 or "Final Notice". But CalcFine never defined any value. Link Here
232
232
233
sub CalcFine {
233
sub CalcFine {
234
    my ( $item, $bortype, $branchcode, $due_dt, $end_date  ) = @_;
234
    my ( $item, $bortype, $branchcode, $due_dt, $end_date  ) = @_;
235
236
    # Skip calculations if item is not overdue
237
    return ( 0, 0, 0 ) unless (DateTime->compare( $due_dt, $end_date ) == -1);
238
235
    my $start_date = $due_dt->clone();
239
    my $start_date = $due_dt->clone();
236
    # get issuingrules (fines part will be used)
240
    # get issuingrules (fines part will be used)
237
    my $itemtype = $item->{itemtype} || $item->{itype};
241
    my $itemtype = $item->{itemtype} || $item->{itype};
238
- 

Return to bug 24075