Lines 152-161
sub resolve_claim {
Link Here
|
152 |
my $claim = Koha::Checkouts::ReturnClaims->find($claim_id); |
152 |
my $claim = Koha::Checkouts::ReturnClaims->find($claim_id); |
153 |
|
153 |
|
154 |
return $c->render( |
154 |
return $c->render( |
155 |
status => 404, |
155 |
status => 404, |
156 |
openapi => { |
156 |
openapi => { error => "Claim not found" } |
157 |
error => "Claim not found" |
|
|
158 |
} |
159 |
) unless $claim; |
157 |
) unless $claim; |
160 |
|
158 |
|
161 |
return try { |
159 |
return try { |
Lines 167-185
sub resolve_claim {
Link Here
|
167 |
my $user = $c->stash('koha.user'); |
165 |
my $user = $c->stash('koha.user'); |
168 |
$resolved_by //= $user->borrowernumber; |
166 |
$resolved_by //= $user->borrowernumber; |
169 |
|
167 |
|
170 |
$claim->set( |
168 |
$claim->resolve( |
171 |
{ |
169 |
{ |
172 |
resolution => $resolution, |
170 |
resolution => $resolution, |
173 |
resolved_by => $resolved_by, |
171 |
resolved_by => $resolved_by, |
174 |
resolved_on => \'NOW()', |
172 |
new_lost_status => $new_lost_status, |
175 |
updated_by => $resolved_by, |
|
|
176 |
} |
173 |
} |
177 |
)->store; |
174 |
)->discard_changes; |
178 |
|
|
|
179 |
if ( defined $new_lost_status ) { |
180 |
$claim->checkout->item->itemlost($new_lost_status)->store; |
181 |
} |
182 |
$claim->discard_changes; |
183 |
|
175 |
|
184 |
return $c->render( |
176 |
return $c->render( |
185 |
status => 200, |
177 |
status => 200, |
186 |
- |
|
|