From 0f13887365dc4cf463258f538e513aa8f24ac14c Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 16 Aug 2023 21:20:36 +0000 Subject: [PATCH] Bug 34547: Add transfer reason to checkedintable on returns.tt To test: 1. Apply patch, restart_all 2. Check some items out and prepare some reasons that would initiate a branchtransfer. According the schema it can be any of the following: 'Manual', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding', 'RotatingCollection', 'Reserve', 'LostReserve', 'CancelReserve', 'TransferCancellation', 'Recall', 'RecallCancellation. 3. CHeck in some the items and notice the 'Transfer reason' column in the table. Make sure the reasons are acurate and make sense. 4. To go Table settings and find the 'checkedintable'. Make sure you can properly hide the column from the display. --- admin/columns_settings.yml | 2 ++ circ/returns.pl | 1 + .../intranet-tmpl/prog/en/modules/circ/returns.tt | 15 +++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 90fb535472..89d5e20de6 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1447,6 +1447,8 @@ modules: columnname: homelibrary - columnname: transferlibrary + - + columnname: transferreason - columnname: location - diff --git a/circ/returns.pl b/circ/returns.pl index 65160e16ce..0a2a2c8597 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -802,6 +802,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{transferreason} = $item->get_transfer ? $item->get_transfer->reason : ''; $ri{location} = $item->location; my $shelfcode = $ri{'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 0bcc733cf8..19aa809ad8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1204,6 +1204,7 @@ Barcode Home library Transfer to + Transfer reason Shelving location Call number Date acquired @@ -1253,6 +1254,20 @@ [% Branches.GetName( riloo.transferbranch ) | html %] + + [%- SWITCH riloo.transferreason -%] + [%- CASE 'Manual' -%]Manual + [%- CASE 'StockrotationAdvance' -%]Stock rotation advance + [%- CASE 'StockrotationRepatriation' -%]Stock rotation repatriation + [%- CASE 'ReturnToHome' -%]Return to home library + [%- CASE 'ReturnToHolding' -%]Return to holding library + [%- CASE 'RotatingCollection' -%]Rotating collection + [%- CASE 'Reserve' -%]Hold + [%- CASE 'LostReserve' -%]Lost hold + [%- CASE 'CancelReserve' -%]Cancelled hold + [%- CASE 'TransferCancellation' -%]Transfer was cancelled whilst in transit + [%- END -%] + [% riloo.location | html %] -- 2.30.2