Lines 1234-1240
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
Link Here
|
1234 |
|
1234 |
|
1235 |
my ( $error, $question, $alerts ); |
1235 |
my ( $error, $question, $alerts ); |
1236 |
|
1236 |
|
1237 |
# Patron cannot issue item_1, he has overdues |
1237 |
# Patron cannot issue item_1, he or she has overdues |
1238 |
my $yesterday = DateTime->today( time_zone => C4::Context->tz() )->add( days => -1 ); |
1238 |
my $yesterday = DateTime->today( time_zone => C4::Context->tz() )->add( days => -1 ); |
1239 |
my $issue = AddIssue( $patron, $item_1->{barcode}, $yesterday ); # Add an overdue |
1239 |
my $issue = AddIssue( $patron, $item_1->{barcode}, $yesterday ); # Add an overdue |
1240 |
|
1240 |
|
Lines 1248-1254
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
Link Here
|
1248 |
is( keys(%$question) + keys(%$alerts), 0 ); |
1248 |
is( keys(%$question) + keys(%$alerts), 0 ); |
1249 |
is( $error->{USERBLOCKEDOVERDUE}, 1 ); |
1249 |
is( $error->{USERBLOCKEDOVERDUE}, 1 ); |
1250 |
|
1250 |
|
1251 |
# Patron cannot issue item_1, he is debarred |
1251 |
# Patron cannot issue item_1, he or she is debarred |
1252 |
my $tomorrow = DateTime->today( time_zone => C4::Context->tz() )->add( days => 1 ); |
1252 |
my $tomorrow = DateTime->today( time_zone => C4::Context->tz() )->add( days => 1 ); |
1253 |
Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->{borrowernumber}, expiration => $tomorrow } ); |
1253 |
Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->{borrowernumber}, expiration => $tomorrow } ); |
1254 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} ); |
1254 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} ); |
Lines 1478-1484
subtest 'AddReturn + CumulativeRestrictionPeriods' => sub {
Link Here
|
1478 |
); |
1478 |
); |
1479 |
$rule->store(); |
1479 |
$rule->store(); |
1480 |
|
1480 |
|
1481 |
# Patron cannot issue item_1, he has overdues |
1481 |
# Patron cannot issue item_1, he or she has overdues |
1482 |
my $five_days_ago = dt_from_string->subtract( days => 5 ); |
1482 |
my $five_days_ago = dt_from_string->subtract( days => 5 ); |
1483 |
my $ten_days_ago = dt_from_string->subtract( days => 10 ); |
1483 |
my $ten_days_ago = dt_from_string->subtract( days => 10 ); |
1484 |
AddIssue( $patron, $item_1->{barcode}, $five_days_ago ); # Add an overdue |
1484 |
AddIssue( $patron, $item_1->{barcode}, $five_days_ago ); # Add an overdue |