From 137b845f23043c0f1f64d956b28c5cd4d8124e23 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 22 Apr 2021 09:03:01 -0300 Subject: [PATCH] Bug 23207: Automatic checkin items should never be overdue This patch makes Koha::Checkouts->automatic_checkin pass the date_due as return date to AddReturn. To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Checkouts.t => FAIL: The feature is not working properly 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- Koha/Checkouts.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Koha/Checkouts.pm b/Koha/Checkouts.pm index a7b50603d0..0f2da95c65 100644 --- a/Koha/Checkouts.pm +++ b/Koha/Checkouts.pm @@ -82,12 +82,12 @@ sub automatic_checkin { { prefetch => 'item'} ); - while(my $checkout = $due_checkouts->next) { - if($checkout->item->itemtype->automatic_checkin) { - C4::Circulation::AddReturn($checkout->item->barcode, $checkout->branchcode); + while ( my $checkout = $due_checkouts->next ) { + if ( $checkout->item->itemtype->automatic_checkin ) { + C4::Circulation::AddReturn( $checkout->item->barcode, + $checkout->branchcode, undef, dt_from_string($checkout->date_due) ); } } - } =head3 type -- 2.39.5