Result of a cherry-pick, tidying up a comment
[koha.git] / circ / returns.pl
index 8e1d6cc..164ef94 100755 (executable)
@@ -131,7 +131,7 @@ if ( $query->param('resbarcode') ) {
     
 #     addin in ModReserveAffect the possibility to check if the document is expected in this library or not,
 # if not we send a value in reserve waiting for not implementting waiting status
-    if ($diffBranchReturned) {
+    if (C4::Context->userenv->{'branch'} ne $diffBranchReturned) {
         $diffBranchSend = $diffBranchReturned;
     }
     else {
@@ -538,7 +538,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
             $ri{duedate} = format_date($duedate);
             my ($borrower) =
               GetMemberDetails( $riborrowernumber{$_}, 0 );
-            $ri{return_overdue} = 1 if ($duedate < $today->output('iso'));
+            $ri{return_overdue} = 1 if ($duedate lt $today->output('iso'));
             $ri{borrowernumber} = $borrower->{'borrowernumber'};
             $ri{borcnum}        = $borrower->{'cardnumber'};
             $ri{borfirstname}   = $borrower->{'firstname'};