Lines 111-120
my $item_id4 = Koha::Item->new(
Link Here
|
111 |
)->store->itemnumber; |
111 |
)->store->itemnumber; |
112 |
|
112 |
|
113 |
#Add transfers |
113 |
#Add transfers |
|
|
114 |
my $trigger = 'Manual'; |
114 |
ModItemTransfer( |
115 |
ModItemTransfer( |
115 |
$item_id1, |
116 |
$item_id1, |
116 |
$branchcode_1, |
117 |
$branchcode_1, |
117 |
$branchcode_2 |
118 |
$branchcode_2, |
|
|
119 |
$trigger |
118 |
); |
120 |
); |
119 |
|
121 |
|
120 |
my $item_obj = Koha::Items->find({ itemnumber => $item_id1 }); |
122 |
my $item_obj = Koha::Items->find({ itemnumber => $item_id1 }); |
Lines 123-136
is( $item_obj->holdingbranch, $branchcode_1, "Item should be held at branch that
Link Here
|
123 |
ModItemTransfer( |
125 |
ModItemTransfer( |
124 |
$item_id2, |
126 |
$item_id2, |
125 |
$branchcode_1, |
127 |
$branchcode_1, |
126 |
$branchcode_2 |
128 |
$branchcode_2, |
|
|
129 |
$trigger |
127 |
); |
130 |
); |
128 |
|
131 |
|
129 |
# Add an "unsent" transfer for tests |
132 |
# Add an "unsent" transfer for tests |
130 |
ModItemTransfer( |
133 |
ModItemTransfer( |
131 |
$item_id3, |
134 |
$item_id3, |
132 |
$branchcode_1, |
135 |
$branchcode_1, |
133 |
$branchcode_2 |
136 |
$branchcode_2, |
|
|
137 |
$trigger |
134 |
); |
138 |
); |
135 |
my $transfer_requested = Koha::Item::Transfers->search( { itemnumber => $item_id3 }, { rows => 1 })->single; |
139 |
my $transfer_requested = Koha::Item::Transfers->search( { itemnumber => $item_id3 }, { rows => 1 })->single; |
136 |
$transfer_requested->set({ daterequested => dt_from_string, datesent => undef })->store; |
140 |
$transfer_requested->set({ daterequested => dt_from_string, datesent => undef })->store; |
Lines 139-145
$transfer_requested->set({ daterequested => dt_from_string, datesent => undef })
Link Here
|
139 |
ModItemTransfer( |
143 |
ModItemTransfer( |
140 |
$item_id4, |
144 |
$item_id4, |
141 |
$branchcode_1, |
145 |
$branchcode_1, |
142 |
$branchcode_2 |
146 |
$branchcode_2, |
|
|
147 |
$trigger |
143 |
); |
148 |
); |
144 |
my $transfer_cancelled = Koha::Item::Transfers->search( { itemnumber => $item_id4 }, { rows => 1 })->single; |
149 |
my $transfer_cancelled = Koha::Item::Transfers->search( { itemnumber => $item_id4 }, { rows => 1 })->single; |
145 |
$transfer_cancelled->set( { daterequested => dt_from_string, datesent => undef, datecancelled => dt_from_string } )->store; |
150 |
$transfer_cancelled->set( { daterequested => dt_from_string, datesent => undef, datecancelled => dt_from_string } )->store; |
Lines 239-251
$dbh->do("DELETE FROM branchtransfers");
Link Here
|
239 |
ModItemTransfer( |
244 |
ModItemTransfer( |
240 |
$item_id1, |
245 |
$item_id1, |
241 |
$branchcode_1, |
246 |
$branchcode_1, |
242 |
$branchcode_2 |
247 |
$branchcode_2, |
|
|
248 |
$trigger |
243 |
); |
249 |
); |
244 |
my $transfer = Koha::Item::Transfers->search()->next(); |
250 |
my $transfer = Koha::Item::Transfers->search()->next(); |
245 |
ModItemTransfer( |
251 |
ModItemTransfer( |
246 |
$item_id1, |
252 |
$item_id1, |
247 |
$branchcode_1, |
253 |
$branchcode_1, |
248 |
$branchcode_2 |
254 |
$branchcode_2, |
|
|
255 |
$trigger |
249 |
); |
256 |
); |
250 |
$transfer->{_result}->discard_changes; |
257 |
$transfer->{_result}->discard_changes; |
251 |
ok( $transfer->datearrived, 'Date arrived is set when new transfer is initiated' ); |
258 |
ok( $transfer->datearrived, 'Date arrived is set when new transfer is initiated' ); |
252 |
- |
|
|