use Modern::Perl;
-use Carp;
use C4::Context;
-use C4::Circulation;
+use C4::Circulation qw( AddReturn );
use Koha::Checkout;
use Koha::Database;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
use base qw(Koha::Objects);
{ 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