use Modern::Perl;
-use Test::More tests => 98;
+use Test::More tests => 100;
use DateTime;
$biblionumber
);
my $datedue6 = AddIssue( $renewing_borrower, $barcode6);
- is (defined $datedue6, 1, "Item 2 checked out, due date: $datedue6");
+ is (defined $datedue6, 1, "Item 2 checked out, due date: ".$datedue6->date_due);
my $now = dt_from_string();
my $five_weeks = DateTime::Duration->new(weeks => 5);
due => Koha::DateUtils::output_pref($five_weeks_ago)
}
);
+
t::lib::Mocks::mock_preference('RenewalLog', 0);
my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } );
my $old_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
is( $fines->next->accounttype, 'F', 'Fine on renewed item is closed out properly' );
$fines->delete();
+
+ my $old_issue_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["ISSUE"]) } );
+ my $old_renew_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
+ AddIssue( $renewing_borrower,$barcode7,Koha::DateUtils::output_pref({str=>$datedue6->date_due, dateformat =>'iso'}),0,$date, 0, undef );
+ $new_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
+ is ($new_log_size, $old_renew_log_size + 1, 'renew log successfully added when renewed via issuing');
+ $new_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["ISSUE"]) } );
+ is ($new_log_size, $old_issue_log_size, 'renew not logged as issue when renewed via issuing');
+
+
t::lib::Mocks::mock_preference('OverduesBlockRenewing','blockitem');
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber6);
is( $renewokay, 1, '(Bug 8236), Can renew, this item is not overdue');