|
Lines 197-200
subtest "Bug 30114 - Koha offline circulation will always cancel the next hold w
Link Here
|
| 197 |
is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Still found two holds for the record" ); |
197 |
is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Still found two holds for the record" ); |
| 198 |
}; |
198 |
}; |
| 199 |
|
199 |
|
|
|
200 |
subtest "Bug 32934: ProcessOfflineIssue returns checkout object for SIP no block due date" => sub { |
| 201 |
plan tests => 4; |
| 202 |
|
| 203 |
$branch = $builder->build( { source => 'Branch' } )->{branchcode}; |
| 204 |
$manager_id = $builder->build( { source => 'Borrower' } )->{borrowernumber}; |
| 205 |
|
| 206 |
my $borrower = $builder->build( |
| 207 |
{ |
| 208 |
source => 'Borrower', |
| 209 |
value => { branchcode => $branch } |
| 210 |
} |
| 211 |
); |
| 212 |
|
| 213 |
my $biblio = $builder->build_sample_biblio; |
| 214 |
my $item = $builder->build_sample_item( |
| 215 |
{ |
| 216 |
biblionumber => $biblio->id, |
| 217 |
library => $branch, |
| 218 |
} |
| 219 |
); |
| 220 |
|
| 221 |
my $due_date = dt_from_string->add( days => 7 )->ymd; |
| 222 |
|
| 223 |
# Test ProcessOfflineIssue returns both message and checkout object |
| 224 |
my ( $message, $checkout ) = ProcessOfflineIssue( |
| 225 |
{ |
| 226 |
cardnumber => $borrower->{cardnumber}, |
| 227 |
barcode => $item->barcode, |
| 228 |
due_date => $due_date, |
| 229 |
timestamp => dt_from_string |
| 230 |
} |
| 231 |
); |
| 232 |
|
| 233 |
is( $message, "Success.", "ProcessOfflineIssue returns success message" ); |
| 234 |
isa_ok( $checkout, 'Koha::Checkout', "ProcessOfflineIssue returns checkout object" ); |
| 235 |
is( $checkout->borrowernumber, $borrower->{borrowernumber}, "Checkout has correct borrower" ); |
| 236 |
is( $checkout->date_due->ymd, $due_date, "Checkout respects specified due_date" ); |
| 237 |
}; |
| 238 |
|
| 200 |
$schema->storage->txn_rollback; |
239 |
$schema->storage->txn_rollback; |