@@ -, +, @@ previous days you are about to use as date due are really entered as opening day (never know). of the circulation rules (Administration/Circulation and fine rules) to the MOST specific category of borrower and MOST specific type of document among the existing rules of the LOGGED IN Site(cf explications in the circ-rules page). item through the advanced search using the limit by type. in the Specify-due-date box. and check the Book drop mode. The Book drop date showed should be the previous opening date. the patron is not restricted : that's ok because his restriction of one day is already finished. that the patron restriction is, as expected, one day shorter than it were if the item had been returned without dropbox mode. --- C4/Circulation.pm | 5 +++-- circ/returns.pl | 14 +++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1736,7 +1736,7 @@ patron who last borrowed the book. =cut sub AddReturn { - my ( $barcode, $branch, $exemptfine, $dropbox, $return_date ) = @_; + my ( $barcode, $branch, $exemptfine, $dropbox, $return_date, $dropboxdate ) = @_; if ($branch and not GetBranchDetail($branch)) { warn "AddReturn error: branch '$branch' not found. Reverting to " . C4::Context->userenv->{'branch'}; @@ -1851,7 +1851,7 @@ sub AddReturn { # FIXME: check issuedate > returndate, factoring in holidays #$circControlBranch = _GetCircControlBranch($item,$borrower) unless ( $item->{'issuedate'} eq C4::Dates->today('iso') );; $circControlBranch = _GetCircControlBranch($item,$borrower); - $issue->{'overdue'} = DateTime->compare($issue->{'date_due'}, $today ) == -1 ? 1 : 0; + $issue->{'overdue'} = DateTime->compare($issue->{'date_due'}, $dropboxdate ) == -1 ? 1 : 0; } if ($borrowernumber) { @@ -1950,6 +1950,7 @@ sub AddReturn { if ( $issue->{overdue} && $issue->{date_due} ) { # fix fine days + $today = $dropboxdate if $dropbox; my ($debardate,$reminder) = _debar_user_on_return( $borrower, $item, $issue->{date_due}, $today ); if ($reminder){ $messages->{'PrevDebarred'} = $debardate; --- a/circ/returns.pl +++ a/circ/returns.pl @@ -241,7 +241,7 @@ if ($barcode) { # save the return # ( $returned, $messages, $issueinformation, $borrower ) = - AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override ); + AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate ); my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn'); $homeorholdingbranchreturn ||= 'homebranch'; @@ -287,7 +287,11 @@ if ($barcode) { $riduedate{0} = $duedate; $input{borrowernumber} = $borrower->{'borrowernumber'}; $input{duedate} = $duedate; - $input{return_overdue} = 1 if (DateTime->compare($issueinformation->{date_due}, $time_now) == -1); + unless ( $dropboxmode ) { + $input{return_overdue} = 1 if (DateTime->compare($issueinformation->{date_due}, DateTime->now()) == -1); + } else { + $input{return_overdue} = 1 if (DateTime->compare($issueinformation->{date_due}, $dropboxdate) == -1); + } push( @inputloop, \%input ); if ( C4::Context->preference("FineNotifyAtCheckin") ) { @@ -533,7 +537,11 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { $ri{minute} = $duedate->minute(); $ri{duedate} = output_pref($duedate); my ($b) = GetMemberDetails( $riborrowernumber{$_}, 0 ); - $ri{return_overdue} = 1 if (DateTime->compare($duedate, DateTime->now()) == -1 ); + unless ( $dropboxmode ) { + $ri{return_overdue} = 1 if (DateTime->compare($duedate, DateTime->now()) == -1); + } else { + $ri{return_overdue} = 1 if (DateTime->compare($duedate, $dropboxdate) == -1); + } $ri{borrowernumber} = $b->{'borrowernumber'}; $ri{borcnum} = $b->{'cardnumber'}; $ri{borfirstname} = $b->{'firstname'}; --