Lines 203-209
subtest 'AutoRemoveOverduesRestrictions' => sub {
Link Here
|
203 |
my $item_1 = $builder->build_sample_item; |
203 |
my $item_1 = $builder->build_sample_item; |
204 |
my $item_2 = $builder->build_sample_item; |
204 |
my $item_2 = $builder->build_sample_item; |
205 |
my $item_3 = $builder->build_sample_item; |
205 |
my $item_3 = $builder->build_sample_item; |
206 |
my $nine_days_ago = dt_from_string->subtract( days => 9 ); |
206 |
my $nine_days_ago = dt_from_string->subtract( days => 9 ); |
207 |
my $checkout_1 = |
207 |
my $checkout_1 = |
208 |
AddIssue( $patron, $item_1->barcode, $nine_days_ago ); # overdue, but would not trigger debarment |
208 |
AddIssue( $patron, $item_1->barcode, $nine_days_ago ); # overdue, but would not trigger debarment |
209 |
my $checkout_2 = |
209 |
my $checkout_2 = |
Lines 234-242
subtest 'AutoRemoveOverduesRestrictions' => sub {
Link Here
|
234 |
|
234 |
|
235 |
my $ten_days_ago = dt_from_string->subtract( days => 10 ); |
235 |
my $ten_days_ago = dt_from_string->subtract( days => 10 ); |
236 |
|
236 |
|
237 |
$checkout_1 = AddIssue( $patron->unblessed, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment |
237 |
$checkout_1 = AddIssue( $patron, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment |
238 |
$checkout_2 = |
238 |
$checkout_2 = |
239 |
AddIssue( $patron->unblessed, $item_2->barcode, $nine_days_ago ); # overdue, but would not trigger debarment |
239 |
AddIssue( $patron, $item_2->barcode, $nine_days_ago ); # overdue, but would not trigger debarment |
240 |
|
240 |
|
241 |
Koha::Patron::Debarments::AddUniqueDebarment( |
241 |
Koha::Patron::Debarments::AddUniqueDebarment( |
242 |
{ |
242 |
{ |
Lines 254-260
subtest 'AutoRemoveOverduesRestrictions' => sub {
Link Here
|
254 |
'OVERDUES debarment is removed if remaining items would not result in patron debarment' |
254 |
'OVERDUES debarment is removed if remaining items would not result in patron debarment' |
255 |
); |
255 |
); |
256 |
|
256 |
|
257 |
$checkout_1 = AddIssue( $patron->unblessed, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment |
257 |
$checkout_1 = AddIssue( $patron, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment |
258 |
|
258 |
|
259 |
Koha::Patron::Debarments::AddUniqueDebarment( |
259 |
Koha::Patron::Debarments::AddUniqueDebarment( |
260 |
{ |
260 |
{ |
Lines 275-281
subtest 'AutoRemoveOverduesRestrictions' => sub {
Link Here
|
275 |
my $eleven_days_ago = dt_from_string->subtract( days => 11 ); |
275 |
my $eleven_days_ago = dt_from_string->subtract( days => 11 ); |
276 |
|
276 |
|
277 |
# overdue and would trigger debarment |
277 |
# overdue and would trigger debarment |
278 |
$checkout_2 = AddIssue( $patron->unblessed, $item_2->barcode, $eleven_days_ago ); |
278 |
$checkout_2 = AddIssue( $patron, $item_2->barcode, $eleven_days_ago ); |
279 |
|
279 |
|
280 |
# $checkout_1 should now not trigger debarment with this new rule for specific branchcode |
280 |
# $checkout_1 should now not trigger debarment with this new rule for specific branchcode |
281 |
$dbh->do( |
281 |
$dbh->do( |
282 |
- |
|
|