Lines 21-27
use Test::More tests => 6;
Link Here
|
21 |
use t::lib::TestBuilder; |
21 |
use t::lib::TestBuilder; |
22 |
use t::lib::Mocks; |
22 |
use t::lib::Mocks; |
23 |
|
23 |
|
24 |
use C4::Circulation qw( transferbook AddIssue GetTransfers ); |
24 |
use C4::Circulation qw( transferbook AddIssue ); |
25 |
use C4::Reserves qw( AddReserve ); |
25 |
use C4::Reserves qw( AddReserve ); |
26 |
use Koha::DateUtils qw( dt_from_string ); |
26 |
use Koha::DateUtils qw( dt_from_string ); |
27 |
use Koha::Item::Transfers; |
27 |
use Koha::Item::Transfers; |
Lines 317-334
subtest 'transferbook test from branch' => sub {
Link Here
|
317 |
barcode => $item->barcode, |
317 |
barcode => $item->barcode, |
318 |
trigger => "Manual" |
318 |
trigger => "Manual" |
319 |
}); |
319 |
}); |
320 |
my ($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber); |
320 |
my $transfer = $item->get_transfer; |
321 |
is( $from_branch, $library->branchcode, 'The transfer is initiated from the specified branch, not the items home or holdingbranch'); |
321 |
is( $transfer->frombranch, $library->branchcode, 'The transfer is initiated from the specified branch, not the items home or holdingbranch'); |
322 |
is( $to_branch, $item->homebranch, 'The transfer is initiated to the specified branch'); |
322 |
is( $transfer->tobranch, $item->homebranch, 'The transfer is initiated to the specified branch'); |
323 |
C4::Circulation::transferbook({ |
323 |
C4::Circulation::transferbook({ |
324 |
from_branch => $item->homebranch, |
324 |
from_branch => $item->homebranch, |
325 |
to_branch => $library->branchcode, |
325 |
to_branch => $library->branchcode, |
326 |
barcode => $item->barcode, |
326 |
barcode => $item->barcode, |
327 |
trigger => "Manual" |
327 |
trigger => "Manual" |
328 |
}); |
328 |
}); |
329 |
($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber); |
329 |
$transfer = $item->get_transfer; |
330 |
is( $from_branch, $item->homebranch, 'The transfer is initiated from the specified branch'); |
330 |
is( $transfer->frombranch, $item->homebranch, 'The transfer is initiated from the specified branch'); |
331 |
is( $to_branch, $library->branchcode, 'The transfer is initiated to the specified branch'); |
331 |
is( $transfer->tobranch, $library->branchcode, 'The transfer is initiated to the specified branch'); |
332 |
|
332 |
|
333 |
}; |
333 |
}; |
334 |
$schema->storage->txn_rollback; |
334 |
$schema->storage->txn_rollback; |
335 |
- |
|
|