Bug 21284: (QA follow-up) Rename itemonhold and recordonhold

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle M Hall 2023-11-03 16:43:47 +00:00 committed by Tomas Cohen Arazi
parent d1d5811279
commit 37c8cf6e34
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 14 additions and 14 deletions

View File

@ -531,10 +531,10 @@ sub GetPatronInfo {
delete $issue->{'more_subfields_xml'};
# Is the item already on hold by another user?
$issue->{'itemonhold'} = Koha::Holds->search({ itemnumber => $issue->{'itemnumber'} })->count;
$issue->{'holds_on_item'} = Koha::Holds->search({ itemnumber => $issue->{'itemnumber'} })->count;
# Is the record (next available item) on hold by another user?
$issue->{'recordonhold'} = Koha::Holds->search({ biblionumber => $issue->{'biblionumber'} })->count;
$issue->{'holds_on_record'} = Koha::Holds->search({ biblionumber => $issue->{'biblionumber'} })->count;
push @checkouts, $issue
}

View File

@ -650,8 +650,8 @@
&lt;location&gt;Salle de lecture&lt;/location&gt;
&lt;itemlost&gt;0&lt;/itemlost&gt;
&lt;publicationyear&gt;1985&lt;/publicationyear&gt;
&lt;recordonhold&gt;0&lt;/recordonhold&gt;
&lt;itemonhold&gt;0&lt;/itemonhold&gt;
&lt;holds_on_record&gt;0&lt;/holds_on_record&gt;
&lt;holds_on_item&gt;0&lt;/holds_on_item&gt;
&lt;issues&gt;1&lt;/issues&gt;
&lt;homebranch&gt;BIB&lt;/homebranch&gt;
&lt;holdingbranch&gt;BIB&lt;/holdingbranch&gt;
@ -690,8 +690,8 @@
&lt;location&gt;Salle de lecture&lt;/location&gt;
&lt;itemlost&gt;0&lt;/itemlost&gt;
&lt;publicationyear&gt;2007&lt;/publicationyear&gt;
&lt;recordonhold&gt;1&lt;/recordonhold&gt;
&lt;itemonhold&gt;1&lt;/itemonhold&gt;
&lt;holds_on_record&gt;1&lt;/holds_on_record&gt;
&lt;holds_on_item&gt;1&lt;/holds_on_item&gt;
&lt;issues&gt;1&lt;/issues&gt;
&lt;homebranch&gt;BIB&lt;/homebranch&gt;
&lt;holdingbranch&gt;BIB&lt;/holdingbranch&gt;

View File

@ -179,8 +179,8 @@ subtest 'GetPatronInfo test for holds' => sub {
my $reply = C4::ILSDI::Services::GetPatronInfo( $query );
# Check that this loan is not on hold
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "0", "Record is not on hold");
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is not on hold");
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "0", "Record is not on hold");
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is not on hold");
# Place a loan
# Add a hold on the biblio
@ -188,8 +188,8 @@ subtest 'GetPatronInfo test for holds' => sub {
# Check that it is on hold on biblio level
$reply = C4::ILSDI::Services::GetPatronInfo( $query );
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold");
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is on hold");
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold");
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is on hold");
# Delete holds
$schema->resultset( 'Reserve' )->delete_all;
@ -204,16 +204,16 @@ subtest 'GetPatronInfo test for holds' => sub {
# When a specific item has a reserve, the item is on hold as well as the record
$reply = C4::ILSDI::Services::GetPatronInfo( $query );
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold");
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold");
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold");
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold");
# Add another hold on the biblio
$biblioreserve = AddReserve({ branchcode => $library->branchcode, borrowernumber => $brwr3->borrowernumber, biblionumber => $biblio->biblionumber });
# Check that there are 2 holds on the biblio and 1 on this specific item
$reply = C4::ILSDI::Services::GetPatronInfo( $query );
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "2", "Record is on hold twice");
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold");
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "2", "Record is on hold twice");
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold");
# Cleanup
$schema->storage->txn_rollback;