Lines 146-152
subtest 'ModItemTransfer tests' => sub {
Link Here
|
146 |
); |
146 |
); |
147 |
|
147 |
|
148 |
ModItemTransfer( $item->itemnumber, $library1->{branchcode}, |
148 |
ModItemTransfer( $item->itemnumber, $library1->{branchcode}, |
149 |
$library2->{branchcode} ); |
149 |
$library2->{branchcode}, 'Manual' ); |
150 |
|
150 |
|
151 |
my $transfers = Koha::Item::Transfers->search( |
151 |
my $transfers = Koha::Item::Transfers->search( |
152 |
{ |
152 |
{ |
Lines 159-165
subtest 'ModItemTransfer tests' => sub {
Link Here
|
159 |
is($item->holdingbranch, $library1->{branchcode}, "Items holding branch was updated to frombranch"); |
159 |
is($item->holdingbranch, $library1->{branchcode}, "Items holding branch was updated to frombranch"); |
160 |
|
160 |
|
161 |
ModItemTransfer( $item->itemnumber, $library2->{branchcode}, |
161 |
ModItemTransfer( $item->itemnumber, $library2->{branchcode}, |
162 |
$library1->{branchcode} ); |
162 |
$library1->{branchcode}, 'Manual' ); |
163 |
$transfers = Koha::Item::Transfers->search( |
163 |
$transfers = Koha::Item::Transfers->search( |
164 |
{ itemnumber => $item->itemnumber, }, |
164 |
{ itemnumber => $item->itemnumber, }, |
165 |
{ order_by => { '-asc' => 'branchtransfer_id' } } |
165 |
{ order_by => { '-asc' => 'branchtransfer_id' } } |
Lines 168-175
subtest 'ModItemTransfer tests' => sub {
Link Here
|
168 |
is($transfers->count, 2, "Second transfer recorded on second call of ModItemTransfer"); |
168 |
is($transfers->count, 2, "Second transfer recorded on second call of ModItemTransfer"); |
169 |
my $transfer1 = $transfers->next; |
169 |
my $transfer1 = $transfers->next; |
170 |
my $transfer2 = $transfers->next; |
170 |
my $transfer2 = $transfers->next; |
171 |
isnt($transfer1->datearrived, undef, "First transfer marked as completed by ModItemTransfer"); |
171 |
isnt($transfer1->datecancelled, undef, "First transfer marked as cancelled by ModItemTransfer"); |
172 |
like($transfer1->comments,qr/^Canceled/, "First transfer contains 'Canceled' comment"); |
172 |
like($transfer1->cancellation_reason,qr/^Manual/, "First transfer contains cancellation_reason 'Manual'"); |
173 |
is($transfer2->datearrived, undef, "Second transfer is now the active transfer"); |
173 |
is($transfer2->datearrived, undef, "Second transfer is now the active transfer"); |
174 |
$item->discard_changes; |
174 |
$item->discard_changes; |
175 |
is($item->holdingbranch, $library2->{branchcode}, "Items holding branch was updated to frombranch"); |
175 |
is($item->holdingbranch, $library2->{branchcode}, "Items holding branch was updated to frombranch"); |
176 |
- |
|
|