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 <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Matt Blenkinsop 2024-07-01 09:50:45 +00:00 committed by Katrin Fischer
parent e1556715a0
commit 4c96b67cab
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
5 changed files with 30 additions and 19 deletions

View file

@ -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"

View file

@ -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")) {

View file

@ -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;

View file

@ -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 += '<span class="lost">%s</span>'.format(escape_str(lost_lib));
if(hasReturnClaims) {
nodes += '<span class="claimed_returned">(Claimed returned)</span>';
}
}
if ( row.withdrawn ) {

View file

@ -211,31 +211,25 @@
<input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" />
<input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
[% IF ClaimReturnedLostValue && ITEM_DAT.itemlost == ClaimReturnedLostValue %]
<select name="itemlost" disabled="disabled">
[% ELSE %]
<select name="itemlost">
[% END %]
<option value="">Choose</option>
[% FOREACH itemlostloo IN itemlostloop %]
[% IF itemlostloo.authorised_value == ITEM_DAT.itemlost %]
<option value="[% itemlostloo.authorised_value | html %]" selected="selected">[% itemlostloo.lib | html %]</option>
[% ELSIF ClaimReturnedLostValue && itemlostloo.authorised_value == ClaimReturnedLostValue #Filter claims returned status from pulldown %]
<option value="[% itemlostloo.authorised_value | html %]" disabled="disabled" title="Return claims must be processed from the patron details page">[% itemlostloo.lib | html %]</option>
[% ELSE %]
<option value="[% itemlostloo.authorised_value | html %]">[% itemlostloo.lib | html %]</option>
[% END %]
<select name="itemlost">
<option value="">Choose</option>
[% FOREACH itemlostloo IN itemlostloop %]
[% IF itemlostloo.authorised_value == ITEM_DAT.itemlost %]
<option value="[% itemlostloo.authorised_value | html %]" selected="selected">[% itemlostloo.lib | html %]</option>
[% ELSIF ClaimReturnedLostValue && itemlostloo.authorised_value == ClaimReturnedLostValue #Filter claims returned status from pulldown %]
<option value="[% itemlostloo.authorised_value | html %]" disabled="disabled" title="Return claims must be processed from the patron details page">[% itemlostloo.lib | html %]</option>
[% ELSE %]
<option value="[% itemlostloo.authorised_value | html %]">[% itemlostloo.lib | html %]</option>
[% END %]
[% END %]
</select>
<input type="hidden" name="withdrawn" value="[% ITEM_DAT.withdrawn | html %]" />
<input type="hidden" name="damaged" value="[% ITEM_DAT.damaged | html %]" />
[% IF ClaimReturnedLostValue && ITEM_DAT.itemlost == ClaimReturnedLostValue %]
<input type="submit" name="submit" class="submit" value="Set status" disabled="disabled"/>
<input type="hidden" name="op" value="cud-set_lost" />
<input type="submit" name="submit" class="btn btn-primary btn-xs" value="Set status" />
[% IF ClaimReturnedLostValue && ITEM_DAT.has_return_claim %]
<p class="help-block">Item has been claimed as returned.</p>
[% ELSE %]
<input type="hidden" name="op" value="cud-set_lost" />
<input type="submit" name="submit" class="btn btn-primary btn-xs" value="Set status" />
[% END %]
</form>
[% ELSE %]