@@ -, +, @@ renew logs --- C4/Circulation.pm | 4 +++- t/db_dependent/Circulation.t | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2908,7 +2908,7 @@ sub AddRenewal { DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); } - # Log the renewal + # Add the renewal to stats UpdateStats( { branch => C4::Context->userenv ? C4::Context->userenv->{branch} : $branch, @@ -2921,6 +2921,8 @@ sub AddRenewal { } ); + #Log the renewal + logaction("CIRCULATION", "RENEW", $itemnumber, ""); return $datedue; } --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -17,10 +17,10 @@ use Modern::Perl; -use Test::More tests => 91; +use Test::More tests => 92; BEGIN { - require_ok('C4::Circulation'); + use_ok('C4::Log') } use DateTime; @@ -473,7 +473,12 @@ C4::Context->dbh->do("DELETE FROM accountlines"); due => Koha::DateUtils::output_pref($five_weeks_ago) } ); + my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } ); + my $old_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } ); AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch ); + my $new_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } ); + is ($new_log_size -1, $old_log_size, 'renew log successfuly added'); + $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } ); is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' ); $fine->delete(); --