From 4c96b67cab71ed8fb2af9928db721f345a6567d0 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Mon, 1 Jul 2024 09:50:45 +0000 Subject: [PATCH] Bug 27919: (QA follow-up): Add alerts to the UI to show there are return claims This patch adds info to the UI to show when there is a return claim. It also reconciles the behaviour for allowing the lost status to be changed. Previously the lost status could not be changed if there was a return claim. This is now possible and a message is shown highlighting the fact that there is a return claim as well as the new lost status. Test plan: 1) Add a return claim to an item. 2) Check the holdings table on the record page and observe that the "Status" column now shows that there is a return claim 3) Click on the barcode for that item in the table to get to the item editing page 4) Observe that the select for the item lost status is not disabled 5) Change the status and save - the form should save correctly and display both the new status as well as a message showing that there is a return claim. Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- api/v1/swagger/paths/biblios.yaml | 1 + catalogue/moredetail.pl | 3 ++ .../prog/css/src/staff-global.scss | 6 ++++ .../tables/items/catalogue_detail.inc | 7 ++++ .../prog/en/modules/catalogue/moredetail.tt | 32 ++++++++----------- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml index 039fb1b52a..c4d8efa6c5 100644 --- a/api/v1/swagger/paths/biblios.yaml +++ b/api/v1/swagger/paths/biblios.yaml @@ -479,6 +479,7 @@ - cover_image_ids - item_group_item.item_group.description - serial_item.serial + - return_claims collectionFormat: csv - $ref: "../swagger.yaml#/parameters/match" - $ref: "../swagger.yaml#/parameters/order_by" diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 5e122011ef..10a1d4fe0f 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -229,6 +229,9 @@ foreach my $item (@items){ $item_info->{paidfor} = { patron => $patron, created_on => $payment_offset->created_on }; } } + + my $return_claim = $item->return_claim; + $item_info->{has_return_claim} = 1 if $return_claim; } if (C4::Context->preference("IndependentBranches")) { diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 1fb16ad1d2..6b6c5e7f0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1814,6 +1814,12 @@ i { font-style: italic; } +// style for return claim detail in catalogsearch +.claimed_returned { + display: block; + font-style: italic; +} + #closewindow { margin-top: 2em; text-align: center; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 1eb78f0168..80275247ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -245,6 +245,9 @@ [% IF Koha.Preference('UseCourseReserves') %] embed.push('course_item.course_reserves.course'); [% END %] + [% IF Koha.Preference('ClaimReturnedLostValue') %] + embed.push('return_claims'); + [% END %] [% IF Koha.Preference('EasyAnalyticalRecords') %] // For host records @@ -491,7 +494,11 @@ if ( row.lost_status ) { let lost_lib = av_lost.get(row.lost_status.toString()) || _("Unavailable (lost or missing"); + const hasReturnClaims = row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false nodes += '%s'.format(escape_str(lost_lib)); + if(hasReturnClaims) { + nodes += '(Claimed returned)'; + } } if ( row.withdrawn ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 3a73ab0229..b977f7cf50 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -211,31 +211,25 @@ - [% IF ClaimReturnedLostValue && ITEM_DAT.itemlost == ClaimReturnedLostValue %] - - [% END %] - - [% FOREACH itemlostloo IN itemlostloop %] - [% IF itemlostloo.authorised_value == ITEM_DAT.itemlost %] - - [% ELSIF ClaimReturnedLostValue && itemlostloo.authorised_value == ClaimReturnedLostValue #Filter claims returned status from pulldown %] - - [% ELSE %] - - [% END %] + - [% IF ClaimReturnedLostValue && ITEM_DAT.itemlost == ClaimReturnedLostValue %] - + + + [% IF ClaimReturnedLostValue && ITEM_DAT.has_return_claim %]

Item has been claimed as returned.

- [% ELSE %] - - [% END %] [% ELSE %] -- 2.39.5