Bug 8461: Display information on withdrawn item when checked in

This patch displays the due date and withdrawn information in the Checked-in items table when 'ShowAllCheckins' is enabled. While the top message is clear, if a staff member checks in two items, then refers to the table they would not have all the information.

To test:
1 - Enable system preference 'ShowAllCheckins'
2 - Set system preference 'BlockReturnOfWithdrawnItems' to 'Block'
3 - Check out an item to a patron
4 - Mark the item as withdrawn
5 - Check the item in
6 - Note message at top says things like 'Cannot check in' 'Item has been withdrawn'
7 - Note the Checked-in items table says 'Not checked out'
8 - Apply patch, restart all
9 - Check the item in again
10 - Note top message has not changed
11 - Note the table now say 'Item was not checked in' and displays the due date and patron info
12 - Note the table also includes the withdrawn value for the item

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Nick Clemens 2024-01-24 14:49:53 +00:00 committed by Katrin Fischer
parent a3fc07806a
commit f5fcdb83e6
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 19 additions and 2 deletions

View file

@ -414,9 +414,17 @@ if ($barcode && $op eq 'cud-checkin') {
}
} elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} and !$needs_confirm and !$bundle_confirm ) {
$input{duedate} = 0;
my $duedate = 0;
if( $issue ){
my $date_due_dt = dt_from_string( $issue->date_due, 'sql' );
$duedate = $date_due_dt->strftime('%Y-%m-%d %H:%M');
$input{borrowernumber} = $issue->borrowernumber;
$riborrowernumber{0} = $borrower->{'borrowernumber'};
}
$input{duedate} = $duedate;
$input{not_returned} = 1;
$returneditems{0} = $barcode;
$riduedate{0} = 0;
$riduedate{0} = $duedate;
push( @inputloop, \%input );
}
$template->param( privacy => $borrower->{privacy} );
@ -790,6 +798,8 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
next unless $item; # FIXME The item has been deleted in the meantime,
# we could handle that better displaying a message in the template
$ri{not_returned} = 1 unless $returned;
my $biblio = $item->biblio;
# FIXME pass $item to the template and we are done here...
$ri{itembiblionumber} = $biblio->biblionumber;
@ -811,6 +821,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
$ri{homebranch} = $item->homebranch;
$ri{transferbranch} = $item->get_transfer ? $item->get_transfer->tobranch : '';
$ri{damaged} = $item->damaged;
$ri{withdrawn} = $item->withdrawn;
$ri{transferreason} = $item->get_transfer ? $item->get_transfer->reason : '';
$ri{location} = $item->location;

View file

@ -1254,6 +1254,9 @@
[% FOREACH riloo IN riloop %]
<tr>
<td class="ci-duedate">
[% IF ( riloo.not_returned ) %]
<span class="problem">Item was not checked in</span>
[% END %]
[% IF ( riloo.duedate ) %]
[% IF ( riloo.return_overdue ) %]
<span class="overdue">[% riloo.duedate | $KohaDates as_due_date => 1 %] (overdue)</span>
@ -1266,6 +1269,9 @@
[% IF ( riloo.damaged ) %]
<span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => riloo.damaged ) | html %]</span>
[% END %]
[% IF ( riloo.withdrawn ) %]
<span class="withdrawn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => riloo.withdrawn ) | html %]</span>
[% END %]
</td>
<td class="ci-title">
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">