|
Lines 171-176
sub cancel {
Link Here
|
| 171 |
return $self; |
171 |
return $self; |
| 172 |
} |
172 |
} |
| 173 |
|
173 |
|
|
|
174 |
=head3 correction |
| 175 |
|
| 176 |
$transfer->correction(); |
| 177 |
|
| 178 |
Correct a mistaken transfer by cancelling the original and replacing it. |
| 179 |
|
| 180 |
=cut |
| 181 |
|
| 182 |
sub correction { |
| 183 |
my ( $self, $params ) = @_; |
| 184 |
|
| 185 |
# Update the cancelled date |
| 186 |
$self->set( |
| 187 |
{ datecancelled => dt_from_string, cancellation_reason => 'WrongTransfer' } ) |
| 188 |
->store; |
| 189 |
|
| 190 |
# Add new in_transet transfer |
| 191 |
my $transfer = Koha::Item::Transfer->new( |
| 192 |
{ |
| 193 |
itemnumber => $self->itemnumber, |
| 194 |
daterequested => dt_from_string, |
| 195 |
datesent => dt_from_string, |
| 196 |
frombranch => $self->item->holdingbranch, |
| 197 |
tobranch => $self->tobranch, |
| 198 |
reason => $self->reason, |
| 199 |
comments => $self->comment |
| 200 |
} |
| 201 |
)->store(); |
| 202 |
|
| 203 |
return $transfer; |
| 204 |
} |
| 205 |
|
| 174 |
=head3 type |
206 |
=head3 type |
| 175 |
|
207 |
|
| 176 |
=cut |
208 |
=cut |
| 177 |
- |
|
|