Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 98; |
20 |
use Test::More tests => 100; |
21 |
|
21 |
|
22 |
use DateTime; |
22 |
use DateTime; |
23 |
|
23 |
|
Lines 455-461
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
455 |
$biblionumber |
455 |
$biblionumber |
456 |
); |
456 |
); |
457 |
my $datedue6 = AddIssue( $renewing_borrower, $barcode6); |
457 |
my $datedue6 = AddIssue( $renewing_borrower, $barcode6); |
458 |
is (defined $datedue6, 1, "Item 2 checked out, due date: $datedue6"); |
458 |
is (defined $datedue6, 1, "Item 2 checked out, due date: ".$datedue6->date_due); |
459 |
|
459 |
|
460 |
my $now = dt_from_string(); |
460 |
my $now = dt_from_string(); |
461 |
my $five_weeks = DateTime::Duration->new(weeks => 5); |
461 |
my $five_weeks = DateTime::Duration->new(weeks => 5); |
Lines 476-481
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
476 |
due => Koha::DateUtils::output_pref($five_weeks_ago) |
476 |
due => Koha::DateUtils::output_pref($five_weeks_ago) |
477 |
} |
477 |
} |
478 |
); |
478 |
); |
|
|
479 |
|
479 |
t::lib::Mocks::mock_preference('RenewalLog', 0); |
480 |
t::lib::Mocks::mock_preference('RenewalLog', 0); |
480 |
my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } ); |
481 |
my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } ); |
481 |
my $old_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } ); |
482 |
my $old_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } ); |
Lines 496-501
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
496 |
is( $fines->next->accounttype, 'F', 'Fine on renewed item is closed out properly' ); |
497 |
is( $fines->next->accounttype, 'F', 'Fine on renewed item is closed out properly' ); |
497 |
$fines->delete(); |
498 |
$fines->delete(); |
498 |
|
499 |
|
|
|
500 |
|
501 |
my $old_issue_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["ISSUE"]) } ); |
502 |
my $old_renew_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } ); |
503 |
AddIssue( $renewing_borrower,$barcode7,Koha::DateUtils::output_pref({str=>$datedue6->date_due, dateformat =>'iso'}),0,$date, 0, undef ); |
504 |
$new_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } ); |
505 |
is ($new_log_size, $old_renew_log_size + 1, 'renew log successfully added when renewed via issuing'); |
506 |
$new_log_size = scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["ISSUE"]) } ); |
507 |
is ($new_log_size, $old_issue_log_size, 'renew not logged as issue when renewed via issuing'); |
508 |
|
509 |
|
499 |
t::lib::Mocks::mock_preference('OverduesBlockRenewing','blockitem'); |
510 |
t::lib::Mocks::mock_preference('OverduesBlockRenewing','blockitem'); |
500 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber6); |
511 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber6); |
501 |
is( $renewokay, 1, '(Bug 8236), Can renew, this item is not overdue'); |
512 |
is( $renewokay, 1, '(Bug 8236), Can renew, this item is not overdue'); |
502 |
- |
|
|