From cd93ba5b6b5a7bcf018d4edfabbc8fc164086516 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 24 Jan 2024 14:49:53 +0000 Subject: [PATCH] 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 --- circ/returns.pl | 15 +++++++++++++-- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 5b119e3726b..8586e878059 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -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; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index ab891c58c2e..3106d821cd6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1254,6 +1254,9 @@ [% FOREACH riloo IN riloop %] + [% IF ( riloo.not_returned ) %] + Item was not checked in + [% END %] [% IF ( riloo.duedate ) %] [% IF ( riloo.return_overdue ) %] [% riloo.duedate | $KohaDates as_due_date => 1 %] (overdue) @@ -1266,6 +1269,9 @@ [% IF ( riloo.damaged ) %] [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => riloo.damaged ) | html %] [% END %] + [% IF ( riloo.withdrawn ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => riloo.withdrawn ) | html %] + [% END %] -- 2.39.2