Commit 467ff7fd authored by bensinober's avatar bensinober Committed by Benjamin
Browse files

DEICH-4196 koha intra checkouts list, fix overdues alert colour

parent 7c3397be
......@@ -117,7 +117,10 @@ foreach my $loan (@$loans) {
my $itemtype = Koha::ItemTypes->find( $item_level_itypes ? $it->{item}->{itype} : $it->{biblioitem}->{itemtype} );
my $issueDate = Time::Piece->strptime($loan->{issuedate}, '%Y-%m-%d %H:%M:%S');
my $checkedOutToday = $issueDate == Time::Piece->new() ? 1 : 0;
my $dueDate = Time::Piece->strptime($loan->{date_due}, '%Y-%m-%d %H:%M:%S');
my $now = Time::Piece->new();
my $checkedOutToday = $issueDate == $now ? 1 : 0;
my $isOverdue = $now > $dueDate ? 1 : 0 ;
my $location;
if ( $it->{item}->{location} ) {
......@@ -160,7 +163,7 @@ foreach my $loan (@$loans) {
biblionumber => $it->{item}->{biblionumber},
issuedate => $loan->{issuedate},
date_due => $loan->{date_due},
date_due_overdue => $loan->{date_due_overdue} ? JSON::true : JSON::false,
date_due_overdue => $isOverdue ? JSON::true : JSON::false,
timestamp => $loan->{timestamp},
onsite_checkout => $loan->{onsite_checkout},
enumchron => $it->{item}->{enumchron},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment