+
+ # Check if we need to use an exact due date set by the ILL module
+ if ( C4::Context->preference('ILLModule') ) {
+ # Check if there is an ILL connected with the biblio of the item we are issuing
+ my $ill_request = Koha::Illrequests->search({
+ biblio_id => $item_object->biblionumber,
+ borrowernumber => $borrower->{'borrowernumber'},
+ completed => undef,
+ due_date => { '!=', undef },
+ })->next;
+
+ if ( $ill_request and length( $ill_request->due_date ) > 0 ) {
+ my $ill_dt = dt_from_string( $ill_request->due_date );
+ $ill_dt->set_hour(23);
+ $ill_dt->set_minute(59);
+ $datedue = $ill_dt;
+ }
+ }
+