Lines 3832-3840
subtest 'CanBookBeIssued | is_overdue' => sub {
Link Here
|
3832 |
} |
3832 |
} |
3833 |
); |
3833 |
); |
3834 |
|
3834 |
|
3835 |
my $now = dt_from_string; |
3835 |
my $now = dt_from_string()->truncate( to => 'day' ); |
3836 |
my $five_days_go = output_pref({ dt => $now->clone->add( days => 5 ), dateonly => 1}); |
3836 |
my $five_days_go = $now->clone->add( days => 5 ); |
3837 |
my $ten_days_go = output_pref({ dt => $now->clone->add( days => 10), dateonly => 1 }); |
3837 |
my $ten_days_go = $now->clone->add( days => 10); |
3838 |
my $library = $builder->build( { source => 'Branch' } ); |
3838 |
my $library = $builder->build( { source => 'Branch' } ); |
3839 |
my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); |
3839 |
my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); |
3840 |
|
3840 |
|
Lines 3846-3852
subtest 'CanBookBeIssued | is_overdue' => sub {
Link Here
|
3846 |
|
3846 |
|
3847 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $five_days_go ); # date due was 10d ago |
3847 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $five_days_go ); # date due was 10d ago |
3848 |
my $actualissue = Koha::Checkouts->find( { itemnumber => $item->itemnumber } ); |
3848 |
my $actualissue = Koha::Checkouts->find( { itemnumber => $item->itemnumber } ); |
3849 |
is( output_pref({ str => $actualissue->date_due, dateonly => 1}), $five_days_go, "First issue works"); |
3849 |
is( output_pref({ str => $actualissue->date_due, dateonly => 1}), output_pref({ str => $five_days_go, dateonly => 1}), "First issue works"); |
3850 |
my ($issuingimpossible, $needsconfirmation) = CanBookBeIssued($patron,$item->barcode,$ten_days_go, undef, undef, undef); |
3850 |
my ($issuingimpossible, $needsconfirmation) = CanBookBeIssued($patron,$item->barcode,$ten_days_go, undef, undef, undef); |
3851 |
is( $needsconfirmation->{RENEW_ISSUE}, 1, "This is a renewal"); |
3851 |
is( $needsconfirmation->{RENEW_ISSUE}, 1, "This is a renewal"); |
3852 |
is( $needsconfirmation->{TOO_MANY}, undef, "Not too many, is a renewal"); |
3852 |
is( $needsconfirmation->{TOO_MANY}, undef, "Not too many, is a renewal"); |
3853 |
- |
|
|