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

(-)a/t/db_dependent/Circulation.t (-3 / +2 lines)
Lines 775-781 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
775
        my $ten_days_before = dt_from_string->add( days => -10 );
775
        my $ten_days_before = dt_from_string->add( days => -10 );
776
        my $ten_days_ahead  = dt_from_string->add( days => 10 );
776
        my $ten_days_ahead  = dt_from_string->add( days => 10 );
777
        AddIssue( $renewing_borrower, $item_to_auto_renew->{barcode}, $ten_days_ahead, undef, $ten_days_before, undef, { auto_renew => 1 } );
777
        AddIssue( $renewing_borrower, $item_to_auto_renew->{barcode}, $ten_days_ahead, undef, $ten_days_before, undef, { auto_renew => 1 } );
778
        $dbh->do('UPDATE issuingrules SET norenewalbefore = 7, no_auto_renewal_after = "", no_auto_renewal_after_hard_limit = NULL');
778
        $dbh->do('UPDATE issuingrules SET norenewalbefore = 7, no_auto_renewal_after = NULL, no_auto_renewal_after_hard_limit = NULL');
779
        my $latest_auto_renew_date = GetLatestAutoRenewDate( $renewing_borrowernumber, $item_to_auto_renew->{itemnumber} );
779
        my $latest_auto_renew_date = GetLatestAutoRenewDate( $renewing_borrowernumber, $item_to_auto_renew->{itemnumber} );
780
        is( $latest_auto_renew_date, undef, 'GetLatestAutoRenewDate should return undef if no_auto_renewal_after or no_auto_renewal_after_hard_limit are not defined' );
780
        is( $latest_auto_renew_date, undef, 'GetLatestAutoRenewDate should return undef if no_auto_renewal_after or no_auto_renewal_after_hard_limit are not defined' );
781
        my $five_days_before = dt_from_string->add( days => -5 );
781
        my $five_days_before = dt_from_string->add( days => -5 );
Lines 793-799 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
793
            'GetLatestAutoRenewDate should return +5 days if no_auto_renewal_after = 15 and date_due is 10 days before'
793
            'GetLatestAutoRenewDate should return +5 days if no_auto_renewal_after = 15 and date_due is 10 days before'
794
        );
794
        );
795
        my $two_days_ahead = dt_from_string->add( days => 2 );
795
        my $two_days_ahead = dt_from_string->add( days => 2 );
796
        $dbh->do('UPDATE issuingrules SET norenewalbefore = 10, no_auto_renewal_after = "", no_auto_renewal_after_hard_limit = ?', undef, dt_from_string->add( days => 2 ) );
796
        $dbh->do('UPDATE issuingrules SET norenewalbefore = 10, no_auto_renewal_after = NULL, no_auto_renewal_after_hard_limit = ?', undef, dt_from_string->add( days => 2 ) );
797
        $latest_auto_renew_date = GetLatestAutoRenewDate( $renewing_borrowernumber, $item_to_auto_renew->{itemnumber} );
797
        $latest_auto_renew_date = GetLatestAutoRenewDate( $renewing_borrowernumber, $item_to_auto_renew->{itemnumber} );
798
        is( $latest_auto_renew_date->truncate( to => 'day' ),
798
        is( $latest_auto_renew_date->truncate( to => 'day' ),
799
            $two_days_ahead->truncate( to => 'day' ),
799
            $two_days_ahead->truncate( to => 'day' ),
800
- 

Return to bug 20144