Lines 179-186
subtest 'GetPatronInfo test for holds' => sub {
Link Here
|
179 |
my $reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
179 |
my $reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
180 |
|
180 |
|
181 |
# Check that this loan is not on hold |
181 |
# Check that this loan is not on hold |
182 |
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "0", "Record is not on hold"); |
182 |
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "0", "Record is not on hold"); |
183 |
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is not on hold"); |
183 |
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is not on hold"); |
184 |
|
184 |
|
185 |
# Place a loan |
185 |
# Place a loan |
186 |
# Add a hold on the biblio |
186 |
# Add a hold on the biblio |
Lines 188-195
subtest 'GetPatronInfo test for holds' => sub {
Link Here
|
188 |
|
188 |
|
189 |
# Check that it is on hold on biblio level |
189 |
# Check that it is on hold on biblio level |
190 |
$reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
190 |
$reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
191 |
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold"); |
191 |
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold"); |
192 |
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is on hold"); |
192 |
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is on hold"); |
193 |
|
193 |
|
194 |
# Delete holds |
194 |
# Delete holds |
195 |
$schema->resultset( 'Reserve' )->delete_all; |
195 |
$schema->resultset( 'Reserve' )->delete_all; |
Lines 204-219
subtest 'GetPatronInfo test for holds' => sub {
Link Here
|
204 |
|
204 |
|
205 |
# When a specific item has a reserve, the item is on hold as well as the record |
205 |
# When a specific item has a reserve, the item is on hold as well as the record |
206 |
$reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
206 |
$reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
207 |
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold"); |
207 |
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold"); |
208 |
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold"); |
208 |
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold"); |
209 |
|
209 |
|
210 |
# Add another hold on the biblio |
210 |
# Add another hold on the biblio |
211 |
$biblioreserve = AddReserve({ branchcode => $library->branchcode, borrowernumber => $brwr3->borrowernumber, biblionumber => $biblio->biblionumber }); |
211 |
$biblioreserve = AddReserve({ branchcode => $library->branchcode, borrowernumber => $brwr3->borrowernumber, biblionumber => $biblio->biblionumber }); |
212 |
|
212 |
|
213 |
# Check that there are 2 holds on the biblio and 1 on this specific item |
213 |
# Check that there are 2 holds on the biblio and 1 on this specific item |
214 |
$reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
214 |
$reply = C4::ILSDI::Services::GetPatronInfo( $query ); |
215 |
is ( $reply->{loans}->{loan}[0]->{recordonhold}, "2", "Record is on hold twice"); |
215 |
is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "2", "Record is on hold twice"); |
216 |
is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold"); |
216 |
is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold"); |
217 |
|
217 |
|
218 |
# Cleanup |
218 |
# Cleanup |
219 |
$schema->storage->txn_rollback; |
219 |
$schema->storage->txn_rollback; |
220 |
- |
|
|