From 9d0b0b02dd3f5779168b1b917ae1c1eff884fe68 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. --- 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 2da90e27d6..80b561e693 100644 --- a/api/v1/swagger/paths/biblios.yaml +++ b/api/v1/swagger/paths/biblios.yaml @@ -450,6 +450,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 43115f8ce8..3f5073a792 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1854,6 +1854,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 f7ca251121..93fd6edcc9 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 @@ -229,6 +229,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 @@ -480,7 +483,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 6ef020cecb..d089c30fae 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.3 (Apple Git-146)