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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 2922-2928 sub AddRenewal { Link Here
2922
    );
2922
    );
2923
2923
2924
    #Log the renewal
2924
    #Log the renewal
2925
    logaction("CIRCULATION", "RENEW", $borrowernumber, $itemnumber) if C4::Context->preference("RenewalLog");
2925
    logaction("CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber) if C4::Context->preference("RenewalLog");
2926
    return $datedue;
2926
    return $datedue;
2927
}
2927
}
2928
2928
(-)a/t/db_dependent/Circulation.t (-5 / +4 lines)
Lines 472-487 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
472
    );
472
    );
473
    t::lib::Mocks::mock_preference('RenewalLog', 0);
473
    t::lib::Mocks::mock_preference('RenewalLog', 0);
474
    my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } );
474
    my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } );
475
    my $old_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } );
475
    my $old_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
476
    AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch );
476
    AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch );
477
    my $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } );
477
    my $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
478
    is ($new_log_size, $old_log_size, 'renew log not added because of the syspref RenewalLog');
478
    is ($new_log_size, $old_log_size, 'renew log not added because of the syspref RenewalLog');
479
479
480
    t::lib::Mocks::mock_preference('RenewalLog', 1);
480
    t::lib::Mocks::mock_preference('RenewalLog', 1);
481
    $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } );
481
    $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } );
482
    $old_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } );
482
    $old_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
483
    AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch );
483
    AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch );
484
    $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } );
484
    $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
485
    is ($new_log_size, $old_log_size + 1, 'renew log successfully added');
485
    is ($new_log_size, $old_log_size + 1, 'renew log successfully added');
486
486
487
487
488
- 

Return to bug 17708