|
Lines 52-71
sub item {
Link Here
|
| 52 |
return Koha::Item->_new_from_dbic($item_rs); |
52 |
return Koha::Item->_new_from_dbic($item_rs); |
| 53 |
} |
53 |
} |
| 54 |
|
54 |
|
| 55 |
=head3 from_library |
|
|
| 56 |
|
| 57 |
my $from_library = $transfer->from_library; |
| 58 |
|
| 59 |
Returns the associated from_library for this transfer. |
| 60 |
|
| 61 |
=cut |
| 62 |
|
| 63 |
sub from_library { |
| 64 |
my ($self) = @_; |
| 65 |
my $from_library_rs = $self->_result->frombranch; |
| 66 |
return Koha::Library->_new_from_dbic($from_library_rs); |
| 67 |
} |
| 68 |
|
| 69 |
=head3 transit |
55 |
=head3 transit |
| 70 |
|
56 |
|
| 71 |
Set the transfer as in transit by updating the datesent time. |
57 |
Set the transfer as in transit by updating the datesent time. |
|
Lines 159-173
sub cancel {
Link Here
|
| 159 |
->store; |
145 |
->store; |
| 160 |
|
146 |
|
| 161 |
# Set up return transfer if transfer was force cancelled whilst in transit |
147 |
# Set up return transfer if transfer was force cancelled whilst in transit |
| 162 |
# and we were not notified that the transfer is being replaced. |
|
|
| 163 |
# NOTE: We don't catch here, as we're happy to fail if there are already |
148 |
# NOTE: We don't catch here, as we're happy to fail if there are already |
| 164 |
# other transfers in the queue. |
149 |
# other transfers in the queue. |
| 165 |
if ($in_transit && !$params->{replace}) { |
150 |
try { |
| 166 |
try { |
151 |
$self->item->request_transfer( |
| 167 |
$self->item->request_transfer( |
152 |
{ to => $self->from_library, reason => 'TransferCancellation' } ); |
| 168 |
{ to => $self->from_library, reason => 'TransferCancellation' } ); |
153 |
}; |
| 169 |
}; |
|
|
| 170 |
} |
| 171 |
|
154 |
|
| 172 |
return $self; |
155 |
return $self; |
| 173 |
} |
156 |
} |