Lines 175-181
subtest "Tests for needs_advancing." => sub {
Link Here
|
175 |
'tobranch' => $dbitem->stage->branchcode_id, |
175 |
'tobranch' => $dbitem->stage->branchcode_id, |
176 |
'datesent' => DateTime->now, |
176 |
'datesent' => DateTime->now, |
177 |
'datearrived' => undef, |
177 |
'datearrived' => undef, |
178 |
'comments' => "StockrotationAdvance", |
178 |
'trigger' => "StockrotationAdvance", |
179 |
})->store; |
179 |
})->store; |
180 |
|
180 |
|
181 |
# Test item will not be advanced if in transit. |
181 |
# Test item will not be advanced if in transit. |
Lines 307-313
subtest "Tests for investigate (singular)." => sub {
Link Here
|
307 |
'tobranch' => $dbitem->itemnumber->homebranch, |
307 |
'tobranch' => $dbitem->itemnumber->homebranch, |
308 |
'datesent' => DateTime->now, |
308 |
'datesent' => DateTime->now, |
309 |
'datearrived' => DateTime->now, |
309 |
'datearrived' => DateTime->now, |
310 |
'comments' => "StockrotationAdvance", |
310 |
'trigger' => "StockrotationAdvance", |
311 |
})->store; |
311 |
})->store; |
312 |
is($dbitem->investigate->{reason}, 'repatriation', "older item repatriates."); |
312 |
is($dbitem->investigate->{reason}, 'repatriation', "older item repatriates."); |
313 |
|
313 |
|
Lines 323-329
subtest "Tests for investigate (singular)." => sub {
Link Here
|
323 |
'tobranch' => $dbitem->stage->branchcode_id, |
323 |
'tobranch' => $dbitem->stage->branchcode_id, |
324 |
'datesent' => DateTime->now, |
324 |
'datesent' => DateTime->now, |
325 |
'datearrived' => DateTime->now, |
325 |
'datearrived' => DateTime->now, |
326 |
'comments' => "StockrotationAdvance", |
326 |
'trigger' => "StockrotationAdvance", |
327 |
})->store; |
327 |
})->store; |
328 |
$dbitem->itemnumber->homebranch($dbitem->stage->branchcode_id)->store; |
328 |
$dbitem->itemnumber->homebranch($dbitem->stage->branchcode_id)->store; |
329 |
$dbitem->itemnumber->holdingbranch($dbitem->stage->branchcode_id)->store; |
329 |
$dbitem->itemnumber->holdingbranch($dbitem->stage->branchcode_id)->store; |
Lines 342-348
subtest "Tests for investigate (singular)." => sub {
Link Here
|
342 |
'tobranch' => $dbitem->stage->branchcode_id, |
342 |
'tobranch' => $dbitem->stage->branchcode_id, |
343 |
'datesent' => DateTime->now - $sent_duration, |
343 |
'datesent' => DateTime->now - $sent_duration, |
344 |
'datearrived' => DateTime->now - $arrived_duration, |
344 |
'datearrived' => DateTime->now - $arrived_duration, |
345 |
'comments' => "StockrotationAdvance", |
345 |
'trigger' => "StockrotationAdvance", |
346 |
})->store; |
346 |
})->store; |
347 |
$dbitem->itemnumber->homebranch($dbitem->stage->branchcode_id)->store; |
347 |
$dbitem->itemnumber->homebranch($dbitem->stage->branchcode_id)->store; |
348 |
$dbitem->itemnumber->holdingbranch($dbitem->stage->branchcode_id)->store; |
348 |
$dbitem->itemnumber->holdingbranch($dbitem->stage->branchcode_id)->store; |
Lines 362-368
subtest "Tests for investigate (singular)." => sub {
Link Here
|
362 |
'tobranch' => $dbitem->stage->branchcode_id, |
362 |
'tobranch' => $dbitem->stage->branchcode_id, |
363 |
'datesent' => DateTime->now - $sent_duration, |
363 |
'datesent' => DateTime->now - $sent_duration, |
364 |
'datearrived' => DateTime->now - $arrived_duration, |
364 |
'datearrived' => DateTime->now - $arrived_duration, |
365 |
'comments' => "StockrotationAdvance", |
365 |
'trigger' => "StockrotationAdvance", |
366 |
})->store; |
366 |
})->store; |
367 |
$dbitem->itemnumber->homebranch($dbitem->stage->branchcode_id)->store; |
367 |
$dbitem->itemnumber->homebranch($dbitem->stage->branchcode_id)->store; |
368 |
$dbitem->itemnumber->holdingbranch($dbitem->stage->branchcode_id)->store; |
368 |
$dbitem->itemnumber->holdingbranch($dbitem->stage->branchcode_id)->store; |
Lines 382-388
subtest "Tests for investigate (singular)." => sub {
Link Here
|
382 |
'tobranch' => $dbitem->stage->branchcode_id, |
382 |
'tobranch' => $dbitem->stage->branchcode_id, |
383 |
'datesent' => DateTime->now - $sent_duration, |
383 |
'datesent' => DateTime->now - $sent_duration, |
384 |
'datearrived' => DateTime->now - $arrived_duration, |
384 |
'datearrived' => DateTime->now - $arrived_duration, |
385 |
'comments' => "StockrotationAdvance", |
385 |
'trigger' => "StockrotationAdvance", |
386 |
})->store; |
386 |
})->store; |
387 |
is($dbitem->investigate->{reason}, 'repatriation', |
387 |
is($dbitem->investigate->{reason}, 'repatriation', |
388 |
"Item advances, but not at stage branch."); |
388 |
"Item advances, but not at stage branch."); |
389 |
- |
|
|