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

(-)a/t/db_dependent/Circulation.t (-3 / +12 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 96;
20
use Test::More tests => 98;
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 489-494 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
489
    $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
489
    $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
490
    is ($new_log_size, $old_log_size + 1, 'renew log successfully added');
490
    is ($new_log_size, $old_log_size + 1, 'renew log successfully added');
491
491
492
    my $old_issue_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["ISSUE"]) } );
493
    my $old_renew_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
494
    print $datedue6->date_due."\n";
495
    AddIssue( $renewing_borrower,$barcode7,Koha::DateUtils::output_pref({str=>$datedue6->date_due, dateformat =>'iso'}),0,$date, 0, undef );
496
    $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEWAL"]) } );
497
    is ($new_log_size, $old_renew_log_size + 1, 'renew log successfully added when renewed via issuing');
498
    $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["ISSUE"]) } );
499
    is ($new_log_size, $old_issue_log_size, 'renew not logged as issue when renewed via issuing');
500
501
492
502
493
    $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } );
503
    $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } );
494
    is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' );
504
    is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' );
495
- 

Return to bug 19076