Bug 31167: Only mark due dates in the past red on overdues report

This patch adds information about whether an entry in the overdue report
is overdue so we can style dates accordingly. We can't assume that each
result is overdue because the report can be changed to include all
checked out items.

To test, apply the patch and go to Circulation.

- Check out to a patron.
- Use the "Specify due date" option to check out some items with due
  dates in the past, due dates today, and due dates in the future.
- Go to Circulation -> Overdues.
- You should see the items which have due dates in the past. The date in
  the "Due date" column should be red text. The "Checked out on" date
  should be regular text.
- In the sidebar, check the "Show any items currently checked out"
  checkbox and submit the form.
- You should now see all the items you just checked out. Only the
  overdue items should show their due date in red.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2025-03-14 17:52:08 +00:00 committed by Katrin Fischer
parent 3888d1ee7a
commit 207cb59241
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 10 additions and 3 deletions

View file

@ -386,7 +386,8 @@ if ($noreport) {
return_claim_id => $data->{return_claim_id},
enumchron => $data->{enumchron},
itemtype => $data->{itype},
patron_attr_value_loop => \@patron_attr_value_loop,
overdue => DateTime->compare( dt_from_string( $data->{date_due} ), $today_dt ) == -1 ? 1 : 0,
patron_attr_value_loop => \@patron_attr_value_loop,
};
}

View file

@ -112,7 +112,13 @@
<tbody>
[% FOREACH overdueloo IN overdueloop %]
<tr>
<td data-order="[% overdueloo.duedate | html %]"><span class="overdue">[% overdueloo.duedate | $KohaDates %]</span></td>
<td data-order="[% overdueloo.duedate | html %]">
[% IF ( overdueloo.overdue ) %]
<span class="overdue">[% overdueloo.duedate | $KohaDates %]</span>
[% ELSE %]
[% overdueloo.duedate | $KohaDates %]
[% END %]
</td>
<td>
[% INCLUDE 'patron-title.inc' patron=overdueloo.patron hide_patron_infos_if_needed=1 %]
[% IF logged_in_user.can_see_patron_infos( overdueloo.patron ) %]
@ -129,7 +135,7 @@
<td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
<td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
<td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => overdueloo.location ) | html %]</td>
<td data-order="[% overdueloo.datelastborrowed | html %]"><span class="overdue">[% overdueloo.datelastborrowed | $KohaDates %]</span></td>
<td data-order="[% overdueloo.datelastborrowed | html %]">[% overdueloo.datelastborrowed | $KohaDates %]</td>
<td
><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber | uri %]&amp;itemnumber=[% overdueloo.itemnum | uri %]#item[% overdueloo.itemnum | uri %]"
>[% overdueloo.barcode | html %]</a