Added an overdue variable to the itemdata returned by the currentissues
authortonnesen <tonnesen>
Wed, 2 May 2001 22:38:26 +0000 (22:38 +0000)
committertonnesen <tonnesen>
Wed, 2 May 2001 22:38:26 +0000 (22:38 +0000)
subroutine.  This makes it easier to pick out overdue items in other
modules (ie circulation, reports, etc.)

C4/Circulation/Circ2.pm

index 033054b..ce86f54 100755 (executable)
@@ -635,7 +635,14 @@ sub currentissues {
     while (my $data = $sth->fetchrow_hashref) {
        $data->{'dewey'}=~s/0*$//;
        ($data->{'dewey'} == 0) && ($data->{'dewey'}='');
+       my @datearr = localtime(time());
+       my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", ($datearr[4]
+       +1)).sprintf ("%0.2d", $datearr[3]);
        my $datedue=$data->{'date_due'};
+       $datedue=~s/-//g;
+       if ($datedue < $todaysdate) {
+           $data->{'overdue'}=1;
+       }
        my $itemnumber=$data->{'itemnumber'};
        $currentissues{$counter}=$data;
        $counter++;