Lines 7-13
use C4::Items;
Link Here
|
7 |
use C4::Circulation; |
7 |
use C4::Circulation; |
8 |
use Koha::IssuingRule; |
8 |
use Koha::IssuingRule; |
9 |
|
9 |
|
10 |
use Test::More tests => 5; |
10 |
use Test::More tests => 7; |
11 |
|
11 |
|
12 |
use t::lib::TestBuilder; |
12 |
use t::lib::TestBuilder; |
13 |
use t::lib::Mocks; |
13 |
use t::lib::Mocks; |
Lines 213-217
AddReturn( $item1->{barcode} );
Link Here
|
213 |
}; |
213 |
}; |
214 |
} |
214 |
} |
215 |
|
215 |
|
|
|
216 |
my $biblio = $builder->build({ |
217 |
source => 'Biblio', |
218 |
}); |
219 |
|
220 |
my $item3 = $builder->build({ |
221 |
source => 'Item', |
222 |
value => { |
223 |
biblionumber => $biblio->{biblionumber}, |
224 |
itemlost => 0, |
225 |
notforloan => 0, |
226 |
withdrawn => 0, |
227 |
damaged => 0, |
228 |
onloan => 0 |
229 |
} |
230 |
}); |
231 |
|
232 |
my $hold = $builder->build({ |
233 |
source => 'Reserve', |
234 |
value =>{ |
235 |
itemnumber => $item3->{itemnumber}, |
236 |
found => 'T' |
237 |
} |
238 |
}); |
239 |
|
240 |
$dbh->do("DELETE FROM issuingrules"); |
241 |
$rule = Koha::IssuingRule->new( |
242 |
{ |
243 |
categorycode => '*', |
244 |
itemtype => '*', |
245 |
branchcode => '*', |
246 |
maxissueqty => 99, |
247 |
issuelength => 7, |
248 |
lengthunit => 8, |
249 |
reservesallowed => 99, |
250 |
onshelfholds => 0, |
251 |
} |
252 |
); |
253 |
$rule->store(); |
254 |
|
255 |
$is = IsAvailableForItemLevelRequest( $item3, $borrower1); |
256 |
is( $is, 1, "Item can be held, items in transit are not available" ); |
257 |
|
258 |
Koha::Holds->find($hold->{reserve_id})->found('F')->store; |
259 |
|
260 |
$is = IsAvailableForItemLevelRequest( $item3, $borrower1); |
261 |
is( $is, 0, "Item is neither waiting nor in transit." ); |
262 |
|
216 |
# Cleanup |
263 |
# Cleanup |
217 |
$schema->storage->txn_rollback; |
264 |
$schema->storage->txn_rollback; |
218 |
- |
|
|